# 741 as differential amplifier

Discussion in 'General Electronics Discussion' started by shumifan50, Jul 2, 2014.

1. ### shumifan50

580
57
Jan 16, 2014
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.

#### Attached Files:

• ###### differential.gif
File size:
20.9 KB
Views:
628

5,164
1,087
Dec 18, 2013
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.

Last edited: Jul 2, 2014
3. ### shumifan50

580
57
Jan 16, 2014
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.

5,164
1,087
Dec 18, 2013
What is the voltage you are getting. What do you think you should be getting for you to say it's not working?

5. ### shumifan50

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

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

7. ### KrisBlueNZSadly passed away in 2015

8,393
1,271
Nov 28, 2011
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?

5,164
1,087
Dec 18, 2013
Swap the input round and increase the value of the sense resistor to 100mR.

5,164
1,087
Dec 18, 2013
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.

10. ### KrisBlueNZSadly passed away in 2015

8,393
1,271
Nov 28, 2011
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.

11. ### shumifan50

580
57
Jan 16, 2014
@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.

5,164
1,087
Dec 18, 2013

13. ### shumifan50

580
57
Jan 16, 2014
@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.

14. ### KrisBlueNZSadly passed away in 2015

8,393
1,271
Nov 28, 2011
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.

5,164
1,087
Dec 18, 2013
Input offset is the voltage difference needed between the two inputs to cause a change on the output.

16. ### shumifan50

580
57
Jan 16, 2014
Thanks Adam - that is then my problem.

17. ### shumifan50

580
57
Jan 16, 2014
@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.

18. ### KrisBlueNZSadly passed away in 2015

8,393
1,271
Nov 28, 2011
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.

5,164
1,087
Dec 18, 2013
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.