# Using op amp to measure battery voltage

I have a question regarding the usage of op amp to measure battery voltage. I know there are battery gauge IC's dedicated for that, but I'm trying to do this to both understand the op amps better and the other one is that this solution should be cheaper since I don't need a super precise measurement.

So, I had this circuit and math in mind:

VIN - Battery (Li-Po 2S 6-8.4V range)

I'm using a voltage divider with R1 and R2 to get 1/10th of the input voltage and feeding that into op amp that is configured for gain of 3. So my calculation is:

VMEAS_BATT = (VIN / 10) * 3

which would give me an VMEAS_BATT range of 1,8V to 2,52V (when battery is full).

I would feed that voltage then into MCUs ADC input and read and do the math to get the battery voltage reading.

Can you please help me by checking if this is a "sane" circuit, is math correct and at the end what would be other practical considerations that I would need to consider to make this circuit work?

Thanks!

However...

a) is the opamp really needed?

If the MCU ADC input draws any significant current, then you need that opamp there to provide it with a low impedance drive. However, in my experience, most MCU ADCs have a high impedance, and could safely be driven from just the R1/R2 voltage divider with no problems.

b) Do R1 and R2 need to be that small, draining high current from the battery under test?

Most opamps have a high input impedance in that configuration, you could almost certainly go for 100x those values, probably 1000x, without excessive errors, and much lower current drain on the battery. This latter is important if you want to leave it for months off charge.

c) The title is a little misleading, as the opamp is not doing any measuring, just scaling/buffering the cell voltage into an ADC that will actually do the measuring.

d) for that gain and input range, make sure the chosen opamp is a low voltage rail to rail output type. Venerable old but popular types like LM324 for instance are next to useless at 3.3v supply.

• Thanks so much Neil for the answer! a) So you are saying that any modern MCUs (I plan to use STM32F4xxx) would not need the op amp, and could just take the output of voltage divider b)You would go with the Mega Ohm values, right? I didn't think of the current (power) being wasted on these resistors... Thanks for great advice! c) Sry for that :( d) will take this into account May 19, 2016 at 10:32
• you'd have to check the electrical specs for your specific part, but generally, yes, most MCU ADCs are high input impedance. However, with a switched capacitor input, most require a big capacitor across the input to source the instantaneous charging current if they are driven from a high impedance. In your battery monitor situation, the bandwidth limit that that imposes is not a problem. May 19, 2016 at 10:45
• Additional question that now arises is, could I use transistor which is controlled by MCU to periodically switch (e.g. once a min) the measuring circuit so that power is not wasted even when I don't need the measurement? May 19, 2016 at 10:57
• Can you suggest a circuit, I can't think of a simple one, especially if the battery voltage is well above that of the MCU. Once you are up to 100k or 1meg R1, the sense current is negligible compared to battery self discharge, so it's fairly irrelevant. May 19, 2016 at 11:35
• Then I'll definitely go with R1=910K and R2=100K. Thanks so much Neil for your help and advice! May 19, 2016 at 12:37