Op amp differential amplifier - Page 1
Forum section: electronics / beginners

author: AxleD
author_rank: Regular Contributor
timestamp: May 10, 2015, 09:49:12 am
content: Hi,I am not sure if I'm overlooking something. I have two signals : 0.5V and 1V and i am trying to get the difference. I am using a standard op amp differential amplifier (see attached) and the output i get is 0.09 while I would have expected closer to 0.5V.I am using an LM258/LM358, My supply is 4.7V and pin 4 is connected to ground (0v). All resistors are 10k.Any guidance on what the issue could be would appreciated.Thanks

author: PSR B1257
author_rank: Frequent Contributor
timestamp: May 10, 2015, 10:54:02 am
content: Quote0.09 what?I guess you mean 90mV, and this is the saturation voltage of the output stage of the opamp.If you swap the input voltages, you get the result your looking for.For R1=R2=R3=R4 the equation for the output voltage is Vout=Vin2-Vin1Since the opamp can not swing to -500mV without a negative supply voltage it saturates.

author: AxleD
author_rank: Regular Contributor
timestamp: May 10, 2015, 02:31:00 pm
content: Thank you!That has resolved that issue although there seems to be a very large error with the output. Nonetheless, one battle at a time.I have another issue and hopefully you can assist here as well. I tried to get the voltage drop across a sense resistor using the LM258 and unfortunately i am having a similar issue. I am using the circuit attached.The actual drop across the sense resistor is 0.4V but i always get 3-3.3V at the output of the LM358. This is with a supply of 4.5V, Pin 4 grounded, Resistors = 200K each, Rsense=1ohm. This time around i have tried switching the inputs as well but no luck. Any ideas on what the issue could be.Thank you very much for the assistance.

author: PSR B1257
author_rank: Frequent Contributor
timestamp: May 10, 2015, 04:10:43 pm
content: QuoteDefinevery large. What type of resistors did you use? Have you measured thier actual resistance?QuoteThat most liekley is the positive saturation of the opamp.QuoteNo need to swap anything here, the schematic (at least) is correct.

author: flynwill
author_rank: Regular Contributor
timestamp: May 10, 2015, 04:13:29 pm
content: Well 3-3.3 V would be the expected high saturation with a 4.5 V supply.That schematic look right to me. I'd start looking to make sure you really have it properly connected (haven't reversed pins 2 & 3 for example).

author: AxleD
author_rank: Regular Contributor
timestamp: May 10, 2015, 06:56:34 pm
content: Thanks.I am pretty confused now after having rebuilt this circuit several times.In my original circuit i had the Rsense on the "high" side (instead of the low side as in the previous attachment) and that was the reason it wasn't working. After putting Rsense on the low side the output is as expected.I am however not sure why the position of the sense resistor would have made such a huge difference.I have attached another circuit which is exactly the circuit i had (except i used 200k resistors all round) .I rebuilt the circuit again using 10k resistors and the output voltage is now 5.5v (with a supply of 4.8v)

author: Zero999
author_rank: Super Contributor
timestamp: May 10, 2015, 07:28:58 pm
content: With the LM258, a high side resistor won't work because the inputs will be outside their common mode range specification.It's not possible to get 5.5V out from an op-amp with a 4.8V supply, unless it has something like a charge pump voltage booster built-in. Check your measurements.

author: AxleD
author_rank: Regular Contributor
timestamp: May 10, 2015, 08:53:08 pm
content: Ah of course.But according to the datasheet the input common mode voltage range is: Min 0 and max V+ -2I thought provided i keep within this range the op-amp should work.Of course it doesn't work - even at a 1 volt input the output of the differential op amp remains at 3-3.3 V

author: PSR B1257
author_rank: Frequent Contributor
timestamp: May 11, 2015, 04:18:32 am
content: QuoteCorrect.QuoteIt will.QuoteStrange. Can you take a picture of your actual build circuit?

author: AxleD
author_rank: Regular Contributor
timestamp: May 11, 2015, 10:28:56 am
content: Hi,It just dawned on me that I have been measuring the output of the op-amp while it's floating.Not sure if I'm correct, but could the problem be because the op amp has to sink current? It certainly explains the behavior i'm seeing. According to the datasheet if the op amp sinks anything above 10-15 ma you will get close to the saturation voltage (V+ - 2) irrespective of the inputs being in the common mode voltage range (Figure 11 on the TI datasheet).Thanks

author: PSR B1257
author_rank: Frequent Contributor
timestamp: May 11, 2015, 03:25:27 pm
content: QuoteYou don't. There is a negative feedbackQuoteNo.QuoteWould be a fairly high sink/source current anyway. The opamp can handle it, but you should not push it so far.I've just put the circut together on a bread board, and sure enough, it work's like a treat.

author: AxleD
author_rank: Regular Contributor
timestamp: May 11, 2015, 05:54:09 pm
content: Absolutely no way its working for youI have rebuilt that circuit ("high side" sense amplifier) several times now and it has never worked as expected. In fact i redid the circuit again, this time with different voltages (9v supply, 4 volt inputs, 10k resistors) to make sure I'm within the common mode operation of the op amp and it still didn't work (output couldn't swing below 0.6V).Having changed everything twice over, I decided to redo the circuit again but use higher value resistors (200k vs 10k previously)To my absolute surprise, after having changed the resistors only, the circuit is now working flawlessly nowPSR B1257, did you use 10k resistors as well?Thank you all for the assistance!

author: PSR B1257
author_rank: Frequent Contributor
timestamp: May 11, 2015, 06:19:29 pm
content: QuoteI thought we were at the low side current sence amplifier...anyway.Even if it is not possible, to measure to the positive supply rail with an LM358, you can configure it as a high side amplifier, since the resistors divide the voltage at the inputs down to fit within the common mode voltage range.QuoteYes.

author: JacquesBBB
author_rank: Frequent Contributor
timestamp: May 11, 2015, 08:23:22 pm
content: Quote from: PSR B1257 on May 10, 2015, 10:54:02 amActually, this is a sufficient condition, but Vout=Vin2-Vin1can be achieved with the more general conditionR1*R4 = R2*R3