yashsingh1/xdaforums huggingface dataset:
[Nexus One Android Development] RogerPodacter:
ok if you want to fix your battery, let's set your full40 to 2750mAh which should have you see a huge increase in what you've been getting out of your battery. 2 other guys had this problem and the fix resulted in a huge noticeable difference. prior they only got the same capacity as a stock 1452mAh battery. and notice your full40 is showing the same as stock. the phone doesnt know you have extra capacity, so its shutting off after using only 1452 mAh. (and no worries there's no danger in setting the full 40 value as the charge parameters take care of all that;))

echo 6a 19 > setreg

echo 6b c8 > setreg

that oughta fix you right up.
[Nexus One Android Development] temasek:
After some test I think I rather have a successful battery learned mode and have an accurate battery age so that my n1 will not auto shutdown at bet 10-20%. At 10% led start blinking red. Now i have longer warning. With successful battery learned mode I plugged in at 2%. ......yay......
[Nexus One Android Development] jlevy73:
Woah, what app is that?
[Nexus One Android Development] mtw4991:
correct, I set current to <20mA and set age to 100%. didn't really think it would blow up as it was only a 4-5% overcharge, but it did re-align itself upon full charge I guess. I really need to let it discharge to zero and do a learn, so that at least I'll know when it's gonna die:p
[Nexus One Android Development] RogerPodacter:
maybe yes maybe no, but one other guy tested setting his battery empty volt (AEvolt) down to 3 volts and says he's seeing an enormous difference in extended battery life with just the stock battery. i tried this setting, but i dont know how safe it is in the long run. but we do see the aftermarket batteries set to 3 volts so it may be ok. just think how much extra capacity between 3.4 and 3.0 volts we could be getting!
[Nexus One Android Development] jlevy73:
Interesting...I think I will need to read all 81 pages of this thread to throroughly familiarize myself with all the concepts involved. Really nice work!
[Nexus One Android Development] mtw4991:
+1 on that, fortunately I've already read the whole thread over time and some of it is WAY over my head, lol, but very nice work indeed.

And I love your app Roger... gonna release it soon'ish?:D
[Nexus One Android Development] temasek:
How u set battery empty volt to 3?
[Nexus One Android Development] jlevy73:
I was gonna say, is that app Roger using available somewhere?
[Nexus One Android Development] mtw4991:
It's an app that he and maybe loginwithnoname created. I believe it is almost ready for prime time, but he hasn't released it yet.

Hey Roger, need a couple of beta testers? Me n jlevy are in? :cool:
[Nexus One Android Development] RogerPodacter:
I wannaa say it was maybe half way into the thread where all the good stuff started. Can't remember exactly, it was about 2 months ago. ;-)
[Nexus One Android Development] mtw4991:
yeah, the last 20 or so pages have all the cool stuff. btw, 248+WM 11b+DT a2sd booted just fine.
[Nexus One Android Development] chowlala:
Yeah, around the time we discovered how to manually hit "learn mode" in a weird way. Then the ball started rolling and the avalanche swooped home with roger and login. Sexy times rolling in for the battery soon! *whee*
[Nexus One Android Development] temasek:
The weird way of hitting the "learn mode" does the job very well, at least for me :D

Looking forward for the actual app though.

Good job to all involved.
[Nexus One Android Development] RogerPodacter:
Yeah its an app we're writing to help do all the stuff in this thread. Basically its like a UI to do everything rather than having to manually do it with setreg etc. It's not fully working yet so I kinda feel bad posting it. We're trying to finish it as fast as we can and release it to you guys. Most of those screens are just a UI with not yet working fully back end. I'm trying to hurry! And sure you guys can test it. I can't make promises but I'd say relatively soon a beta may be ready.
[Nexus One Android Development] mtw4991:
cool, glad to help in whatever way I can. fyi, skip 248 if you're using CM nightlies...overheating and stuck on max CPU bugs still present. reverted back to 246
[Nexus One Android Development] temasek:
Roger,

1. How u set the battery empty volt (AEvolt) down to 3 volts ???

2. Whats your results of your testing of the above?
[Nexus One Android Development] RogerPodacter:
I really don't know how safe it is as the one attempt I did dropped fast and was kinda erratic. All documentation online says that 2.4 to 2.8 volts is the danger zone for lithium ion batteries, so technically it should be ok. But I don't wanna go post the command and then have everyone's battery flame up or something. Maybe a happy medium around 3.2 volts is the ideal setting. More testing definitely needed. And of course we do have protection hard coded into the ds2784 chip. I found the upper end limit of 4.277volts, but I can't seem to find where the low end kicks in...
[Nexus One Android Development] samarium:
IIRC way back in the depths of the thread someone experimented with this and said the voltage drop curve was very steep after 3.4V, so maybe 3.0V won't give you that much, however I too will be interested to test it myself.

Roger: thanks for the setregs, I'll do them tonight when I get home & can swap battery. No point lugging an extended battery around if I only get standard charge out of it. I spend all last night reading this all of this thread, very interesting.
[Nexus One Android Development] temasek:
Interesting.

I have ordered a new battery and awaiting delivery. So this means my existing battery is my test subject now :D

I don't mind trying out whats the lowest volts setting that ours can go to.....
[Nexus One Android Development] myakove:
OK thanks I will try to hit learn cycle once again, hope i can catch it this time.
[Nexus One Android Development] myakove:
Is it OK to buy replacement battery or I need to buy original Nexus One battery?

On ebay there is those two:

http://cgi.ebay.com/1600mAh-Li-ion-...648122?pt=PDA_Accessories&hash=item33613be83a

http://cgi.ebay.com/OEM-BB99100-Bat...981214?pt=PDA_Accessories&hash=item2a082fde1e
[Nexus One Android Development] theloginwithnoname:
I found that calculating your current age as: <chargeBeforeJump> * 100 / <theoreticalNewCharge> = age, therefore 1225 * 100 / 1400 = 87.5 - round down so you're not caught out by the last one or two percent left of battery, makes it 87 as the value you need to set.
[Nexus One Android Development] theloginwithnoname:
in which case we should poll every 3 seconds, as doing it every 4 seconds will mean you miss each third poll :-/ i.e. 3, 6, 9, 12 vs 4, 8, 12, 16

Good spot, hadn't seen that before. In the early days, I set FAST_POLL to be 9 seconds, so I was missing each 2nd poll. Trouble with faster polling is, it can accelerate shutdown - one of the conditions is if the battery volt (or was it current, can't recall at the moment) dips below a min value on two consecutive polls, shutdown occurs. If you're doing something on the phone and polling quickly, it can happen more often.

That was a horrid explanation but I hope you got the gist.
[Nexus One Android Development] myakove:
Thanks, How do I set this?

setreg 0x??
[Nexus One Android Development] theloginwithnoname:
:) Not too sure it's that sexy, but certainly helps rely on your battery more ;)

Chow, can you update the original post of this thread with links to the Battery Calibration tools thread I started - will help newbies with reference sheets, background etc. I think RP will likely post there with any download links to the app when it's ready too.
[Nexus One Android Development] temasek:
Just bought the 1600mAh one off ebay (hopefully its good), awaiting delivery. More for testing than actually using :D
[Nexus One Android Development] chowlala:
Updated with the fixes and links. =)
[Nexus One Android Development] RogerPodacter:
this battery has me VERY interested in seeing its dumpreg values, because this is the battery that fits in the nexus with the stock cover. and this battery was tested from that batteryboss thread a while back and deemed "no better than stock battery". and when you look at the methods they used, the stopped all their readings and capacity at 3.5 volts and claimed that the nexus did not go any lower than that. once we got dumpreg working and found out the actual AEvolt was set to 3.416 volts, i sent an email to them with our new findings and explained why their tests were missing some important capacity, but they didnt want to hear it. they actually tested seido against mugen against stock, all cutting off at 3.5 volts. but we see from dumpreg that each of these batteries has a different cut off voltage. so if a seido battery manufacturer wants to take theirs all the way down to 3.0 volts to reach their claimed capacity, then that's how the battery should be tested. because afterall, the phone is not gonna shut off till it hits 3.0 volts, so why stop at 3.5 volts? its an invalid test IMO.

so i wonder if the 1600mAh battery is just a stock battery with a lowered AEvolt setting to squeeze that extra range out of it?? possible, that's why i'd be curious to see the dumpreg from that sucker.

we really should have everyone with aftermarket batteries post their dumpreg and we make a spreadsheet of each battery's full40 mAh, empty volt, full volt, so we know which are the good ones and which are not so good. it definitely would help us know which battery is worth buying.
[Nexus One Android Development] RogerPodacter:
for age 88%:

0x14 71

for age 87%:

0x14 70
[Nexus One Android Development] jlevy73:
Thanks for updating the OP.
[Nexus One Android Development] RogerPodacter:
ok yeah i dont mind giving you guys the command, its not my call afterall. i just didnt know how stable/safe it was, so maybe we can get a few testers first to try it out. honestly i've read as much as i could, and there doesnt seem to be any harm with li-ion till you get lower than 2.5 volts, and even that is fine, its at 1.5 volts where supposedly the cells and lithium undergoes some type of chemical reaction that is irreversible, with possible flame-up or something like that.
[Nexus One Android Development] RogerPodacter:
you dont have to use stock, go with aftermarket if you want. just let us know what you get and post the dumpreg so we can see if its correctly programmed and what the parameters are set to.:D

anyway i tried to do a learn cycle again yesterday, and after 60 minutes i got another timeout error, which kicked the learn cycle off. this sucks, we're gonna have to fix the driver and re-submit.:(
[Nexus One Android Development] myakove:
Ordered the 1600mAh battery, will update when I get it.
[Nexus One Android Development] myakove:
Another question, if I set the reg it's written to the battery? or if i change ROM it will remove my setting?

Every day I flash CM nightly.
[Nexus One Android Development] jlevy73:
I take it back, my battery sucks lol:

batt: 100%, 4099mv, -136mA, 33.6C, 1360mAh

4 minutes later...

batt: 99%, 4099mv, -109mA, 30.1C, 1340mA
[Nexus One Android Development] temasek:
My battery age is now 84% at 1212 mAh max. Who's worst? Lmao.....mine!
[Nexus One Android Development] RogerPodacter:
its written to the actual chip inside the battery, so it should stay the same switching to other ROM's. however we see the age gets reset sometimes during power off, so you never know. i think the idea is to get these changes into as many ROMs as we can, so its always available.
[Nexus One Android Development] RogerPodacter:
that's not necessarily bad i dont think, but the voltage is usually a little higher at full charge 1360mAh. guess your age is still 94%. if you dropped from 1360 to 1340mAh in 4 minutes of no usage, then that is bad. but if you used the device for 4 minutes, that may be reasonable.

i would look more at the voltage and mAh rather than the percent dropping from 100 to 99 etc.
[Nexus One Android Development] Booker-T:
I want to know if we can use USB to fast charge?
[Nexus One Android Development] RogerPodacter:
ok for anyone who wants to test, be careful and dont hammer your battery balls-out at the end. but i've seen some increase in usage time setting empty volt to 3.084v. i just read every PDF file i could and they do all their baseline tests to 2.5 volts on all their li-ion batterys. so 3.08v is a good happy medium. good luck and at your own risk.

empty volt 3.084 volts:

0x66 9e > setreg

back to stock 3.416 volts:

0x66 af > setreg

to be honest, mine seemed stable to around 3.2 volts where it then dropped very fast. so i bet 3.2 will end up being the sweet spot.
[Nexus One Android Development] jlevy73:
Ah yes, that's the sad part, that 4% drop was with the phone sitting idle on my desk. I checked the cpu load and over 60 seconds it never went about 15%.
[Nexus One Android Development] myakove:
I set the battery age to 0x14 70 and now I get full charge to 100% without any jumps on the way:

<6>[11122.599426] batt: 99%, 4182 mV, 30 mA (32 avg), 33.5 C, 1252 mAh

<6>[11172.774993] batt: 99%, 4182 mV, 25 mA (29 avg), 33.5 C, 1254 mAh

<6>[11222.886810] batt: 99%, 4182 mV, 27 mA (21 avg), 33.5 C, 1254 mAh

<6>[11275.537506] batt: 100%, 4182 mV, 26 mA (26 avg), 33.5 C, 1254 mAh

<6>[11325.671722] batt: 100%, 4182 mV, 23 mA (25 avg), 33.5 C, 1254 mAh

<6>[11375.773834] batt: 100%, 4177 mV, 24 mA (24 avg), 33.5 C, 1256 mAh

<6>[11425.968475] batt: 100%, 4182 mV, 20 mA (21 avg), 33.5 C, 1256 mAh

<6>[11476.080383] batt: 100%, 4182 mV, 24 mA (21 avg), 33.5 C, 1256 mAh

<6>[11526.185791] batt: 100%, 4182 mV, 21 mA (22 avg), 33.3 C, 1256 mAh

<6>[11576.292053] batt: 100%, 4177 mV, 21 mA (21 avg), 33.3 C, 1256 mAh

<6>[11626.411132] batt: 100%, 4182 mV, 22 mA (21 avg), 33.3 C, 1256 mAh

<6>[11676.532012] batt: 100%, 4182 mV, 18 mA (21 avg), 33.2 C, 1257 mAh

<6>[11726.638275] batt: 100%, 4182 mV, 19 mA (20 avg), 33.2 C, 1257 mAh

<6>[11776.765197] batt: 100%, 4182 mV, 19 mA (19 avg), 33.2 C, 1259 mAh

Also notice that the last 10% charging very slowly.

Now I'm using 2.6.35.8-CFS-intersectR kernel so the age I set before still on (I pretty sure that this kernel doesn't have the new battery driver).

tomorrow I will test the empty volt 3.084.
[Nexus One Android Development] samarium:
I just connected my N1 to my computer via the same cable I use to fast charge from my 2A 4xUSB outlet mains adapter but using a dual USB A-male to USB A-female power leach adapter cable, and OS Monitor says AC: Online.

IIRC you need a USB charging cable with D0&D1 connected with <= 200Ohn resistance, however I haven't tried to confirm that is happening with my USB charging cable. YMMV

# sed 1q /d/bat*; tail -5 /d/bat*
timestamp mV mA avg mA uAh dC % src mode reg full
47331 3855 -11 -9 1465600 250 57 none off 0x07 0
47430 3859 -14 -17 1464000 248 57 none off 0x07 0
47496 3850 -127 -99 1462400 248 57 none off 0x07 0
47546 3894 602 -93 1464000 251 57 ac fast 0x07 0
47596 3908 617 626 1473600 257 57 ac fast 0x07 0

Further, using dual USB from computer the best I get is 650 mA & depends on computer, however from mains adapter I get 780 mA and that may depend upon the adapter too.
[Nexus One Android Development] RogerPodacter:
Yeah from what I've been able to see, it determines usb vs ac charging based on the current it takes in. For ac I usually see around 750mAx and usb I only see around 450mA or so.

I don't think it can tell from the cable itself at all. If you somehow could connect to a high current usb with identical cable then it would read as ac charging.
[Nexus One Android Development] Markdental:
How do we know If this worked?
[Nexus One Android Development] flak0:
I'm trying this now with 84% battery age set to
[Nexus One Android Development] theloginwithnoname:
how to calculate the values

Perhaps worth pointing out how these values are reached, again apologies if this loses people, it's often difficult to explain!

age is commonly referred to as a percent, however internally it's stored as a value 2^7 - therefore 128 is max value and 100%

According to the specs, the minimum practical value for age is 80% but I think the specs say you can set it as low as 50%

getting back to RP's numbers, if 128 = 100%, then 128 expressed as hex (which is what most of the battery registers use) is 80*

Therefore RPs figure of 71 -> 113 -> 88.28%, which I think is rounded to 88%

* I use Windows calculator in Programmer mode to convert these. If you wanted to convert 128 to hex, select Dec on left hand side and type in 128. Then select Hex. Display with show 80. (and vice versa)
[Nexus One Android Development] theloginwithnoname:
register address reference

if you want the register addresses, refer to the Battery Calibration tool thread as per OP - it has all registers' names, addresses, and some units etc.
[Nexus One Android Development] theloginwithnoname:
looks fine to me actually, the screen timeout probably accounted for the 15-20mAh drop. Screen off and CPU setcpu'ed at 245, mine drops 4-5mAh a minute.
[Nexus One Android Development] samarium:
Have to disagree with you on this one. Using exactly the same charger but with a USB data cable vs a USB charging cable, I see SLOW vs FAST status report from the battery log & from dmesg.

IIRC, maybe from the openmoko project, the problem is that you can't just assume that you can drag more than the rated 500 mA out of a USB port, as you might overdrive and thus damage it or the port will detect the overdrive and shutdown to protect itself, either way you quickly run short on electrons. By using a special charging cable as I read about recently, but can't remember where, the chargee device can determine if it is really talking to a USB port or something able to provide more than 500 mA.
[Nexus One Android Development] myakove:
Set volt to 3.084 and get very good battery life

<6>[10021.947570] batt: 7%, 3654 mV, -172 mA (-129 avg), 35.5 C, 92 mAh

<6>[10072.082000] batt: 7%, 3640 mV, -309 mA (-239 avg), 35.5 C, 89 mAh

<6>[10122.207397] batt: 6%, 3449 mV, -1209 mA (-918 avg), 38.2 C, 76 mAh

<6>[10172.352416] batt: 5%, 3415 mV, -1242 mA (-1158 avg), 39.3 C, 60 mAh

<6>[10222.547363] batt: 3%, 3258 mV, -1746 mA (-1270 avg), 42.3 C, 43 mAh

<6>[10272.689910] batt: 2%, 3478 mV, -278 mA (-626 avg), 40.2 C, 32 mAh

<6>[10322.831939] batt: 2%, 3503 mV, -134 mA (-152 avg), 39.5 C, 27 mAh

<6>[10370.798919] active wake lock ds2784-battery

<6>[10370.863250] batt: 2%, 3517 mV, -5 mA (-81 avg), 39.2 C, 25 mAh

<6>[10413.030395] active wake lock ds2784-battery

<6>[10413.087646] batt: 2%, 3527 mV, -6 mA (-53 avg), 39.0 C, 25 mAh

<6>[10463.215057] batt: 2%, 3513 mV, -65 mA (-67 avg), 38.5 C, 22 mAh

<6>[10513.322845] batt: 2%, 3517 mV, -65 mA (-69 avg), 38.2 C, 22 mAh

<6>[10553.285552] batt: 2%, 3483 mV, -36 mA (-69 avg), 37.7 C, 20 mAh

<6>[10603.389556] batt: 1%, 3488 mV, -133 mA (-195 avg), 37.5 C, 17 mAh

<6>[10653.534332] batt: 1%, 3473 mV, -142 mA (-163 avg), 37.3 C, 14 mAh

<6>[10703.641174] batt: 1%, 3415 mV, -288 mA (-327 avg), 37.3 C, 11 mAh

<6>[10757.159149] batt: 0%, 2843 mV, -2306 mA (-1090 avg), 43.6 C, 0 mAh
[Nexus One Android Development] samarium:
In the interval between 10703 seconds uptime and 10757, ie 54 sec, the battery voltage fell off a cliff and dropped from 3415 mV to 2843 mV and the battery shutdown. I wonder what the huge current drain was caused by?

To me this looks like leaving AEV at 3416 mV would do the just about the same, ie during the interval before 3415 mV you would get LEARN enabled, and then the battery would shutdown about 60 sec later.
[Nexus One Android Development] RogerPodacter:
Can you tell me did you start from 100% and make it all the way down to zero % and zero mAh? And was your age set to 100%? What I'm wondering is, did you start at 1440mAh and go thru all of it till you hit zero and 3volts where it then shut off? If so then that is a huge increase in usable capacity and we should all set our age to max and volt to 3.1. Currently I think most of us see about 1200mAh of usable capacity, though we supposedly have stock 1452mAh batteries. That would be great if this now let's us use all of that mAh.
[Nexus One Android Development] RogerPodacter:
Yeah I see a fast drop like that too, but mine stays stable till about 3.2volts, then drops like that. Longer than 1 minute though, but that's just the way these batteries work I guess. I'm curious if he burned thru all 1400mAh to get there. If so that's impressive. Mine too dropped so fast that the battery didn't even get polled quickly enough to know that the volt dropped to 2.9volts before shut down. Wonder if that's dangerous?
[Nexus One Android Development] RogerPodacter:
i found another interesting PDF from our batt manufacturer. for some other model's (not ours though), they use voltage breakpoints to determine percentage. our battery uses other model similar to coulomb counting (but not quite). anyway here's the voltage points, link also below. this is for the ds2786 battery (we have ds2784):

http://www.maxim-ic.com/app-notes/index.mvp/id/4189

Capacity Voltage
100 4.177454
95 4.129486
90 4.085934
85 4.045427
80 4.008118
75 3.974769
70 3.945074
65 3.917968
60 3.884009
55 3.841219
50 3.820965
45 3.805737
40 3.79325
35 3.783504
30 3.775129
25 3.762185
20 3.741018
15 3.7098
10 3.686654
5 3.674776
0 3.305545

no reason why we cant use this as a rough estimate to our battery, so we know where we stand at low voltages.

related note, i'm doing a full discharge, and so far this run has given me excellent results. i set to 3.084 volts. i started full charge at 4.17 volts at 1430 mAh. i used the phone all day at work today, my voltage right now is 3.571volts, and i'm 126 mAh left in the battery, showing 9% left. so the math on that is i've used, true capacity, 1301 mAh. and its still dropping, though it will start to go quick.

so that tells me that an actual usable capacity is increased a whole lot from before. i used to die early and only go thru 1200 mAh at most. but with my age set to 100%, and lowered volt, its getting close to the full 1400 mAh that it should be getting. more testing needed obviously.
[Nexus One Android Development] myakove:
I started from 100% and hit 0% with 1240mAh on start, set age to 87% and volt to 3.084.
[Nexus One Android Development] myakove:
I think the drop was because i opened torch with high bright and the camera at the same time.
[Nexus One Android Development] samarium:
Very interesting. I have updated my capacity to match my 2700 mAh battery, and apart from the problem of getting it to discharge fast enough, to try and trigger a learning cycle, I was thinking that since my voltage was above 3.6 volts and nowhere near 3.4 volts that there should be much more capacity, however it seems there is < 5%.
[Nexus One Android Development] temasek:
Sam, may I ask where u bought the 2700 mAh battery? possible a link?

I saw some off ebay but very hesitant to buy.
[Nexus One Android Development] samarium:
I bought it off ebay in May, however wasn't that much better than a standard battery at that time so I stopped using it. When I saw this thread start to arc up then I got more interested in it again.

I don't have the ebay link anymore [well, gmail does, and it currently redirects to here: http://phones.shop.ebay.com.au/Batteries-/20357/i.html], however I've just ordered a 2600mAh one from dealextreme.com in HK for < USD 14, and the good thing about dealextreme is free postage. I've also just ordered a 1600mAh from ebay for < USD 8. If you hassle me in a couple of weeks I'll give you an update on them both, since I should have them by then and have tested them too.

The 2700 mAh I got seems to charge up to about 2566 mAh, and it wouldn't surprise me if all the 2400, 2500, 2600 & 2700 batteries you see are the same, maybe even the 3200s.

I figure Roger might like to look at the dumpreg of my collection, because it will number 5 when I get the new ones. At this point in time, I'm happy I didn't pay USD 80 for a Mugen 3200 mAh.
[Nexus One Android Development] temasek:
Thanks. I got myself 1600 mAh about USD 9, awaiting delivery too off eBay. Will ask u in a couple of weeks as I am interested in bigger capacity but dunno if it sucks at the back cover. Will checkout the site u stated. Thanks again.