# Society of Robots - Robot Forum

## Electronics => Electronics => Topic started by: Adityav95 on November 04, 2011, 02:59:27 AM

Title: op amp in circuit diagram
Post by: Adityav95 on November 04, 2011, 02:59:27 AM
Hi guys,

I was working on a circuit and didn't understand how to connect what/where in the op amp. Could someone help me in reading and understanding the diagram? I have attached both a close-up and a picture of the whole circuit.

Thanks
Title: Re: op amp in circuit diagram
Post by: Soeren on November 04, 2011, 05:32:21 AM
Hi,

I was working on a circuit and didn't understand how to connect what/where in the op amp.
The schematic looks quite clear, so what exactly are your doubts?

Could someone help me in reading and understanding the diagram?
Looking at one channel. The input signal, terminated in 4.7kOhm, is compared to whatever voltage is set on the 10kOhm trimmer. If the input signal is below this reference voltage, the output will be low and v.v. - that's all there is to that circuit.

It's poorly designed, if the term "designed" should enter the equation at all - randomly thrown together by blind person would explain it better :D

I don't know what drives it, so I cannot tell you if 4k7 is a good choice for termination, but it's an odd value.

Using op-amps when you really need a comparator is a poor solution - sure, they look the same when you draw a schematic and for slow signals, they might sort of work, but that doesn't mean that they're freely interchangeable.

The comment "SET_TO_BARELY_ABOVE_ZERO" is unclear. Does it refer to the "zero" of the input signal or to the 0V in the circuit - Unless you have more info on the circuit, you cannot know.

In any case, the trimmer should not cover the range 0..5V if it's to be set with any kind of precision. If the reference should be "barely over 0V" a 1k trimmer in series with a 10k resistor would allow 10 times the adjustment precision and 1k/100k would be even better. If it's the audio signals zero cross that is referred to, a resistor would go on each side of the trimmer.

What are you gonna use it for?
Title: Re: op amp in circuit diagram
Post by: Adityav95 on November 05, 2011, 04:55:03 AM
I'm using it to get serial out of my android phone's audio port and input it to my roboduino.

Quote
The schematic looks quite clear, so what exactly are your doubts?

It's not that the schematic is not clear, it's just that I'm not good at reading circuit diagrams and I have no idea how to connect each wire to which pin on the op-amp and that kind of stuff. For example the lm324ad op amp on the top (U1A) is recieving voltage from VCC, now i have no idea which pin on the op-amp should i connect the VCC wire to and so on.....So i would appreciate it if u could help me with the pins on the op amp and how to understand which pins to connect what to....

Thanks
Title: Re: op amp in circuit diagram
Post by: billhowl on November 05, 2011, 07:47:09 AM
You have to refer to datasheet for pins connection.
(http://circuits.datasheetdir.com/37/STMICROELECTRONICS-LM224A-pinout.jpg)
Title: Re: op amp in circuit diagram
Post by: Soeren on November 05, 2011, 02:59:44 PM
Hi,

I'm using it to get serial out of my android phone's audio port and input it to my roboduino.
OK, an LM393 would be a better choice for the purpose, but for slow baud rates, the LM324 might work.

It's not that the schematic is not clear, it's just that I'm not good at reading circuit diagrams and I have no idea how to connect each wire to which pin on the op-amp and that kind of stuff. For example the lm324ad op amp on the top (U1A) is recieving voltage from VCC, now i have no idea which pin on the op-amp should i connect the VCC wire to and so on.....So i would appreciate it if u could help me with the pins on the op amp and how to understand which pins to connect what to....
The pin numbers are on the schematic you posted (small blue numbers), so I still don't get what you need further.
Anyway, hold it up against the pinout that billhowl posted and I'm sure you'll get it :)

There is a drawing mistake btw. as pins 4 and 11 shouldn't be repeated on both op-amps (as they're both part of the same physical IC).
Title: Re: op amp in circuit diagram
Post by: Adityav95 on November 05, 2011, 11:04:57 PM
Quote
The pin numbers are on the schematic you posted (small blue numbers), so I still don't get what you need further.
Well I didn't know they were the pin outs!

Anyway....thanks soeren and billhowl...got it now.

@soeren: out of curiosity....in what way is the lm393better? I mean using the lm324 some guy has reached 24000bps. I think 9600bps is fast enough for my current needs.
Title: Re: op amp in circuit diagram
Post by: rbtying on November 06, 2011, 09:22:19 AM
Considering that 24000 baud is not a standard value, and 2400 baud is, are you sure there wasn't a misread or a typo involved somewhere along the line there?

(standard / common baud rates: 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400)
Title: Re: op amp in circuit diagram
Post by: Soeren on November 07, 2011, 01:49:12 PM
Quote
The pin numbers are on the schematic you posted (small blue numbers), so I still don't get what you need further.
Well I didn't know they were the pin outs!

Anyway....thanks soeren and billhowl...got it now.

@soeren: out of curiosity....in what way is the lm393better? I mean using the lm324 some guy has reached 24000bps. I think 9600bps is fast enough for my current needs.
Title: Re: op amp in circuit diagram
Post by: Adityav95 on November 09, 2011, 02:43:51 AM
@rbtying: nope....it is 24000 and it is specifically mentioned that it is a non standard value and 19200 is the max standard value possible with circuit.
Title: Re: op amp in circuit diagram
Post by: Soeren on November 09, 2011, 03:35:00 AM
Hi,

Just realize that my previous post somehow F'd up completely.
The op-amp is optimized for linear work and is a very old chip, with a low gain-bw product and a low slew rate, while a comparator is of a more digital nature and switches faster (since it isn't made for linear, just bang-bang, either high or low)

Make one of each and study them with a genny and a 'scope and you will see for yourself.

Instead of referring to what the page said, posting a link would be the proper way to proceed, as it will give more info about what thoughts went into it.

And there's a thing to remember with amateur circuits found on the web... Perhaps the guy who made it had an especially good LM324, was more experienced (or lucky) with this stuff.

I think the major cause for shaky amateur designs found on the web is the newbies ubiquitous "hey, it works even if I leave out R3..R7, C2 and the two diodes, so I can save a nickel".
If I had a nickel for each time I made a design for a noob and he went "can we leave out some of the components", I'd have... Well,  a lot ;D

A pro design would make sure that it worked with any versions of a given chip or tell if a certain type was needed. All the "annoying extras" in a pro design is what makes it stable and repeatable. A circuit that takes endless hours of adjusting trimmers and what not, isn't really worth the effort.

People who want to fly on a wing and a prayer better be good prayers - or at least know how to wing it  ;D
Title: Re: op amp in circuit diagram
Post by: Adityav95 on November 09, 2011, 05:12:58 AM
Here are the links:
The main site: http://robots-everywhere.com/re_wiki/index.php?title=Serial_on_Android_using_the_audio_port (http://robots-everywhere.com/re_wiki/index.php?title=Serial_on_Android_using_the_audio_port)

The android app: https://market.android.com/details?id=re.serialout&feature=search_result#?t=W251bGwsMSwxLDEsInJlLnNlcmlhbG91dCJd (https://market.android.com/details?id=re.serialout&feature=search_result#?t=W251bGwsMSwxLDEsInJlLnNlcmlhbG91dCJd)

I think it is a reliable circuit....quite a few have rated 5 stars in the market and more than a 1000 downloads. I really cant comment on how professional it is....u might be able to help though..btw i'll try it with the lm393 also and see if it makes any difference at all with my roboduino.

Thanks
Title: Re: op amp in circuit diagram
Post by: Soeren on November 09, 2011, 07:45:21 PM
Hi,

Here are the links:
I took a look at the first page only (as I cannot use the software on my phone anyway).
Not much extra info on that page and what is there tells me that he couldn't care less of standards...
Quote
[...] you will get a nice TTL signal from this. If you invert it, you can talk to a RS232 serial port directly.
EIA/TIA-232 (which is the correct name) can, in general, not be driven from an inverted TTL signal and on the computers where it will work (mostly laptops), it's only because the '232 port is not correctly implemented.

I think it is a reliable circuit....quite a few have rated 5 stars in the market and more than a 1000 downloads.
1000 downloads means that it has been downloaded 1000 times, not that it's of a certain quality (just think of some of the crappiest soap operas that nets millions of viewers).
That a part of the downloaders have rated it 5 stars may be a badge of quality... If those rating it are competent to do so.
Any piece of software for free download I have seen (using 0..5 stars for rating) with more than 20..30 DLs have a rating of 3 to 5, which gives me the following info:
A rating of 3 means that it sucks big time
Most users either don't understand the concept of fair judging, or have nothing to compare with, so they are just happy getting something for free, whether it is useful and appropriate for the task at hand or not.
Just like a 5 star rated program I downloaded a few days ago and when I was about to test it, I realized that a batch file would do it faster, neater and without using any extra software - and people rated it 5 stars! ???

I really cant comment on how professional it is....u might be able to help though..btw i'll try it with the lm393 also and see if it makes any difference at all with my roboduino.
No pro would use an op-amp for a comparator in time critical tasks (or he should be given a monster wedgie anyway).
Another give-away is the trimmer resistor. A pro would have DC isolated the inputs and used a common reference voltage - it would then work for all compatible phones, DC offset or not.

As this is a one way link, it cannot request packet re-transmissions in case it loses data, so if you check with a long string of eg. A5 hex (or any other sensibly chosen test bytes), it should be very easy to spot when the limit is reached, as it will then receive garbage.
Making a receiving program that counts the number of errors in eg. 100kB sent will help you get the error rate at the least amount of work.

When you make the circuit with the LM393, you'll need a pull up resistor on each output (4.7kOhm is a good choice), as the LM393 has got open collector outputs, so can only pull to ground). The 100 Ohm resistors in series with the outputs can be discarded (they're for short circuit protection of the LM324), as long as you cannot accidentally connect the output to +5V (leave them in if in doubt).