Maker Pro
Maker Pro

741 as differential amplifier

shumifan50

Jan 16, 2014
579
Joined
Jan 16, 2014
Messages
579
I want to measure high current using a PIC, so it seemed like a good idea to use a very low value resistor and measure the voltage drop across it to calculate the current. However, the voltage drop at lower currents (even at higher currents) is so little that it needs to be amplified - for the resistor value I used = 0.0005 ohm. So enters the good old 741 opamp as a differential amplifier. I found several tutorials on the web and came up with the attached design - however, it does not work as expected at all, so I obviously am being stupid, but as with all true ignorance, I can't see what is wrong.

The objective:
At 40A I would like to generate roughly 4V at pin 6 of the 741 as this would be the 100% of the internal reference voltage of my PIC.

The calculations:
I = 40A
R = R0005
V = IR = 40 * 0.0005 = 0.02V for 40A current

I would like it to be about 4V
so gain needed = 4 / 0.02 = 200

According to the tutorials the gain calculation can be reduced to R3 / R1 (in the attachment)
= 220K / 1K = 220
This means 40A should give 4.4V on pin 6 of the 741 (I thought).

The reality:
In the picture the LED Strip has several LEDs and draws 190mA.
So: V = RA = .19 * 0.0005 = 0.000095V, so I expect on pin 6 of the 741 = 0.000095 * 220 = 0.0209 V ~ 21mV
When I use my multimeter and check the voltage on pin 6 of the 742 it is waaaaaayyy higher; it varies but it is between 6 to 11V.
I tried reducing the 1K resistors to 100R and the 220K to 22K, but the results remained similar, so something is wrong with the circuit. I checked the wiring several times and cannot see a fault. I checked for bad connections on the breadboard but found none. I moved it to a different location on the breadboard - no change.

I now appeal for help please.


differential.gif
 

Attachments

  • differential.gif
    differential.gif
    20.9 KB · Views: 628

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Do you think the LED might be round the wrong way. Also when corrected should the LED have a current limit resistor? Also the non inverting terminal can't go more positive than the inverting terminal, so your output will be at approx. 1V all the time.
Adam
 
Last edited:

shumifan50

Jan 16, 2014
579
Joined
Jan 16, 2014
Messages
579
Thanks for the reply.
Sorry about that I just dumped the LED on the diagram to show where the load is(I never remember which side is positive for the symbol) - it is connected the correct way around in the actual circuit (it is a strip with builtin resistors driven straight from 12v).
I have tried switching the inputs around,but no difference. If you have a dual rail supply the voltage will just be positive or negative depending which way around, but I only have a single 12V supply. In any event the voltages I am getting is much higher than 1V.

Does the design seem correct? I have never used 741 before in my own circuits, so this is a first.
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
What is the voltage you are getting. What do you think you should be getting for you to say it's not working?
 

shumifan50

Jan 16, 2014
579
Joined
Jan 16, 2014
Messages
579
In the picture the LED Strip has several LEDs and draws 190mA.
So: V = RA = .19 * 0.0005 = 0.000095V, so I expect on pin 6 of the 741 = 0.000095 * 220 = 0.0209 V ~ 21mV
When I use my multimeter and check the voltage on pin 6 of the 741 it is waaaaaayyy higher; it varies but it is between 6 to 11V
]

Unfortunately my multimeter is not sensitive enough to measure below 1mV, so I cannot measure the voltage drop across the R0005 resistor.
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
What version of 741 do you have? Most op-amps won't go that low with a single supply.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Yes, you've drawn the LED backwards.

You can't power the 741 from the same supply voltage that you're feeding into the inputs. Have a look at the 741 data sheet; you'll see that the inputs can't be higher than a few volts less than the positive supply pin. With the inputs so close to the positive supply, the 741 will not behave as an amplifier. You can (a) generate a higher voltage for the 741's supply, e.g. using a charge pump or switching supply, or (b) use an op-amp with "rail-to-rail" inputs that doesn't have this restriction.

While you're looking at the data sheet, have a look at the input offset voltage. It's around ±5 mV which corresponds to 10A of measured current! You can null the offset with a trimpot but a better approach would be to use an op-amp with a very low input offset such as an OP177 (http://www.digikey.com/product-detail/en/OP177GPZ/OP177GPZ-ND/671211). Suitable op-amps are made by Analog Devices, Linear Technology, and maybe Maxim.

Why can't you measure the LED current with a shunt resistor at the bottom end?
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Swap the input round and increase the value of the sense resistor to 100mR.
741.PNG
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Yes, you've drawn the LED backwards.

You can't power the 741 from the same supply voltage that you're feeding into the inputs. Have a look at the 741 data sheet; you'll see that the inputs can't be higher than a few volts less than the positive supply pin. With the inputs so close to the positive supply, the 741 will not behave as an amplifier. You can (a) generate a higher voltage for the 741's supply, e.g. using a charge pump or switching supply, or (b) use an op-amp with "rail-to-rail" inputs that doesn't have this restriction.

While you're looking at the data sheet, have a look at the input offset voltage. It's around ±5 mV which corresponds to 10A of measured current! You can null the offset with a trimpot but a better approach would be to use an op-amp with a very low input offset such as an OP177 (http://www.digikey.com/product-detail/en/OP177GPZ/OP177GPZ-ND/671211). Suitable op-amps are made by Analog Devices, Linear Technology, and maybe Maxim.

Why can't you measure the LED current with a shunt resistor at the bottom end?

Hi Kris I think the newer ones are rail to rail now, which is why I asked what version. Never used a 741 so I might be wrong.
Adam
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
No, few op-amps have rail-to-rail inputs. It's advertised prominently for op-amps that have it.

Another problem with that design is resistor tolerances. If you do some calculations on the effect of resistor value variations you will see that even variations less than 1% will cause significant offset errors. This problem and the problem caused by input offset voltage are the reasons why this method is not used in practice for measuring tiny voltages in the presence of large common-mode voltage.

High-side current measurement can be done with devices like the ZXCT1009 (http://www.digikey.com/product-detail/en/ZXCT1009T8TA/ZXCT1009T8CT-ND/512662) but an op-amp-based standard differential amplifier is not workable.
 

shumifan50

Jan 16, 2014
579
Joined
Jan 16, 2014
Messages
579
@kris: Thanks for that - I would NEVER have found that. This is a whole new can of worms. I will get some better opamps as you suggested as it seems a better solution than fiddling with the power supply.

The bigger problem with the 741 is the input offset voltage; I have no idea what it means exactly, but do understand that 5mV is too much for my application.
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Yes sorry Kris your right I must have read about the 741 replacement.
Adam
 

shumifan50

Jan 16, 2014
579
Joined
Jan 16, 2014
Messages
579
@kris:
That is what makes this forum so valuable. I will look at the ZXCT1009 as it seems a much nicer solution. I did search with google, but did not find that as a solution.
Thanks again.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
No problems. Yes, search for "high side current measurement". That's what you want to do.

I also think you may need to increase your shunt resistance, as suggested by Adam in post #8.
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
@kris: Thanks for that - I would NEVER have found that. This is a whole new can of worms. I will get some better opamps as you suggested as it seems a better solution than fiddling with the power supply.

The bigger problem with the 741 is the input offset voltage; I have no idea what it means exactly, but do understand that 5mV is too much for my application.

Input offset is the voltage difference needed between the two inputs to cause a change on the output.
Adam
 

shumifan50

Jan 16, 2014
579
Joined
Jan 16, 2014
Messages
579
@kris:
If I increase the shunt resistance the wattage gets out of hand very quickly
40*40*.001 is already 1.6watt for R001 and there is the possibility that I might have to upgrade to handle 80A(6.4w).
At 0.1 ohm the wattage will be 40*40*.1 = 160w - enough to start a fire.
I will see how it goes with the ZXCT1009.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Input offset voltage is an error due to imperfections in the op-amp.

To understand input offset voltage, you need to understand what an op-amp does, and how the differential amplifier circuit works. I don't have time to explain it here and now!

In simple terms, the input offset voltage causes an error at the output that's equal to the input offset voltage multiplied by the stage gain. The 741's input offset voltage is specified as 5 mV maximum IIRC, either positive or negative. Multiply that by your stage gain of 200 and you will get an offset voltage at the output of some voltage between -1V and +1V which is ±25% of full scale and corresponds to ±10A measurement!

Another way of looking at this is that the specified input offset voltage of 5 mV is 25% of your full scale shunt voltage of 20 mV.

The ZXCT1009 is just one example of a high-side current measuring device. It's quite old now. Check the specifications for input offset voltage and gain accuracy. You can calculate the error due to input voltage offset by calculating the input offset voltage as a percentage of your maximum shunt voltage.

Point taken about power dissipation. I assume your shunt resistors are Kelvin connected?

I will have a look at other options. If I find something better than the ZXCT1009 I'll post again.
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
To be honest I have never used that configuration as a sense amplifier before. I can see now why it won't work very well. Another reason is the inputs are not referenced to 0V like a low side sense would be. This means the output needs to be referenced to 0V to be say put into an A/D. This is the type of circuit I use and it works reasonably well.

HS.JPG
Adam
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Input offset voltage is an error due to imperfections in the op-amp.

To understand input offset voltage, you need to understand what an op-amp does, and how the differential amplifier circuit works. I don't have time to explain it here and now!

In simple terms, the input offset voltage causes an error at the output that's equal to the input offset voltage multiplied by the stage gain. The 741's input offset voltage is specified as 5 mV maximum IIRC, either positive or negative. Multiply that by your stage gain of 200 and you will get an offset voltage at the output of some voltage between -1V and +1V which is ±25% of full scale and corresponds to ±10A measurement!

Another way of looking at this is that the specified input offset voltage of 5 mV is 25% of your full scale shunt voltage of 20 mV.

The ZXCT1009 is just one example of a high-side current measuring device. It's quite old now. Check the specifications for input offset voltage and gain accuracy. You can calculate the error due to input voltage offset by calculating the input offset voltage as a percentage of your maximum shunt voltage.

Point taken about power dissipation. I assume your shunt resistors are Kelvin connected?

I will have a look at other options. If I find something better than the ZXCT1009 I'll post again.

Hi Kris
I thought this was only in effect when the inputs were grounded and you need 5mV between them for the output to be zero. So what you are saying is this offset is always multiplied by the gain?
cheers
Adam
 
Top