Maker Pro
Maker Pro

741 as differential amplifier

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
This one is worth a look: Analog Devices AD8217: http://www.digikey.com/product-detail/en/AD8217BRMZ/AD8217BRMZ-ND/2404124 USD 2.89
Input offset voltage 0.25 mV at room temperature; this is 1.25% of a full scale of 20 mV.

The ZXCT devices have pretty poor accuracy specifications. The best of them is probably the ZXCT1021: http://www.digikey.com/product-detail/en/ZXCT1021E5TA/ZXCT1021E5TACT-ND/463848 USD 1.37.

Both the input offset voltage and the gain are sources of error. You should have a think about your accuracy requirements. What current range will you be measuring, typically? Do you need accuracy around zero? In other words, do you need low currents (e.g. less than 1A) to be measured accurately?
 

shumifan50

Jan 16, 2014
579
Joined
Jan 16, 2014
Messages
579
@kris:
I would not need great accuracy, just a good indication of the current being drawn, so I would guess a 5-10% error would not be the end of the world.

I found this article which is quite a nice discussion about exactly this topic:
http://www.planetanalog.com/document.asp?doc_id=527795

It seems to be by Maxim.

I had a look at the AD8217 - that requires seriously accurate etching with .25mm legs and .66 spacing as the only package. The upside is its accuracy, especially at low Vsense. The downside is that it still requires external amplification as the output gain is a fixed 20. The second one has an even lower gain of 10.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
±5~10% of what? The full scale current?

Let's assume ±10%. If the current flow was 40A, a measurement between 36A and 44A would be acceptable, right? OK, that tells you about the gain tolerance of the circuit, but not the offset tolerance.

If the current flow is, say, 0.4A, would you need the measurement to be between 0.36A and 0.44A? That's an error of ±10% of the value, not ±10% of full scale. 10% of 0.4A is 0.04A which corresponds to only 40 µV across the shunt (assuming a 0.001 ohm shunt). So you would need a monitoring circuit with an input offset voltage better than ±40 µV.

If you only need an accuracy of ±10% of full scale, then your shunt monitoring circuit only needs an input offset voltage better than 4 mV, assuming no gain error, or somewhat better than 4 mV so that the total error (offset error + gain error) will not exceed ±10% of full scale. But when the current flow has completely stopped, you could measure anything between -4A and +4A of current flow!

Re the AD8217. If you're only making one of these, you can just buy an SMT to THT adapter board.

We're now up to post #23 in this thread. I think it's about time that you gave us the background on your project so we know which way to approach it. Describe the circuit that you're monitoring, and the purpose of the monitoring. Include plenty of background information. Don't hold anything back because you think it's not relevant or might be boring. You may not know what could be relevant.

Adam, I'm working on an answer to your question.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
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?
Yes, for a gain stage, input offset voltage causes an offset at the output which is equal to the input offset voltage multiplied by the stage gain.

Here's an op-amp differential voltage amplifier:

diffamp.png

It accepts two voltages on its two inputs, nodes A and C, and generates an output voltage on node E, relative to the 0V rail, that is equal to the differential input voltage (i.e. VA-VC) multiplied by the stage gain, which is R3/R1 (and R4/R2), which is 100.

The simplified description of this circuit neglects four sources of error that are present in the real world:
  • It assumes that the resistors are perfect and have zero resistance error;
  • It assumes that the op-amp is ideal and therefore has zero input offset voltage;
  • It assumes that the op-amp is ideal and therefore has infinite open-loop gain;
  • It assumes that the op-amp is ideal and therefore has infinite input impedance.
First I'll run through an example scenario using all of those assumptions, then I'll repeat it with the second assumption removed - I'll use an input offset voltage of 5 mV.

My input conditions, for both tests, will be a differential input voltage of 0.02V (20 mV) on top of a common-mode voltage of 10.01V:

VA = 10.02V
VC = 10.00V
VAC (VA - VC) = 20 mV
VOUT should be 20 mV × 100 = 2.0V.

Assuming zero input voltage offset

Because there is negative feedback (via R3), the op-amp's behaviour is to adjust its output voltage until its differential input voltage (VBD) is exactly zero. This means that after settling delays, VD will be equal to VB.

VB is determined only by VA and R2 and R4. We can calculate it using the voltage divider formula, which gives:
VB = VA / ((R2 / R4) + 1)
= 10.02 / ((1 / 100) + 1)
= 10.02 / 1.01
= 9.920792V.

The next step is to calculate IR1, which is determined by the voltage across R1, i.e. VCD.

Since the op-amp has zero input voltage offset, VD = VB, so VCD = 10.00 - 9.920792 = 79.208 mV. Use Ohm's Law to calculate IR1:
IR1 = VCD / R1 = 79.208 mV / 1000 ohms = 79.208 µA.

Since R1 and R3 are in series (no current flows into the op-amp input), the same current flows through R3, producing a voltage across R3 of V = I R = 79.208 µA * 100,000 ohms = 7.9208V. Subtract that from VD to get VE: 9.920792V - 7.9208V = 2.0V (ignoring rounding errors).

So VOUT is 2.0V. That's how it's supposed to work.

Assuming 5 mV input voltage offset

Most of the calculations are the same as before, including VB = 9.920792V.

The op-amp will adjust its output voltage to bring the inverting ("-") input voltage equal to the non-inverting ("+") input voltage, but because of the 5 mV input offset, it thinks the inputs are equal when there's actually 5 mV difference between them.

That means that VD is actually either VB + 5 mV, or VB - 5 mV, depending on the direction of the offset. I'll assume the first one, so:
VD = VB + 5 mV
= 9.920792 + 0.005
= 9.925792V.

Now calculate VCD: VCD = 10.0 - 9.925792 = 74.208 mV. This is 5 mV lower than before, because VD is 5 mV higher than it should be.

Now calculate IR1, from VCD and R1's resistance:

IR1 = VCD / R1
= 74.208 mV / 1000 ohms
= 74.208 µA.

Now calculate the voltage across R3 (i.e. the difference between VD and VE) with 74.208 µA flowing through R3:
VDE = IR3 × R3
= 74.208 µA × 100,000 ohms
= 7.4208V

Finally, calculate VE by subtracting that voltage from VD:
VE = VD - VDE
= 9.925792 - 7.4208
= 2.505V. (Should be 2.0V)

So the 5 mV input offset voltage has been multiplied by the stage gain (100) and is causing a 500 mV offset at the output.
 
Last edited:

shumifan50

Jan 16, 2014
579
Joined
Jan 16, 2014
Messages
579
The project.
The project started out to protect LiPo batteries against over-discharge and destroying them. The first iteration used a PIC 12f675 but was later upgraded to use a 12f1840 to get the extra memory. This added a UART and the possibility of driving a serial LCD display so I could display each cell's voltage, the battery voltage and the minimum voltage set at which the circuit will switch off(the accuracy here is again not critical). The current monitor is a further extension to the project to give some idea of the current being drawn. It seemed like a good idea at the time as I was already fiddling with the high current by switching it, but if it gets too complicated then it is not worth the effort really. The target of the project is for bench testing changes to a quadcopter configuration with FPV (first person view), but it could be useful on future projects that use LiPo batteries, even if it is just used as a template. The latest iteration uses a 16F886 to get some more pins and drive a HD44780 LCD display directly - this leaves some free pins for the current(A) monitor. The output of the current sensing circuit will be fed into one of the ADC in the PIC - unfortunately the 16f886 does not have an internal reference voltage, just Vdd or an externally supplied reference voltage. I will most likely use Vdd which will further degrade accuracy, as I don't know the best way to build a reference voltage circuit and already feel guilty about all the help provided. I might try just using a zener/resistor, but that is another problem for later if I decide to go that way. I might use the LT1027.
Here is the link to the original thread:
https://www.electronicspoint.com/th...th-inconsistent-readings.268864/#post-1610614

The accuracy.
the 10% would apply at full 40A as when I get to measuring the lower currents(up to 10A) I can use my multimeter for an accurate reading. It would be nice to be more accurate, but it is not critical and board size is more important than dead accuracy and if push comes to shove, then I could leave the current measurement off. Even so it is nice to learn about new things and the help on this thread is much appreciated and I have learnt a lot.

The bits that use LiPos.
During testing the following bits needs power:
1. The chopper (lots of amps and only bit where the current monitor would be great).
2. The FPV receiver and monitor (multimeter measureable current).
3. The telemetry receiver/display(multimeter measureable current).
 
Last edited:

shumifan50

Jan 16, 2014
579
Joined
Jan 16, 2014
Messages
579
@kris:
The Honeywell parts do not look attractive because of size.
The ACS770LCB-50U-PFF-T looks perfect except I cannot source it from any of my normal suppliers in the UK. I found them on fleabay at £4.50, from Hongkong, but UK suppliers are over £10. It seems Allegro components are not readily available in the UK. I have never dealt with Digikey.

However, if I had just gone for sticking a single IC in as the solution, I would not have learnt anything and I do appreciate the teaching on here.

As a side comment: I will leave the current measuring for the moment as I need to complete my quad project before I move back to South Africa, in about 3 months, where parts are not that readily available and I don't know what importing will be like. I believe RS Components are down there, but I will learn once there. At least I have a friend that is heavily into electronics down there and he should be able to help some, so I will have to bother you less. In the meantime I am stocking up on stock components.
 
Top