Author Topic: Op amp differential amplifier  (Read 6749 times)

0 Members and 1 Guest are viewing this topic.

Offline AxleDTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: za
Op amp differential amplifier
« on: May 10, 2015, 09:49:12 am »
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
 

Offline PSR B1257

  • Frequent Contributor
  • **
  • Posts: 330
  • Country: de
Re: Op amp differential amplifier
« Reply #1 on: May 10, 2015, 10:54:02 am »
Quote
and the output i get is 0.09
0.09 what?
I guess you mean 90mV  8), 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-Vin1

Since the opamp can not swing to -500mV without a negative supply voltage it saturates.
In theory, there is no difference between theory and practice. But, in practice, there is.
 

Offline AxleDTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: za
Re: Op amp differential amplifier
« Reply #2 on: May 10, 2015, 02:31:00 pm »
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.
« Last Edit: May 10, 2015, 02:34:52 pm by AxleD »
 

Offline PSR B1257

  • Frequent Contributor
  • **
  • Posts: 330
  • Country: de
Re: Op amp differential amplifier
« Reply #3 on: May 10, 2015, 04:10:43 pm »
Quote
there seems to be a very large error with the output.
Define very large. What type of resistors did you use? Have you measured thier actual resistance?

Quote
but i always get 3-3.3V at the output of the LM358.
That most liekley is the positive saturation of the opamp.

Quote
This time around i have tried switching the inputs as well but no luck.
No need to swap anything here, the schematic (at least) is correct.

In theory, there is no difference between theory and practice. But, in practice, there is.
 

Offline flynwill

  • Regular Contributor
  • *
  • Posts: 143
Re: Op amp differential amplifier
« Reply #4 on: May 10, 2015, 04:13:29 pm »
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).
 

Offline AxleDTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: za
Re: Op amp differential amplifier
« Reply #5 on: May 10, 2015, 06:56:34 pm »
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  ???)


« Last Edit: May 10, 2015, 06:58:08 pm by AxleD »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19491
  • Country: gb
  • 0999
Re: Op amp differential amplifier
« Reply #6 on: May 10, 2015, 07:28:58 pm »
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.
 

Offline AxleDTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: za
Re: Op amp differential amplifier
« Reply #7 on: May 10, 2015, 08:53:08 pm »
Ah of course.

But according to the datasheet the input common mode voltage range is: Min 0 and max V+ -2
I 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




 

Offline PSR B1257

  • Frequent Contributor
  • **
  • Posts: 330
  • Country: de
Re: Op amp differential amplifier
« Reply #8 on: May 11, 2015, 04:18:32 am »
Quote
But according to the datasheet the input common mode voltage range is: Min 0 and max V+ -2
Correct.

Quote
I thought provided i keep within this range the op-amp should work.
It will.

Quote
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
Strange. Can you take a picture of your actual build circuit?
In theory, there is no difference between theory and practice. But, in practice, there is.
 

Offline AxleDTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: za
Re: Op amp differential amplifier
« Reply #9 on: May 11, 2015, 10:28:56 am »
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
 

Offline PSR B1257

  • Frequent Contributor
  • **
  • Posts: 330
  • Country: de
Re: Op amp differential amplifier
« Reply #10 on: May 11, 2015, 03:25:27 pm »
Quote
It just dawned on me that I have been measuring the output of the op-amp while it's floating.
You don't. There is a negative feedback  ;)

Quote
but could the problem be because the op amp has to sink current?
No.

Quote
10-15 ma
Would 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.
« Last Edit: May 11, 2015, 03:37:34 pm by PSR B1257 »
In theory, there is no difference between theory and practice. But, in practice, there is.
 

Offline AxleDTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: za
Re: Op amp differential amplifier
« Reply #11 on: May 11, 2015, 05:54:09 pm »
Absolutely no way its working for you  :o

I 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 now |O

PSR B1257, did you use 10k resistors as well?

Thank you all for the assistance!
 

Offline PSR B1257

  • Frequent Contributor
  • **
  • Posts: 330
  • Country: de
Re: Op amp differential amplifier
« Reply #12 on: May 11, 2015, 06:19:29 pm »
Quote
I have rebuilt that circuit ("high side" sense amplifier
I 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.

Quote
did you use 10k resistors as well?
Yes.

In theory, there is no difference between theory and practice. But, in practice, there is.
 

Offline JacquesBBB

  • Frequent Contributor
  • **
  • Posts: 829
  • Country: fr
Re: Op amp differential amplifier
« Reply #13 on: May 11, 2015, 08:23:22 pm »
For R1=R2=R3=R4 the equation for the output voltage is Vout=Vin2-Vin1

Actually, this is a sufficient condition,  but  Vout=Vin2-Vin1  can be achieved with the more general condition

R1*R4 = R2*R3
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf