Coloumb counting

Anyone implemented a coloumb counting algorithm on a uP before for estimating LiPo battery SOC? I'm powering an 8 bit AVR and a few external widgets off a small 3.7 volt single-cell LiPo battery, about the size of a stick of gum, and would like to give it a rough estimate of the battery's SOC without using more hardware. I have at least one 10 bit ADC channel available for sensing.

For this application it doesn't have to super-accurate; could get away with putting the SOC into say 5 "bins" with nouns like "Great, OK, fair, weak, bad."

Reply to
bitrex
Loading thread data ...

Perhaps it is sufficient to merely measure the battery voltage. With LiPo the SOC is rather in relation with the cell voltage.

--
Dipl.-Inform(FH) Peter Heitzer, peter.heitzer@rz.uni-regensburg.de
Reply to
Peter Heitzer

That'd be nice...is that characterization something that's fairly repeatable between batteries of the same model/type?

I'm running the uP right off the battery and later AVRs can route their own Vdd to an ADC channel without using a pin.

Reply to
bitrex

formatting link

Gives some hints. At least the levels "Great" and "weak" should be detected with ease. More accurate would be to measure the current flowing out of the cell via a small shunt. With 10 bit resulation of the ADC a voltage drop of about 100 mV should be enough. A simple timer ISR accumultating the values every second already gives a nice coulomb counter.

--
Dipl.-Inform(FH) Peter Heitzer, peter.heitzer@rz.uni-regensburg.de
Reply to
Peter Heitzer

How are you going to know the SOC when you turn it on?

George H.

Reply to
George Herold

Characteristic of the chemistry, yes.

Beware that it's a logarithmic relationship, and mind ESR, and ionic diffusion (manifests as a time dependent resistance/inductance).

I suspect a lot of battery monitors use a linear measure, hence why everything seems to be going fine, five bars, four barsOHSHIT ONE BAR YOU BETTER FIND A CHARGER NOW...

Easy enough to do that conversion in software, assuming you get enough bits to tell the difference between 4 and 5 bars, say.

This is characteristic of batteries in general, but the exp slope, steady state voltages, and dynamic response (ESR + diffusion) vary with chemistry (oh, and temperature, natch). Lithium ion cells at least are quite good on diffusion (not like NiMH or alkaline).

Tim

--
Seven Transistor Labs, LLC 
Electrical Engineering Consultation and Contract Design 
Website: https://www.seventransistorlabs.com/
Reply to
Tim Williams

In normal operation ideally the uP won't ever be completely powered down; when SOC hits some threshold it will shut down the peripherals (which draw the bulk of the current) and the uP will be active but in deep sleep most of the time and check the battery status every once in a while. Once the battery charges up above some threshold it will come back up and measure SOC from that point.

There'll be insufficient charge to run the peripherals well before there's insufficient charge to keep a single 8 bit uP semi-active so I guess I only need to know SOC from that point.

In some situation where the battery is totally dead the charge controller will just start charging on its own and can send a PWRGOOD to the uP once its output is up and the uP can figure out what's going on at that point.

I don't think I'll need a load-switching arrangement; this charge controller can handle having battery voltage applied to its output while the input source is disconnected, the uP can operate fine down to 2.7 volts and the loads around the same, and the loads draw negligible current from the rail without being specifically enabled

Reply to
bitrex

Beware that the voltage also depends on the temperature inside the battery, which can go up if you draw a lot of current out of it. Sticking a thermis tor close to the battery, and monitoring it's resistance might be a complic ation too far - particularly when you start having to pay for an "interchan geable" thermistor (or for the single-point calibration of a cheaper part).

The relevant equation is the Nernst Equation

formatting link

Finding the numbers for an LiPo battery is beyond me - I assume that LiPo m eans lithium polymer, but the sort of people who write about the Nernst Equ ation are pickier about their description of the battery chemistry.

--
Bill Sloman, Sydney
Reply to
bill.sloman

A Google search brings up a lot of academic papers about using fuzzy logic/neural networks to estimate SOC from inaccurate/corrupted observables, unfortunately most seem to be behind paywalls. :-(

Reply to
bitrex

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.