# How can I tell how much juice a LiPo battery still has in it?

Suppose I have a circuit that draws its power from a LiPo Battery. I would like to know how much power the battery still has in it. Ideally a circuit of power level to voltage will be best .. this way I can connect the output of that circuit to a ADC input in my Arduino.

To be honest, if you manage to find a way to do this reliably, just measuring the voltage, and patent it, then you will never have to work again. The available energy left in a battery is loosely related to the terminal voltage but also depends on the battery temperature.

A common method of determining the battery charge state is to use a coulomb counter to count the charge going into and out of the cell. This gives a better estimate of the charge state of the battery, although the actual energy available is still temperature dependant. At low temperatures the battery capacity can be less than 50% of the nominal. An example device is the ST STC3100. This uses an I2C interface to communicate with the processor. The coulomb counting is performed by integrating the current in and out of the cell over the charge/discharge cycle. If you know when the battery is full then you can estimate the amount of charge that has been used.

• I think Ian nailed this one. If you're looking for an easier, but less accurate hack, you could use a current shunt. This is a very low, very precise resistor (say, 0.1 ohms) that you put in series with your battery. You could then use the Arduino to measure the battery voltage and the voltage difference across the shunt. Sample those at 10 Hz, and you can calculate the instantaneous power. Track that over time, and I bet you could get within 10% of the true value if your load and temperature are pretty constant. May 12, 2010 at 12:48
• This suggestion is effectively rolling your own version of a coulomb counter. The problem is that you will have to add analogue signal level shifting and amplification to the shunt resistor voltage so that the analogue signal is within the ADC input voltage range and covers a reasonable span of that range.
– uɐɪ
May 12, 2010 at 13:13
• @Ian: True facts. Probably need some noise filtering too. May 12, 2010 at 14:55
• @pingswept Kalman filter would be great there Jun 22, 2011 at 12:12
• @JGord, there are a lot of possible estimators out there (Kalman Filter, Extend Kalman Filter, prognosis techniques, sliding-mode observers, and on and on). It all depends on the circuit model you use to estimate the battery voltage behavior, finding the circuit parameter values, and tracking them over time. The problem is, the more accurate the model, the more noise resistant, and the more unmodeled characteristics you try to account for, then more CPU power and data is required. Jan 9, 2012 at 19:43

The big problem is that the output voltage stays fairly flat for most of the time. So, unless you have a really good A/D, you can't monitor it directly. That is why laptops and such tend to use clocks to measure the remaining power.

It's pretty easy to find the graphs if you search for "battery discharge curve"

http://shdesigns.org/batts/battcyc.html

What I am doing right now on a big battery consisting of a lot of Lipo cells is the following. I first charge it up (see datasheet of the cells for maximum voltage). Next I will drain the battery with a big resistor whilst using a current clamp connected to a scope as well as measuring the battery voltage. There is a power supply in parallel with the battery rated at the cutoff voltage for the battery so I can leave the setup to drain the battery right up till the point where it is not recommended to go further. With the scope(some Fluke, don't know the model) I can record the current over time, and thus determine the capacity. When the capacity is determined I am going to log the current and voltage constantly when it is in use, and thus I can more accurately find the charge left. But this setup will be monitored by a fancy industrial computer so I am not sure if that is the best way to go about at home.

I discover commercial solution are cheaper.

At your lab, if you can measure the load of the device, you don't need to put any charge meter inside it.

For example : a simple power load schema

state       load
--------------------
standy      0.1 A
full on     1 A


If the Arduino commands the two states - or can read them, a digital data - bingo.

Arduino times them and add to these two counters : time in standby, time full on.

Easy math to calculate how much juice your device had suck form the battery.

• This assumes your device's load is fixed and predictable. Nov 28, 2011 at 9:17
• It assumes the average load is almost fixed, say +- 5 %. Usually this is acceptable, because it is simpler and cheaper than a full adc charge metering. If there is need for a precise measure, put in more time and money. Nov 28, 2011 at 22:05