Differential amplifier operation - Page 1
Forum section: electronics / beginners

author: Mandelbrot
author_rank: Regular Contributor
timestamp: June 14, 2013, 03:49:36 am
content: Hello again,I am using a potentiometer to set the current limit and then measuring the voltage difference across a series resistor to actually figure out the real current. To do this I am using a unity gain differential amplifier where all the resistors are 2 MOhm (is this too high?) and the normal differential amp configuration. It does what I think it should do in SPICE but my actual circuit doesn't work. It works fine when the voltage difference is large enough, but when the voltage difference is too small the output is always 1.245V. Is there some fundamental thing about differential amplifiers I'm missing? I'm using a UA741 Op amp if that matters with both offset null pins grounded.Thanks, and sorry for asking so many questions!

author: c4757p
author_rank: Super Contributor
timestamp: June 14, 2013, 03:54:18 am
content: There's an important part left out here - how are you supplying power?

author: Mandelbrot
author_rank: Regular Contributor
timestamp: June 14, 2013, 03:58:50 am
content: Good point! I'm using 5V on the positive rail and 0V on the negative rail. I don't care if it can't go negative and the difference should never be more than 1.25 in the final circuit.

author: awallin
author_rank: Frequent Contributor
timestamp: June 14, 2013, 07:15:56 am
content: Your image above has the op-amp inputs flipped!-input should have the feedback from the output+input should have voltage divider to groundbut maybe you built your actual circuit correctly anyway since it seems to work...

author: Andy Watson
author_rank: Super Contributor
timestamp: June 14, 2013, 08:41:08 am
content: Ah, the 741, my first encounter with a real op-amp. Unity gain stable, freedom from latch-up - luxury! But that was nearly four decades ago.Taking off the rose tinted glasses: The 741 is, by today's standards, pretty cruddy. It''s a bi-polar design, it needs bias current for the input transistors. TI's data sheet says it has 1M ohm input impedance - that's probably a worst case figure, but you need to keeps the input impedances down if you want to see sensible results - I would say 100k maximum. Also, it's not a rail to rail op-amp. 1.245V probably indicates the lowest voltage (w.r.t. the -ve rail) that the output can achieve - it's saturated. And, if TI's data is to be believed, the minimum operating supply voltage is 10V, or +/- 5V.

author: free_electron
author_rank: Super Contributor
timestamp: June 14, 2013, 01:50:53 pm
content: It should be considered a crime to let beginners have their hands on SPICE.One should only get access to that program once he/her fully understands the lies that tool is capable of producing...The 741 output can't go that low....

author: c4757p
author_rank: Super Contributor
timestamp: June 14, 2013, 01:54:24 pm
content: Whoops! Forgot to hit "notify". Yep, the LM741 can't go anywhere near its power rails. Why thehellare you simulating using an ideal op amp? LM741 is about as far as you can get from that without a time machine...

author: steve30
author_rank: Frequent Contributor
timestamp: June 14, 2013, 03:26:18 pm
content: I often tend to run into problems with differential amps. Though I have had some that work correctly.Personally, I'd try smaller resistors. 2M seems too high. Try 100k, and if that's no good, try even lower, like maybe 10k or 4k7.The fact that it only goes to 1.25V is not surprising with a 0V supply. A 741's output can only go to about negative supply +1.25V, and positive supply -1.25.If you want the output to go down to 0V with a 0V-5V supply, I can highly recommend the LM358/LM324. Otherwise you'll need a negative supply.Hope that helps.Edit: Is it worthwhile grounding the offset null pins? Normally I just leave them floating if I'm not using them.

author: SeanB
author_rank: Super Contributor
timestamp: June 14, 2013, 04:03:35 pm
content: Never ground offset null pins, either connect as the datasheet says or leave as pads only, no traces.Some are meant to be connected to one rail or the other, either positive or negative rail, never ground. Internally they are either a set of low value resistors or a set of resistors and transistors and diodes between the pins and one of the supply rails. You are meant to use them to zero out offsets on the input with both input pins shorted together, and only to remove the offset from the IC itself.Using them to remove system offsets will degrade performance. If you have an input offset use a set of precision rails ( or the supply rails if they are stable enough) and a variable potentiometer across them with a high value resistor to provide the needed offset current. It seems convenient if you only have a few mV of input offset to remove, but driving the opamp to do this with those pins will make it long term unstable, as the offset is now deliberately driven to an imbalance in the input circuits.

author: Mandelbrot
author_rank: Regular Contributor
timestamp: June 14, 2013, 05:09:32 pm
content: Thanks for the feedback!I've barely used op-amps before and in school so far we only covered basic ideal op-amps.Time to go rethink my design, thanks for the valuable information!

author: c4757p
author_rank: Super Contributor
timestamp: June 14, 2013, 05:16:24 pm
content: Sounds just like my school. Op amps are just about the least ideal component you'll ever use - if you're going to play around with them in a simulator try to find a model of the one you're using. But even better, you should consider a simulator a tool for those who already understand how both the simulator and the real circuit work. If you know what you're doing, you can get very accurate results, and if you don't, you can get very silly results. They're very useful, but you should stick to the breadboard for now, until you've been screwed by every trap for young players and screwed them right back.

author: free_electron
author_rank: Super Contributor
timestamp: June 14, 2013, 05:20:33 pm
content: and with those kind of values in the megaohms the input bias current starts playing a biiiig role...

author: c4757p
author_rank: Super Contributor
timestamp: June 14, 2013, 05:23:50 pm
content: That's an important thing to remember about diff amps, actually. Damned if you do, damned if you don't - if the resistors are large, you get screwed by the bias current, and if they are small, you get screwed by the low impedance of your amplifier input. If you can't find a happy medium, you might consider looking into aninstrumentation amplifier- it buffers the inputs so you can have both high input impedance and small resistors.