Shop OBEX P1 Docs P2 Docs Learn Events
OPAMP knowledge i have none - can someone help me please? — Parallax Forums

OPAMP knowledge i have none - can someone help me please?

pacmanpacman Posts: 327
edited 2011-03-03 18:25 in General Discussion
OK, as part of this thread http://forums.parallax.com/showthread.php?127670-Dupline-interface&p=958940#post958940 i have been looking at op amps.

Basically I have a 0 - 12V square wave, that i need to 'load' as lightly as possible. Hence an op amp as a voltage follower. Then I need to take the output of the op amp to the prop input pin where I sense high or low (and the prop does some 'how long high/low' timing)

Now I _think_ I might have a candidate in the INA114 op amp, but there are few things i don't understand - perhaps someone can give me a heads-up

Most op amps need dual rail power. What happens if an op-amp is connected to a supply that is only single rail? Specifically if I'm looking at an input voltage that only ever is positive (2 -> 12 volts) then could I use a INA114 {for example} on a single supply?

Does the supply to the op amp need to be of a higher voltage than the input signal? I've read the data sheet and don't get it. All I want is a voltage 'out' of the op amp that swings from a propeller low to a propeller high input for the pins to detect (if i need to "voltage divider" the op amp output I can live with that). So if I supplied the INA114 with a 5V power supply (single ended) but the input signal was upto 12V what sort of things would happen? would i even go close to a usable output signal or would magic smoke come out?

Is there a similar (but a much better) fit of op amp I should look at?

Thanks in advance
«1

Comments

  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-02-07 00:39
    Quick post as I'm at work.
    Most op amps can't go rail to rail, eg the LM324 goes within 1.5V of the supply ie with a 5V supply it can't go below 1.5V nor above 3.5V. So for 5V you set up a virtual earth at 2.5V (two resistors, then run the volts through a voltage follower using one of the quad op amps), and then everything is 2.5V+/- 1V. I've got a lot of circuits standardised for that and it avoids the need for dual rail supplies.

    If you ran the op amp off 12V then it can go 1.5V to 10.5V. Only catch there is if you ever feed that into a propeller you could zap the pin.

    One nice op amp I use a lot is the CA3140 as it can run rail to rail.

    The CA3140 minimum supply is 4V. The INA114 is 4.5V, so either way you might need a separate supply to the 3V propeller supply. Maybe a 5V supply?

    Are you using the propeller to op amp, or op amp into the propeller?
  • LeonLeon Posts: 7,620
    edited 2011-02-07 04:08
    Any op amp can be persuaded to work from a single supply, but some are better than others.

    Many of the current op amps are rail to rail. The LT1677 is popular for low-noise applications:

    http://www.linear.com/pc/productDetail.jsp?navId=H0,C1,C1154,C1009,C1021,P1844

    and will work from a single 3V supply. They are a bit expensive, though.
  • pacmanpacman Posts: 327
    edited 2011-02-07 16:27
    To clarify, on the rail-to-rail thing..

    So If had an {ideal} op amp powered from +/- 5V but my input signal went 0 ->20 V, would the output be a voltage follower in the 0->10V range (referenced to the -ve power supply rail) and then as the input signal climbed above 10+ Volts the output of the op amp sits at 10V ?


    And I know no op amp is ideal..

    Thanks for your help in my 'learnin' by the way
  • pacmanpacman Posts: 327
    edited 2011-02-07 16:31
    Dr_Acula wrote: »
    Quick post as I'm at work.

    Are you using the propeller to op amp, or op amp into the propeller?

    Big bad signal -> op amp -> prop

    Op amp is to isolate the singal from anything the prop does to it. I don't actually need to know the value of the input signal, just if it is greater than voltage X or less than voltage Y (X does not equal Y). The prop just times how long at X and Y voltages.
  • LeonLeon Posts: 7,620
    edited 2011-02-07 16:50
    pacman wrote: »
    To clarify, on the rail-to-rail thing..

    So If had an {ideal} op amp powered from +/- 5V but my input signal went 0 ->20 V, would the output be a voltage follower in the 0->10V range (referenced to the -ve power supply rail) and then as the input signal climbed above 10+ Volts the output of the op amp sits at 10V ?

    You will damage the op amp with an input higher than the supply voltage. You need to use a voltage divider on the input to reduce the range to 0 - 5V.

    As the input is always positive, you could use a single 5V supply for the op amp.

    Here are a couple of good texts on op amps:

    http://focus.ti.com/lit/an/slod006b/slod006b.pdf

    http://focus.ti.com/lit/an/sboa092a/sboa092a.pdf
  • Don MDon M Posts: 1,653
    edited 2011-02-07 17:38
    Why not use an optoisolator? That way you are isolated from the higher voltage signal if all you are looking for is a high/low and don't care about the specific amplitude of the signal. No special supplies needed. Will work off 3.3 volt prop supply.

    Just a suggestion....
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-02-07 17:45
    Optoisolators are not a "light load" as required by the OP. I would suggest using a MOSFET. If the frequency is not terribly high, driving the gate will entail a very light load. With the source grounded and the drain pulled up to 3.3V, you'll get your level translation at a minum of cost and components.

    -Phil
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-02-07 18:34
    The INA114 datasheet refers to "input overload protection". Input overload protection. Good that it has the instrumentation amp hallmark extraordinarily high input impedance.
    (If only there was an eyebrow-raising smily. Anyway.)
    Still, the INA114 output isn't digital. You need a logic_hi when V_in >= 2.5V, so you'll accomplish that with a comparator.
  • pacmanpacman Posts: 327
    edited 2011-02-07 21:38
    Leon wrote: »

    Thanks for these Leon. I suspect they will keep me reading for months (and generate several bucket loads more "holes" in my knowledge)
  • pacmanpacman Posts: 327
    edited 2011-02-07 21:49
    Optoisolators are not a "light load" as required by the OP. I would suggest using a MOSFET. If the frequency is not terribly high, driving the gate will entail a very light load. With the source grounded and the drain pulled up to 3.3V, you'll get your level translation at a minum of cost and components.

    -Phil

    The only concern I had with this is that (I thought) it ties the signal ground to my circuit ground. I wanted to get a high degree of isolation between the two and I thought the "instrument amplifer" was the way to go. Then no matter if my circuit pulled a wobbly then I would not infuluence the signal (or its associated ground) in any way. Please tell me if I am mistaken? (which if history is any mark - is highly likely)

    And you are correct about the optoisolator - that is precisly the reason I discarded it. For similar reason I also discarded the voltage divider (as well as the isolation reason)
  • pacmanpacman Posts: 327
    edited 2011-02-07 21:52
    PJ Allen wrote: »
    The INA114 datasheet refers to "input overload protection". Input overload protection. Good that it has the instrumentation amp hallmark extraordinarily high input impedance.
    (If only there was an eyebrow-raising smily. Anyway.)
    Still, the INA114 output isn't digital. You need a logic_hi when V_in >= 2.5V, so you'll accomplish that with a comparator.

    Hence I was prepared to voltage divide the output of the opamp. I was mainly using the op-amp for isolation and light loading. Anything after the op-amp is fair game.....

    And (showing my ignorance - so ring that bell :-) ) why is the statement so odd?
  • LeonLeon Posts: 7,620
    edited 2011-02-08 00:37
    It's not a good idea to depend on input protection and high impedance in a design. You should limit the voltage before applying it to the op amp, as I mentioned previously.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-02-08 02:59
    Phil really points you in the right direction. One MOSFET can do it all. But if you must use other devices, here are a few comments.

    This is an interesting thread and a great topic. Recently I've been fooling around with ultra low-noise, low distortion op amps for use in audio applications, but wondering about their use in digital context and what exactly are problems of interface.

    I suspect that you may eventually end up with a comparitor doing the job you want. Intuitively, it is merely a purposed op-amp adapted for digital input. A lot of issues and problems disappear by building around a comparitor rather than an op-amp. If you must have a high degree of amplification, having the op amp feed the comparitor may be the final solution rather than adapting an op amp to behave like a comparitor.

    Additionally, the fact that you can't easily get rail-to-rail op amps for use between 0 volts at the low side and 3.3 volts at the high, indicates why bother with them at all? For a simple design with good performance, they generallly prefer a dual power supply. You have a range between 0 and 3.3 volts for your digital input. That is pretty tight when you can't quite get down to zero on a single voltage supply, even if you can get an op amp to work well at 3.3 volts on the high side.

    BTW, if you have a peak of +12volts going into a +3.3v powered opamp (regardless of what it maximum voltage specs are), you are going to have stability problems. Op amps are designed - at best - to operate from rail-to-rail of their supply voltages and NOT beyond...
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-02-08 04:48
    It's C-O-M-P-A-R-A-T-O-R !
    C-O-M-P-A-R-A-T-O-R !

    Yeah, I'm gonna get me one o' them magic V-gsth fets and all my dreams'll cum true.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-02-08 05:33
    Ugh.. after years of diligently correcting my spelling and grammar, ain't I allowed a mistaek?

    PJ nonetheless seems to have doubts that you will get anything near the high impedance of an op amp with a MOSfet. That may be true, but some bench testing is really going to tell the tale of which solution you really need. Just because op amps have the highest gain doesn't mean you actually need that much.
  • pacmanpacman Posts: 327
    edited 2011-02-08 11:34
    I don't actually need the gain - if I could get an op-amp with 0.25 gain that would be marvellous (12V input, 3V output), but that would probably involve all sorts of other compoents that might impact my isolation.

    Of course this op-amp has to have all the other 'things' I need , high stability, operates on 3.3V (but can accept 12V input), etc, etc. I have seen op-amps with gains as low as 0.1 (but not the isolation I crave)

    A comparator (however it's spelt) is good, I guess i could cascade two op-amps (one to give me really good isolation, the 2nd to actually do the comparing)..or an op amp and a fet... hmm...
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-02-09 23:41
    I have been pondering my mention of gain as this whole topic is really a concern about impedances and matching them.

    My further thoughts are that Maxim (or someone else) is likely to make a specialty line reciever that just hooking in may resolve everything and this provides the least disruption to your original signal.

    Maxim and others also make a wide variety of specialty comparators that may do it all in a single unit as well. Essentially what you are looking for is a 'voltage level shifter' that will shift down while not disrupting communications. Since most twisted pair signals are tolerate of more than one receiver (dependent upon limitations of data rate and length of wire), I suspect that your concerns of keeping the signal pure are excessive. A lot of devices clean up received data with a hystersis device on the receiving end.

    Your proprietary Dupine network looks suspiciously like it may use RS-422/RS-485 line drivers and recievers at the hardware level.
  • pacmanpacman Posts: 327
    edited 2011-02-10 00:29
    I too have been doing some more digging and have found a document that states that a "logic high" is 8.2 volts and a logic low is 2.2V. Convient that many companies make a 2.2V comparator "off the shelf".

    My concern is that this signal line is used is some applications where stop/go signals are run along it (think lanyards along a conveyor). As it is part of a safety circuit I _really_ don't want to impact on the ability to "stop" when required.

    I should soon be able to borrow a cro (and a gererator board) and can test the signal with my circuit connected and not connected.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-02-10 08:00
    pacman wrote:
    I too have been doing some more digging and have found a document that states that a "logic high" is 8.2 volts and a logic low is 2.2V. Convient that many companies make a 2.2V comparator "off the shelf".
    I' m not sure I've ever seen a "2.2V comparator". But that's certainly not going to help you. For the best reliability, you need to split the difference and compare to ~5.2V.

    -Phil
  • pacmanpacman Posts: 327
    edited 2011-02-10 12:04
    Phil, the reason you haven't seen on is that they dont exist - 2V2 voltage DETECTORS do exist http://www.chinaelite.com/pdf/HT7022A.PDF - just I used the wrong words.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-02-10 12:36
    A voltage detector is not going to have a high input impedance, since the "input" has to power the entire chip. A regular comparator would be better.

    -Phil
  • zoopydogsitzoopydogsit Posts: 174
    edited 2011-02-10 12:42
    Hi Packman,

    I just looked at your original thread and googled what you were trying to do. The following came up with a lot of interesting links;
    http://www.google.com.au/search?hl=en&rls=com.microsoft%3Aen-us%3AIE-SearchBox&q=dupline+electrical+specifications&aq=f&aqi=&aql=&oq=

    One of the links that peaked my interest was on "Profibus". and gave some pointers to some TI interface chips.
    http://www.datasheetarchive.com/Profibus-datasheet.html

    Looking at this, maybe what you might need is;
    http://focus.ti.com/lit/ds/symlink/iso1176.pdf

    _IF_ what you are trying to connect to is the same as Profibus, then getting an off the shelf driver may make your life a lot easier. On the downside, if you are trying to interface with other devices on this bus, then the challenge will be to understand how the protocol works, though there may be (more research required) an actual device that will handle the protocol, you just latch it data.

    Let us know what you find/end up doing. I'd much prefer to run a loop of twisted pair round the house and garden to talk props than running point to point connections. I had been toying with the idea of setting up an RS485 network to achieve this but would then need to write the protocol.
  • pacmanpacman Posts: 327
    edited 2011-02-10 18:49
    Hi Packman,

    I just looked at your original thread and googled what you were trying to do. The following came up with a lot of interesting links;
    http://www.google.com.au/search?hl=en&rls=com.microsoft%3Aen-us%3AIE-SearchBox&q=dupline+electrical+specifications&aq=f&aqi=&aql=&oq=

    One of the links that peaked my interest was on "Profibus". and gave some pointers to some TI interface chips.
    http://www.datasheetarchive.com/Profibus-datasheet.html

    Looking at this, maybe what you might need is;
    http://focus.ti.com/lit/ds/symlink/iso1176.pdf

    _IF_ what you are trying to connect to is the same as Profibus, then getting an off the shelf driver may make your life a lot easier. On the downside, if you are trying to interface with other devices on this bus, then the challenge will be to understand how the protocol works, though there may be (more research required) an actual device that will handle the protocol, you just latch it data.

    Let us know what you find/end up doing. I'd much prefer to run a loop of twisted pair round the house and garden to talk props than running point to point connections. I had been toying with the idea of setting up an RS485 network to achieve this but would then need to write the protocol.

    I have exhaused most (all?) of the first set of those links you mentioned. I understand the protocol, but I'm having a great deal of pain trying to ensure any device I fit is not in danger of distoring the signal. It can't be that hard (I can be that thick however, so a suitable interface curcuit is currently eluding me...).

    I could use one of the devices that does the interface for me (but they start at over $800 - just for the interface)

    Currently I'm thinking op-amp to isolate the signal, then a comparator/volatage detector then into the prop.

    I'm not currently planning on putting data onto the bus - only reading from it - Though I think I've also got a reasonable idea how that happens as well...


    If I figure it all out I'm sure the forum will hear about it - you'll hear my shouts of joy where ever you are...


    @Phil - Thanks for the heads-up on the voltage detector, I was looking at a few data sheets and the impedance question wasn't beeing answed - now I know why.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-02-11 23:04
    Firstly, I suspect some comparitors do have a very high impedance input and you can do without the op amp at the front end.

    Secondly and more important is that any control network that claims this level of reliablity and sophistication must have some features in software and firmware to recover from misshaped signals. CAN bus certainly does.

    My ambitions of snooping CANbus were pretty much thwarted by the vast number of schemes that can encode nodes and related data even with a good device to hook in and just observe without disrupting the communication.

    Why so? Failed communications may be spontaneously repeated as collision management is involved. Also, a master may just poll the network at some regular interval to assure everything is on line. Hacking a pair of devices may be easy, but snooping an active and functioning network with many nodes will be into huge permutations of possiblities.

    Finally, that perfect signal you want to preserve is on a wired network and changes in network geometry and length of wire are going to always affect it. In other words, the signal is merely within spec and never perfect. Factors outside your control can take it out of spec unless tightly controlled as well.

    BTW, the more a get into op amps, the more I see personal preference being a huge factor in choice. There are so many good ones out there that people just love the one they know. I suspect you are just going to have to try a few to see if like them. If you are really worried, buy an expensive one that offer a lot of good rugged features - power supply noise rejection, ultra low noise, very high bandwidth, rail-to-rail reponse, and so on. Starting with a cheaper one that has known quirks and issue may just waste time and effort.

    The guys that manufacture this network MUST be using a simple reliable solution for line drivers and line recievers. At some point all successful proprietary design crosses over into good generic engineering for the sake of stability.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-02-12 02:28
    Basically I have a 0 - 12V square wave, that i need to 'load' as lightly as possible. Hence an op amp as a voltage follower. Then I need to take the output of the op amp to the prop input pin where I sense high or low (and the prop does some 'how long high/low' timing)

    Isn't that just one op amp and four resistors?

    Supply the op amp from 12V. Use two 10k resistors to divide by 2 and feed the 6V to the negative input. Feed your voltage to the +ve input - that will be high impedance. The output will swing 0V to 12V. Use two more resistors to divide by 4 eg 33k and 10k. Feed that into the propeller.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-02-12 18:57
    Okay, I will risk all and suggest a particular op amp that is vetted for use as a 'Line Driver' or 'Line Reciever'

    You have to begin somewhere. Try the OPA134, OPA2134, OPA4134 series. You will need to supply at least 5V for power in a single rail use or + and - 2.5 volts in a dual rail use. All the other parameters seem to be suitable to me.

    If you really need education, read 'The Art of Electronics' as it has a well developed discussion of op amps with various listings for selection and even one short list of preferred choices. It isn't comprehensive and there are some newer high performance op amps available, but it certain mentions enough to do this job.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-02-12 21:23
    I can't for the life of me understand why an op-amp would be preferable over a comparator in this app. A comparator is just a high gain op amp characterized for open-loop operation. Most have open collector outputs, which means they are compatible with any system Vdd, regardless of the op-amp's own power supply. It's the natural choice for the stated objective.

    -Phil
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-02-13 22:24
    I suspect there is a strong perception that the right op amp will just do anything better. I am with you that a comparator, especially the right one will provide a simpler design project.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-02-14 02:29
    A LM3900 quad comparator ought to do the job in conjunction with the voltage divider resistors as in post #26. Just checking the internal circuit - I think it is a source rather than a sink on the output, so a divider down to zero ought to work.
  • pacmanpacman Posts: 327
    edited 2011-02-16 12:03
    I can't for the life of me understand why an op-amp would be preferable over a comparator in this app. A comparator is just a high gain op amp characterized for open-loop operation. Most have open collector outputs, which means they are compatible with any system Vdd, regardless of the op-amp's own power supply. It's the natural choice for the stated objective.

    -Phil

    Phil - The main reason I was leaning towards an op-amp is due to lack of knowledge. I didn't seem to be able to find a suitable chip comparator with a suitable input impedance/resistance (higher is better isn't it?). A lot of the chip based comparators I looked at didn't even mention input impedance.

    The other reason that appealed to me (perhaps incorrectly) for an opamp is I could pick up both the +ve and -ve of the input signal and isolate it from the rest of the circuit. most 'concept' circuits on the data sheets I saw seemed to tie the -ve together. And my paranoia suggested that better isolation was good..


    @ Dr_Acualla - thanks for the chip. I'll do more investigation.


    AND THANKS TO EVERYONE for ALL your input on this. I have learnt "stuff" (that i didn't know I didn't know).
Sign In or Register to comment.