Arduino Battery Capacity Tester

Inducktion, Thu Jan 15 2015, 07:02AM

Hi guys.

So I've been foolin' around with my teensy 3.1 in the arduino IDE...

And came up with this program;

Link2

My only question is, did I create the proper equation for figuring out the capacity?

From my understanding

Capacity = time x load current, which is what the equation I'm using equates to. I'm not looking for 100% superb accuracy, just a rough estimate of it. If anyone could double check my work I'd be super appreciative.
Re: Arduino Battery Capacity Tester
Jrz126, Fri Jan 16 2015, 02:24AM

how are you measuring the current? Looks like you are just running an equation on the battery voltage?

You need to integrate the current to get mAh.

Re: Arduino Battery Capacity Tester
..., Fri Jan 16 2015, 05:04AM

Assuming the load resistor you are using is 4.7 ohms then your code is roughly correct, although will under estimate the capacity of the battery a fair bit.

The formula you give (capacity = time * current) is only accurate in the case where you discharge the battery with a constant current (as many other chargers do). It looks like you are using a resistor to discharge the battery, so the discharge current will inherently be changing as the battery voltage decreases (starting around 4.2v/4.7ohms = 0.9amps and stopping at 2.7v/4.7ohms = 0.5amps). You are currently using the current at the end of the battery discharge to calculate the capacity, so you will be underestimating the capacity by somewhere between a factor of 10-50% depending on the initial charge of the battery.

Ideally you would integrate the current, for example if you run the loop at 25hz (your code will run slightly slower than that) you could say capacity = capacity + (current * 0.000111hours). Of course you would want to initialize 'capacity' to zero before the main loop.
Re: Arduino Battery Capacity Tester
Inducktion, Wed Jan 21 2015, 02:35AM

I changed the code a little, but it's more or less the same. I instead went with a basic constant current source (using an op amp, transistor and a sense resistor).

It draws 530 mA (roughly) from the battery all the way down to 2.7 volts, so the mAh curve should be much more accurate now.
Re: Arduino Battery Capacity Tester
Conundrum, Sat Feb 28 2015, 04:41AM

Would this work for my pile of LiNiMn cells?
Culled from a dead e-bike (fried controller) pack, most of the cells look OK but unfortunately I'd never find ones with the same remaining capacity or impedance to rebuild it into a safe pack.
These are structurally similar to Li phosphate but a higher terminal voltage (3.6V) so a single schottky 120mV diode will allow them to be charged from a standard Li charger.