Simple differential amplifier problem. - Page 1
Forum section: electronics / projects

author: steve30
author_rank: Frequent Contributor
timestamp: November 26, 2013, 04:33:03 am
content: I was wondering if someone could assist me with this simple differential amplifier circuit. I've successfully used it with an LM324 op amp before, but sometimes I run into a problem where the output voltageisn'tthe difference between the two input voltages.Like in todays case. See the attached image for the circuit diagram. The input voltages are both pretty much the same, so I would expect the output to be about 0V, but it isn't. If I add a 1k load to the output, it drops to 0.08V, which is closer, but not as close as I would like.It seems to work better with smaller input voltages rather than these big ones.I'd be grateful for any suggestions as to why this is happening.steve30

author: steve30
author_rank: Frequent Contributor
timestamp: November 26, 2013, 05:27:30 am
content: They were all between 99.38k and 99.46k. So a difference of maybe 80R. I guess that could be a bit too much.

author: rbola35618
author_rank: Frequent Contributor
timestamp: November 26, 2013, 05:29:24 am
content: You probably have issues with second order effects such as inputcurrent offset and input voltage offset

author: steve30
author_rank: Frequent Contributor
timestamp: November 26, 2013, 07:15:03 am
content: I just changed the resistors to 1M and it works better with these. There's now only up to about 14mV of error on the output.

author: fcb
author_rank: Super Contributor
timestamp: November 26, 2013, 09:51:52 am
content: The LM324 is not designed to go that close to the -ve rail (look at the schematic).You need to rejig your diff. amp to an artificial ground, or put in a small negative rail (say -5v).High-side current sense?

author: dannyf
author_rank: Super Contributor
timestamp: November 26, 2013, 12:14:30 pm
content: You should check out the datasheet, particularly about its voltage swing (to ground in this case).The opamp is doing exactly what it is designed to do.

author: c4757p
author_rank: Super Contributor
timestamp: November 26, 2013, 12:24:00 pm
content: Even with a "true" rail-to-rail op amp, you probably shouldn't be expecting accurate output all the way to 2mV. Add some gain.Better, use a current sense amp. Even if that's not what you're doing here, it's a similar enough application.

author: steve30
author_rank: Frequent Contributor
timestamp: November 30, 2013, 11:05:19 pm
content: Quote from: fcb on November 26, 2013, 09:51:52 amAre you sure? Looks like it should be fine to me. Anyway, I powered the op-amp from -5V instead of 0V, and I had the same problem.Just seems peculiar how the circuit agrees that 2-2=0 and 10-10=(approx) 0, but manages to get 25-25 wrong.I bought some current sense amplifier ICs, which do the job excellently, but it would still be cool to get the differential amp circuit working. I like being able to build things with parts which are more 'bog-standard'.

author: tehmeme
author_rank: Regular Contributor
timestamp: November 30, 2013, 11:08:03 pm
content: Quote from: steve30 on November 30, 2013, 11:05:19 pmjust curious , which current sense IC did you use?

author: IanB
author_rank: Super Contributor
timestamp: November 30, 2013, 11:29:23 pm
content: Quote from: steve30 on November 30, 2013, 11:05:19 pmIs this really peculiar?If you have 2 V on the inputs, then you have a current through the resistors of 2/200 k = 0.01 mA.If you have 25 V on the inputs, then you have a current 12x greater, 25/200 k = 0.125 mA.By Ohm's law, the voltage drop across the resistors is proportional to the current, so any small imbalance in resistor values is going to show up as a voltage differential error at the op amp input terminals that is magnified in proportion to the input voltages.You shouldexpectthe error to be worse with higher input voltages. It doesn't seem peculiar at all.

author: steve30
author_rank: Frequent Contributor
timestamp: November 30, 2013, 11:34:23 pm
content: Quote from: tehmeme on November 30, 2013, 11:08:03 pmI used a MAX4172. Has a good specification and is nice and easy to get working. Only awkward thing is that its a SOIC8 package and I'm using breadboards, so I had to build an adapter.IanB: Thanks, that makes a lot more sense now.

author: kg4arn
author_rank: Unknown
timestamp: December 01, 2013, 02:32:02 pm
content: @steve30What's happening in your original circuit is a limitation of the output stage of the 324 (and the LM358).If the output is sinking current, it cannot approach the negative rail as closely (see the attached Figure from the data sheet).You can see from the figure that 25V / 200K = 0.125 mA from the negative input to your diff amp needs to be absorbed by the output of the op amp, there is the 0.6V shelf in the curve. I believe that is the 0.6V you observed.This effect can be minimized or eliminated by biasing the output stage with a resistive load to the negative rail (usu about 4.7K). I have seen this discussed in the LM358 data sheets but not the LM324 data sheets that I have read. (I believe they share the same architecture). For amplifying small signals this is not a problem and it lets the op amp use very little power. For larger signal swings you will see what appears to be puzzling crossover distortion, if you do not have the output biased enough.

author: fcb
author_rank: Super Contributor
timestamp: December 01, 2013, 04:00:36 pm
content: Quote from: steve30 on November 30, 2013, 11:05:19 pmYes. Look at the schematic of the LM324:http://www.farnell.com/datasheets/1639829.pdfIt can't go to GND, only within Vbe of GND (see Q21 on the linked datasheet page 2).As far as the why it doesn't track at nearer VCC, again the schematic might give some clues (although you could always read the datasheet). If you add the Q6 Vce, Q2 Vbe and Q1 Vbe you'll get approx 1.5v.