View Single Post
Posts: 701 | Thanked: 585 times | Joined on Sep 2010 @ London, England
#6
Originally Posted by debernardis View Post
Well, non-linearity could be a problem if you were to estimate the time left to shutdown, but then that would depend on average use as well, so I think it would be too rough to be useful.
Also my battery graph charts don't have the shape you describe, and contrarily seem to decrease linearly from the very top. So a millivolt-based meter might be feasible to estimate charge level imho.
The voltage also changes depending on how heavily the device is being used, although I imagine the fluctuation would be less on the Mugen compared to the normal battery. dr_frost_dk made a queen beacon script to convert voltage to a percentage and display it, you can find it in his Battery Mod thread. I took that script modified it to include date and the battery percentage the N900 reports itself and I run it periodically, here is some sample output from yesterday, note at the time of the first reading I was connected via 3G and I wasn't for the second and also I was constantly playing music for almost all of the two hours between the readings
Code:
$ ./batterypercent.sh 
Tue Feb  8 13:06:49 GMT 2011
3.965V - 76.5%
 battery.charge_level.percentage = 94 (0x5e) (int)
~ $ ./batterypercent.sh 
Tue Feb  8 15:05:38 GMT 2011
3.971V - 77.1%
 battery.charge_level.percentage = 77 (0x4d) (int)
So with his script based solely on the voltage my battery gain was 0.6% after two hours music playing, instead of the more realistic 17% decrease. You might still find it useful, but bear in mind that the voltage fluctuates a bit so it won't be terribly accurate.
 

The Following User Says Thank You to retsaw For This Useful Post: