[Samsung Galaxy Nexus] waylo:
This is not a thread about best battery tips, etc. And I'm hoping it is not another standard thread about how to calibrate our batteries.

There is a lot of information flying around regarding battery calibration. A lot of it involves draining the battery, plugging it in at certain time, removing the battery, erasing batterystats.bin, etc. etc. etc.

Some feel the batterystats.bin file is key, and others believe it is completely unrelated to how the battery performs--just a log of stats.

How can this be reconciled?

UPDATE: Deleting batterystats.bin to "recalibrate" a battery is total and utter nonsense

http://xdaforums.com/showthread.php?t=1442989

https://plus.google.com/u/0/105051985738280261832/posts/FV3LVtdVxPT

Over on the Nexus One forum, there was/is an extensive discussion, with REAL data gleaned from reading the technical datasheets of the battery itself, and the DS2784 chip within. The key to the Nexus calibration program was the ability to reprogram values on the battery chip.

http://xdaforums.com/showthread.php?t=765609

I don't know if much of anything is going to be the same on the GNex battery, since the N1 was a HTC product. However, if the charging algorithms are all dictated by the Android OS, instead of hardware specific, then it could provide useful precedent. (I am not going to go through all the Samsung forums to look for valid battery calibration threads--if you know of some, for say, the Nexus S or Galaxy S2 (predecessor and comparable cousin, let's call them) please comment).

Here's a primer for all I learned that was used on the Nexus One battery calibration program. Full credit to those fine users who took the reins and made that happen, and to the fine users who continue to provide user support to the newcomers who don't know/refuse to acknowledge the existence of a search function.

My hopes are that this will lead to more rational battery life discussions and maximization for the Galaxy Nexus.

(I am not an engineer, so if any of you out there would like to tighten the language used here, please let me know).

What are the important values in battery/calibration?

1. mV = voltage

2. mAh = milliamp hours, a measure of capacity. This is how much 'juice' your battery has left/stored.

3. mA = milliamps, a measure of current. This is how much 'battery power' your phone is drawing/using at a set time. GPS/bright screen means large mA usage.

Apparently, Samsung (and Motorola phones) do NOT have mA readings in their battery drivers. This poses a problem. Apps that measure current (such as the excellent and free "current widget") cannot give a readout.

How is the battery life % calculated?

Present mAh / "full" capacity mAh (more on "full" later)

When does a phone shut down?

1. When mAh = 0

OR

2. When mV < 3416, which is coded on the battery as the "empty voltage"

Whichever occurs first.

If mAh = 0, then batt % = 0. However if condition 2 occurs, batt % could be anything.

I have found the empty voltage on the GNex to be the same, 3416 mV.

I have found the maximum voltage on the stock GSM battery to be 4197 mV.

Through experimentation, it was found that reprogramming the "empty voltage" down to 3201mv could provide extended battery life. The voltage was found to drop very quickly any lower than that, providing minimal gain afterwards.

What is the full capacity of a battery?

On the N1 battery, it is coded into a chip on the battery itself. This can be reprogrammed with the calibration utility. The stock value was ~1400mah. This is called the Full40 value (the mAh at 40oC). A value called "battery age %" is used to adjust how close the real capacity is to the full, which decreases with use and age. By multiplying (batt age * full40), you get the real assigned capacity.

Some non-OEM batteries, however, had miscoded capacities, usually LOWER than what was advertised. This led to very disappointed users who had purchased extended batteries that lasted no longer than stock, due to wrong mAh coding. (See below how this could be corrected).

Other low-end crappy non-OEM batteries had a crap chip which was coded with nonsensical values. This also led to unreliable battery life. These chips were not reprogrammable.

The very interesting thing is whenever the battery thinks it was completely charged, the mAh becomes SET to this number. mAh is NOT an independent value. Also, you could set it whatever you wanted, whenever you wanted, whether it was accurate or not. % battery left was basically calculated as present mAh / (full40 mAh*batt age). So you could get false values of either too little or too much battery left.

Why does this matter? If that was falsely low, the phone would cut out at 0% battery life, but you would still have usable battery left. If it was falsely high, it would cut out at 10% or whatever, since voltage would hit 3416 faster than mAh hit 0.

How does the battery know/think it is full?

When connected to a charger, the phone draws +mA. It can start around 1000mA (depending on the charger), and drops as the battery becomes more and more charged.

Another coded value, the "minimum charge current," tells the battery when to stop drawing current. This is set at default to +80mA.

Another coded value, the "minimum charge voltage," tells the battery that as long as the voltage is less than this #, it should continue to charge. At default, this is 4099mV.

An important concept is that once the charge amperage drops below minimum charge current (and the voltage is > the minimum charge voltage), the battery thinks it is done. Again, that state becomes 100%. Again, the capacity mAh is SET to the full capacity, no matter what is at that time. The actual mAh doesn't matter--it BECOMES whatever is coded as the (age % * full capacity).

As with other values in the battery chip, minimum charge current can be changed. It can be made to 40mA, or 20mA, or whatever you wish. By doing this, the battery will continue to draw current, and thus charge more and longer, until the minimum charge current is met.

Speaking of charging amperage, this can be an issue when using a non-OEM crap car charger when using your smartphone as a GPS. If the DC adapter is NOT truly giving 1A, the phone will use more current than it is receiving, and the battery will continue to LOSE current despite being hooked to a charger. Upgrade your car DC adapter! They are not all made the same.

How does 'bump' charging relate to all this?

Bump charging is essentially a way to trick the battery to continue charging despite the current draw being < the minimum charge current.

There is a problem with this "full" battery detection method:

If you draw enough current from the battery, while it is charging, after the minimum charge volt is reached, you can PREMATURELY fool the battery into thinking it is done.

Say the charging mA is at +200mA. If you turn on your smartphone, start GPS, turn the lights on, stream Pandora, etc., the mA will easily drop from +200 to a lesser value, negative even. The phone will think the charge is complete, since it is <80ma. THAT state becomes 100%, because the mAh get set to full capacity. Falsely.

However, this should only happen when the charge is ~90% or greater (when mv >4099). So, it may not play a huge significant role in battery time, basically missing out on 10% or so of battery life. Also, at the next recharge cycle, provided you don't fool it again, the mAh will be RESET to the more appropriate designated value.

If mAh can be set to whatever value whenever, how do we get it PROPERLY set/calibrated?

There are 2 times when mAh is automatically set. Upon draining the battery to empty (3416mv by default, 3201 preferably), when the phone shuts down, the mAh will be properly set = 0. This is good. We want mAh = 0 when mV = empty voltage.

The other time is when the battery thinks it's full, when minimum charge current is met--this is often not accurately set, not good.

If we start charging when the battery is empty, the mAh rises as the battery is charged. However, the MAXIMUM mAh needs to be watched. The mAh could be HIGHER than the programmed full mAh. Or far lower. Finding this maximum mAh, and reprogramming the battery accordingly, is the key.

Once again, when the battery hits the minimum charge current, the mAh will either jump up to the set battery capacity value (so the battery will die sooner than expected), or less commonly, drop down.

The goal is to get an accurate mAh capacity of the battery, for the voltage range between min + max, and have this set every time the battery is charged to capacity.

If we know the maximum mAh the battery reaches when charging, provided it started from 0, we want to reprogram the battery so that this value is set each time it completes charge.

There is a "learn mode" on the Nexus battery. Provided this was activated, through a series of very specific events, the battery would give itself a "battery age %". This is used to give the accurate (battery age % * full40) = true capacity. On the Nexus, the default battery age was 94%. So, mAh was set at every full charge to 94% of the full40 capacity. Obviously, this is not true for every battery forever.

Once again, why errors can and do occur:

mAh and mV are not directly linked. If mA falls to 0, or mV is less than the cutoff empty voltage, the phone will shutdown, even if the other value is still sufficient.

1. mAh is falsely high. The battery won't last as long as we think it will. Battery % is falsely high. Phone won't get to 0%.

2. mAh is falsely low. The voltage is adequate, but the mAh isn't correct. The battery % is falsely low. Phone gets to 0% too quickly. Perceived loss of battery life duration.

Why use mAh at all? Seems like mV is the only important thing?

I don't know. Why is mAh capacity important in telling the phone to shutdown? Someone enlighten me.

I think one reason is that voltage can and does fluctuate up. So using this to calculate battery % life would be extremely erratic and confusing.

What does this teach us, overall?

I'd have thought there would be much better technology built into battery calibration. Seriously. This is one big mess of poor design.

This is a bunch of technical mumbo jumbo. How does this help me?

On the N1, you can give yourself more battery life!

1. Set your 'empty voltage' lower

2. Set your minimum charge current lower

3. Calibrate the maximum mAh to a higher value to accomodate the new 'empty voltage' and 'minimum charge current' values

4. Don't play with the phone too much when it is >90% charging or it will prematurely end its charge cycle, give you a falsely higher charge %, resulting in the battery dying before you think it should.

5. Profit.

(On an extended 3200mAh battery from Seideo, after lowering the empty voltage and minimum charge current, I found >3900mAh (!) as my new maximum mAh. That's a heck of a lot of free juice).

On other phones? I'm hoping real programmers here can figure out how to do the same.

So, for the Nexus One, there is ABSOLUTELY NO correlation between battery calibration and the battery stats file. NONE. The values on the battery chip determine everything.

So, please comment on how battery calibration tech has changed over the past 2 Nexus generations. If it has.

ADDENDUM:

RogerPodacter, the xda guru/user who was instrumental in creating the N1 battery calibration app, has been looking into the GNex battery quite intently.

(If you found this info useful, please click the THANKS button!)