Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
chimerical26
Old
#1  
chimerical26's Avatar
Senior Member - OP
Thanks Meter 16
Posts: 125
Join Date: Jul 2010
Default The truth about lithium-ion batteries(Charging & Battery Stats)

Firstly.... go here and read this -

http://batteryuniversity.com/learn/a..._ion_batteries

The battery is fully charged when it is at 4.2 Volts and fully discharged at some predefined voltage (Lets say 3 volts).

The phone can measure these voltages directly from the battery. To see the voltage of your battery type *#*#4636#*#* into your phone and go to battery information.

If all that is so then what is the point or need of "recalibrating" and deleting battery stats and all that.

It seems logical to me that battery stats is just the place where your battery usage history is stored and nothing else.

Can someone confirm this or convince me otherwise?

(I rotate between 3 batteries and cannot grasp the idea that my phone can't consistently measure the charge level of the battery and operate accordingly.)
The Following User Says Thank You to chimerical26 For This Useful Post: [ Click to Expand ]
 
Ashath
Old
#2  
Junior Member
Thanks Meter 1
Posts: 6
Join Date: Jul 2010
Measuring the Voltage to get the charge level is not very accurate, and has to be done with no load on the battery (that is, when its not in your phone).
So the phone has to count "energy used from"/"energy stored in" the battery for an accurate display. (called "Coloumb counter")
The Following User Says Thank You to Ashath For This Useful Post: [ Click to Expand ]
 
xufos
Old
(Last edited by xufos; 10th November 2010 at 08:30 AM.) Reason: voltage (V), not current (A) !
#3  
xufos's Avatar
Junior Member
Thanks Meter 7
Posts: 18
Join Date: Jul 2010
Location: Bogor
Post Did some test

I did a test on new a battery a while ago. Measure voltage when the battery completely empty and fully charged.

Empty battery
1% remaining, using SystemPanel


Take the battery out and measure it with Multimeter




Fully charged
100% charged


Again, measure it with Multimeter


The voltage showed on the phone using SystemPanel app is quite accurate with 0.04V margin of error. Most smart electronic measure lithium battery capacity according to the remaining voltage. In this case, fully charged SGS is 4.2V, empty is 3.5V.

Me too, don't know why we have to delete batterystats.bin to recalibrate battery indicator But I do know that SGS keep track on power consumption on each of its component/application. Its a little bit silly if SGS reads batterystats.bin and display it as battery indicator.
The Following User Says Thank You to xufos For This Useful Post: [ Click to Expand ]
 
torres76
Old
#4  
torres76's Avatar
Senior Member
Thanks Meter 20
Posts: 437
Join Date: Apr 2010
Location: Reading
Yet again how is this android development.

Sent from my GT-I9000 using XDA App
 
hardcore
Old
#5  
Senior Member
Thanks Meter 8035
Posts: 3,434
Join Date: Sep 2006

 
DONATE TO ME
Quote:
Originally Posted by xufos View Post
I did a test on new a battery a while ago. Measure current when the battery completely empty and fully charged.

Empty battery
1% remaining, using SystemPanel


Take the battery out and measure it with Multimeter




Fully charged
100% charged


Again, measure it with Multimeter


The current showed on the phone using SystemPanel app is quite accurate with 0.04V error margin. Most smart electronic measure lithium battery capacity according to the remaining current. In this case, fully charged SGS is 4.2V, empty is 3.5V.

Me too, don't know why we have to delete batterystats.bin to recalibrate battery indicator But I do know that SGS keep track on power consumption on each of its component/application. Its a little bit silly if SGS reads batterystats.bin and display it as battery indicator.
Thanks for that, but you were actually measuring the Voltage, not current (Amperes).

In any case, for laptop Li-ion batteries there is normally a capacity counter (Coulomb counter) that reports the capacity in terms of mAh (milli-ampere hours). It can normally report the remaining capacity, maximum capacity, design capacity, and can be used to measure the *actual* power drain (in terms of Watts).

I wonder if Android has APIs that let apps access that kind of information?
The Following User Says Thank You to hardcore For This Useful Post: [ Click to Expand ]
 
captive
Old
(Last edited by captive; 10th November 2010 at 08:40 AM.)
#6  
Senior Member
Thanks Meter 8
Posts: 121
Join Date: Dec 2009
Not really sure about this, but:
Phone seems to measure both voltage & discharge speed, "predicting" remaining charge.
It happens that after a flash battery indicator jumps to a higher value (not compatible with the couple of minutes of dc connection it had), and fall to a way too low value after any battery intensive task (a few minutes of audio call are enough), once more not compatible with the real usage.
I should inspect android code to be shure of this, but I suspect batterystats.bin is used to keep track of battery usage and to this sort of prediction, while a firmware flash seems to mess somehow the measurement.

Edit: this is based on my direct experience, even if on just "empirical" tests. I'll take a look to code asap
 
harrydg
Old
#7  
Senior Member
Thanks Meter 8
Posts: 123
Join Date: Oct 2010
Location: Herent
'mkay, battery talk... always interesting to see what people make of this.
Let's help out all the misunderstandings here and start with the basics

First of all: read the basics on Li-ion batteries:
http://electronics.howstuffworks.com...on-battery.htm

second:
you DON'T measure your voltage when your battery is disconnected. Because it will rise to the normal values of the battery after a while. When you connect it, and use it, the voltage will lower. Compare it to a garden hose. if you let water run out, the presure drops and water starts flowing (presure is voltage, flowing is the current). If you measure the presure when there is no water running, the presure will always mount to the default value, even if there is "not much water left in the tank". But when it starts running again, it could very well run out very fast. So in comparison: voltage says something, but only when you "use" it.
Third:
When a battery ages, it's characteristics change, it will be full... and then all at once, empty. It's not linear. So calculating the capacity is always a bit "guessing". (compare it to stones in your water tank... they don't give you water, the tank doesn't change, but all of a sudden, you're out of water).

conclusion:
capacity of a battery is a very tricky thing to do, it's a combination of voltage, current, age... so the best way to determine capacity is by using the history of the battery as the "guide" to the future. Resetting the battery statistics will remove that history and your phone will have to "learn" it's behavior again. If you don't reset your stats, your values will become more reliable over time (depending of course on the time the stats are kept )

For those who speak dutch, i put a complete battery description/howto/misunderstandings post on www.modelbouwforum.nl (search for posts of "harrydg")

If there are more questions or so, just ask, i'll try to help out as much as possible...
The Following 2 Users Say Thank You to harrydg For This Useful Post: [ Click to Expand ]
 
mike.sw
Old
#8  
Senior Member
Thanks Meter 21
Posts: 400
Join Date: Jul 2010
wow harrydg that's great explanation, wish you were my physics teacher back in high school
someone add this post to the main FAQ!
 
bilboa1
Old
#9  
Recognized Developer
Thanks Meter 294
Posts: 1,135
Join Date: Aug 2010

 
DONATE TO ME
I just wanna write it in a simpler way:

You've access to the battery stats from the kernel. And of course its current consumption which is measured not voltage. Voltage doesn't tell all that much. During high draws your voltage (at the battery level) can fluctuate quite a bit.
There's a regulator (or probably a bunch of them) get a stable voltage no matter what the input voltage is (well, still it has to be in the 3.3/5v range probably else the regulator burns)

Anyway, that's also why the battery stats have to be calibrated, while you can measure how much current is used (in maH aka milli amp per hour, or in mA aka "instant" milli amps), you don't know the battery capacity.

Not only the battery capacity changes from battery to battery but it also changes during the life time of the battery.

The *only* way to calibrate the battery, is to delete the stats, have a fully charged phone and let it drain out the battery until it turns off. That way the kernel will measure for example 1457mah used until it ran out of juice, and that's your battery capacity then. Having the full capacity allows the kernel to give you a rather precise estimate of your current battery status (eg "80%" that you see on the top of the screen) (of course the actual calculation is a bit more complicate but that's the basics)

If calibration stats storage is changed for any reason (probably kernel upgrade or just a whacky samsung implementation that gets corrupted for some reason) you need to delete it and make a new one to recalibrate.
 
harrydg
Old
#10  
Senior Member
Thanks Meter 8
Posts: 123
Join Date: Oct 2010
Location: Herent
If you want to make it simpler, make it at least correct...
"Anyway, that's also why the battery stats have to be calibrated, while you can measure how much current is used (in maH aka milli amp per hour, or in mA aka "instant" milli amps), you don't know the battery capacity."

First of al, it's mAh, which means milli ampere hour, NOT per hour, that would be mA/h, which it is not.
mA is milli ampere, which is a current
there is a significant difference between the 2.
the first is "capacity"
the second is "current"
it's like a bottle. The capacity is 2l and you pour at 1l per minut...

so... make it simple please...

The Following 2 Users Say Thank You to harrydg For This Useful Post: [ Click to Expand ]
 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

report this ad
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...