Pages: [1]   Go Down
Author Topic: Battery discharge curve mapping  (Read 1892 times)
0 Members and 1 Guest are viewing this topic.
London, UK
Offline Offline
Full Member
***
Karma: 4
Posts: 188
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I currently have a device that is reading the battery voltage over a voltage divider to drop it down to a usable value for the arduino.  However I would like to convert this into an accurate percentage value using the battery discharge curve such as one of these,


How would I go about mapping it to an equation to use for the arduino?
Thanks in advance.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 436
Posts: 23623
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"battery discharge curve such as one of these"

Something supposed to be attached?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

London, UK
Offline Offline
Full Member
***
Karma: 4
Posts: 188
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
Yes
http://www.gmbattery.com/upload/editorfiles/2008.9.6_13.39.34_5817.jpg
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i don t understad that graph Voltage of the batery vs capacity in mA? xD i think u whant voltage vs time or mA usague or something like that xD

i do a batery monitor,  u have to make a sketch measure you batery max charge voltage and the min safe voltage, the use analog read to measure it and use the map function to display it ass % or if u can take alot of reads of your analog read and paste it in exel they make for you a nice graph showing the discharge rate over time
Logged

New Hampshire
Offline Offline
God Member
*****
Karma: 13
Posts: 779
There are 10 kinds of people, those who know binary, and those who don't.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That graph is meant to show the useable capacity of a given battery at different discharge rates.  The basic gist being, the faster you discharge the battery, the less actual capacity you have.  It's not really useful for determining a percentage capacity left over (though there is a correlation).

An 'accurate' percentage is going to be difficult to computer and maintain, and likely not really worth the effort.  The simplest method is an approximate percentage based on battery voltage.  If you know the average current draw that the battery will be providing, then you can tailor your percentage to that current draw from the above discharge rate chart.  If it's a steady state current draw, just use the charts above as is.  If it's more of an intermittent current draw, then the capacity will be a bit better than the 'average' current would indicate (as the battery has time to rest in between demands for current, which gives the internal chemistry time to normalize and improves overall capacity)

Here's one thread on voltage to capacity conversions: http://www.helifreak.com/showthread.php?t=333661
There are others.  Again, a simple voltage measurement is only going to give you an approximation of capacity.
Logged


London, UK
Offline Offline
Full Member
***
Karma: 4
Posts: 188
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So I guess I have to stick with my oversimplified calculation range then of
battPercent = (((battVoltage - 1.69) / 0.39) * 100);
« Last Edit: September 19, 2012, 11:04:12 am by mrjonny2 » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 436
Posts: 23623
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The battery graph is not opening for me, times out.
Another option might be to pick off 10 points from an average curve, and put that data into an array for a lookup table also.
If your lookup point is in between points, then do a simple linear interpolation, not likey to be too far off.
Otherwise, you need to monitor current flow (measure voltage across a shunt resistor typically) and pick a curve to use based on the recent current history you would have collected.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Ontario
Offline Offline
God Member
*****
Karma: 20
Posts: 835
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The type of battery chemistry is not mentioned.  I once did a state-of-charge model for flooded lead-acid chemistry and you can look at the details here:
 http://1474orchard.ca/projects/?x=entry:entry120622-013912

The curve mrjonny2 posted does not look like lead-acid to me, but you could use the same method to bodge up a calculation.

I did mine more for interest than anything.  I don't think state-of-charge modelling is particularly accurate.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16470
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The type of battery chemistry is not mentioned.  I once did a state-of-charge model for flooded lead-acid chemistry and you can look at the details here:
 http://1474orchard.ca/projects/?x=entry:entry120622-013912

The curve mrjonny2 posted does not look like lead-acid to me, but you could use the same method to bodge up a calculation.

From the voltage range on the chart it appears to be a Li-po cell, to me anyway.

I did mine more for interest than anything.  I don't think state-of-charge modelling is particularly accurate.
Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 44
Posts: 2806
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

They'res a a whole bunch of Gas Gauge chips for Li-Po batteries... about 136000 results in .35 seconds (I have a slow internet connection) Here is one.
TEXAS INSTRUMENTS - BQ27210DRKRG4 - IC, BATTERY GAS GAUGE, LI-ION, VSON-10 From Newark and I am wondering why re-invent a wheel that is already invented.
Take the results from any of these IC's and set a lower limit for warning.

Doc
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

0
Offline Offline
Shannon Member
****
Karma: 159
Posts: 10409
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The part number on the graph is a LiPoly battery if you google it

There are problems trying to use voltage to measure state of charge (quite obvious from those curves in fact), that the voltage depends on more than just the state of charge - it depends on batt temperature, the current flowing (due to internal resistance), whether the battery is charging or discharging.  It will also change as the battery ages (and internal resistance itself changes with age).

Some chemistries have very flat curves (lead acid is fairly flat, NiCd is very flat), and this makes it very inaccurate to try and judge S.o.C. except at extremes.  NiMH and lithium chemistries do have reasonable slopes IIRC (and probably for the same reason, come to think of it).

If you can record actual charge flow history as well as voltage this ought to be much more robust at keeping track of S.o.C. and current capacity.
Logged

[ I won't respond to messages, use the forum please ]

Australia
Offline Offline
Sr. Member
****
Karma: 10
Posts: 393
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looking at the datasheets it is very difficult to accurately work out how much power you have left in a LiPo.

But this may do you:

https://www.sparkfun.com/products/10617

...and if not, read the datasheet for the chip used. Its interesting reading. Makes it sound quite complex (but then again, thats what they want you to think).
« Last Edit: September 19, 2012, 11:22:40 pm by lemming » Logged

London, UK
Offline Offline
Full Member
***
Karma: 4
Posts: 188
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
Unfortunately I cannot add any extra items for my PCBs as this is a custom design that I was hoping to add as an extra feature in software.
And it is a LiPo battery
Logged

Pages: [1]   Go Up
Jump to: