Measure and compare your battery capacity - easy, foolproof, comparable - any WM dev

Search This thread

tobbbie

Senior Member
Jan 5, 2007
1,452
252
Stuttgart
Hi all,

...since I could not find a program to achieve this, I had to write one myself. Well, it is not a program, but just a MortScript to do the job of data collection while the battery is discharged.
As MortScript runs on all WM platforms from WM2k3 onwards and on both: Smartphone (standard) and PocketPC (professional), you can use this concept for all devices that MortScript runs on.

You have to take care yourself that the battery is full before you start and that the discharge is constant over time. Both is easy however :)

The job to discharge your battery while measured is done by the display lit to the maximum brightness and all other big current drains should be off to get comparable data. The script runs in the background and whenever the Battery% goes down is writes to a file remembering the timestamp for this.

For my devices the time to drain the batteries from full to zero was 1-16 hours, depending on how much the fully lit display draws off the battery and capacity and health of the battery.

Evaluation is done off-line with a spreadsheet program.

Usage:
  1. install MortScript
  2. unzip the attached file to your PC
  3. put the battery-rundown.mscr file to the folder \My Documents\Battery or \Storage\My Documents\Battery for WM2K3 on your device
  4. put the battery-rundown.lnk (*-wm2k3.* for WM2k3) file on your device to the \windows\startup folder. This makes sure that the script starts as soon as your device starts. It will not do any harm there and can even stay there for a longer time if you want to learn about your battery charge cycles. You can also copy it to any other place you like in the startmenu for easy access.
  5. make sure all radio access is off (GSM/UMTS, BT, WLAN)
  6. adjust the display and backlight on battery to stay on forever as well as backlight brightness for battery use to maximum
  7. switch off the device
  8. charge it until the battery is full (green light). Optionally leave it like this for another 1-3 hours to get the trickle charge squeeze the last electrons to the battery. Impact of this should not be more than 10% capacity - skip it if you are impatient.
  9. switch on, the script starts automatically and measurement has created a file where the mortscript resides. It will continue to write to this file until the battery goes to 0% and device switches off.
  10. disconnect from the charger (but you did this already, or?)
  11. You can check from time to time the content of the log-file to see the progress if you like.
  12. leave the device alone until is is off - this will take several hours, best is to do this over night. Put it at a place where the battery warning is not disturbing you at night.
  13. after the device is off due to the empty battery, reconnect the charger and switch on after a few seconds of recovery
  14. now you can look at the log-file and examine or post-process it in a spreadsheet program - the timestamp should tell you which file it was.
The resulting file "bd_<date-time-started>.csv can be loaded to a spreadsheet and evaluated, so you can compare your own batteries to see which is the best.

Even better, for the same device type the standardized method of measurement, where the current drain by the fully lit display should be reasonably identical for all devices, makes it possible to share battery quality data for 3rd party suppliers. A reasonable point of comparison for one device type is the time it takes until the battery is drained down to 10% - despite the discharge is not at all linear (usually).

I did all this and supply you all my data as an example to depict what you can do yourself now.

I hope you find the script useful.

For device specific discussions, please open a thread in the relevant device forum - pointing to this thread for the method - and not here. This thread is only to discuss the scripts or the method of measurement.

Note:
Please also read post 2 (device specific links) and post 3 (general hints on batteries) of this thread. I will update them from time to time when new info is available.

20100225 added:
If you want to find out how much drain happens to your battery in the test-setup, you can ask the battery driver, e.g. by using HomeScreen++ or BattClock. Mind that this data is not immediately reliable, especially when you change conditions (e.g. dim the light) the change is often reflected only minutes later. The true value can only be found by measuring the drain with an Ampere-meter. This is harder than you may think as the impedance of the meter must be very low to get the device started up properly.

20100313 added:
More programs to read the power drain:
free: acbpowermeter
cost: acbtaskman (can also export data) same provider as above.

Update to the script and few more data inserted to the spreadsheet:
  1. The script now logs several items from the registry, including the Data for CurrentDrain and BatteryTemperature that BattClock writes if it is configured to show them in display.
  2. Started to measure standby drain on all my spare devices - mileage varies. This is also not a real life measurement as the devices have everything shut off (light, radio etc..) and the only process that keeps them busy is the script waking up each 5 minutes. If you like you can change the value for MaxSleepTime in the script to much higher values to decrease the impact of drain to the measurement. I am not sure how this will behave on WM Professional with its complicated power model (standby mode) but on smartphone it runs very well. First data are available in the spreadsheet. It would be best of course to be notified by the system if the battery percentage changes instead of polling for it, but MortScript does not supply a method to achieve this.
20101123 added:
The script reads from data that the BattClock program writes to the registry if you configure it to do so. Further changes are:

  1. Also BatteryVoltage is read from BattClock Data
  2. Added log of status even if % has not changed if MaxLogWait has passed and if Battery % is below a given limit of LogForcePercent. This is needed as the last % (e.g. from 1 to 0) may take a long time (seen as 1h on an Asus P565) and the 0% will not be written because the device just switches off when 0% is reached. There is no chance for the script to write the last data to file in such case.
  3. added a delta-% column to easily detect non linear decrements
The full change history is included in the script:
Code:
# Date        ID            comments
# 20101123    tobbbie        changed script to match to a TAB alignment of 8 characters
# 20101123    tobbbie        altered the logic  for LogForcePercent and set default to 0 to not log anything by default.
# 20101010    tobbbie        Added log of status even if % has not changed if MaxLogWait has passed and if Battery % is 
#                below a given limit of LogForcePercent. This is needed as the last % (e.g. from 1 to 0) may 
#                take a long time (seen as 1h on an Asus P565) and the 0% will not be written because the 
#                device just switches off when 0% is reached. There is no chance for the script to write the 
#                last data to file in such case.
#                added a delta-% column to easily detect non linear decrements
# 20100425    tobbbie        added Registry Read for BattClock BatteryVoltage, rearranged sequence of items
# 20100313    tobbbie        added evaluation of \HKLM\System\State\Battery "main" to logging
# 20100313    tobbbie        added identification of device via HKLM\Ident and IMEI in headerline
# 20100312    tobbbie        made dword registry data to be logged as "0" if no data retrieved
# 20100302    tobbbie        added registry read for data created by BattClock
# 20100205    tobbbie        added self-adjusting sleeptime (InitSleepTime to MaxSleepTime in ms)
# 20100201    tobbbie        initial version
# 20100128    tobbbie        draft versions, proof of concept
 

Attachments

  • Amadeus.jpg
    Amadeus.jpg
    83.7 KB · Views: 683
  • Hurricane.jpg
    Hurricane.jpg
    78 KB · Views: 396
  • Tornado.jpg
    Tornado.jpg
    86.2 KB · Views: 270
  • Vox.jpg
    Vox.jpg
    63.6 KB · Views: 248
  • LG-KS20.jpg
    LG-KS20.jpg
    69 KB · Views: 205
  • Standby-discharge.jpg
    Standby-discharge.jpg
    57.3 KB · Views: 170
  • Charge-sample.jpg
    Charge-sample.jpg
    63.3 KB · Views: 197
  • BatteryRundown.zip
    30.3 KB · Views: 153
Last edited:
  • Like
Reactions: benryanau

tobbbie

Senior Member
Jan 5, 2007
1,452
252
Stuttgart
A lot of background information can be found at the "Battery University": http://www.batteryuniversity.com/index.htm

A specially interesting part is the one about charging: http://www.batteryuniversity.com/partone-12.htm

I have seen a strange charge curves on my Hurricane device - it goes to 68% and jumps to 100% suddenly. This device has a very bad discharge curve (% accuracy) anyway - so the charge fits to that as well. I am using the T-Mobile Germany SDA 2 standard firmware of the device - and since it is in my "museum" I will not put more effort in getting it tracked down.

At least I can confirm that the discharge for the same battery in the same device is nearly identical (I did this for the worst performing battery). I will upload some new result Excel soon.

To be on the safe side that your battery is properly charged, leave the battery charging for at least 4 hours. This should make sure that "step 2" of the charge (where the charge current goes down until charge cut-off) is sufficiently executed. In how much the "green LED" signal is linked to charge-cut-off is device dependent - it may even be different if you charge via the bootloader (device is completely "off") or with the battery driver controling the job.
 
Last edited:

tobbbie

Senior Member
Jan 5, 2007
1,452
252
Stuttgart
Ooops, this thread was lifted to the front-page news (I checked there to see the new design), so I hope to see some new device threads starting up and some more comparable data on "my" devices.

The echo was quite low (as of now: null) on these threads, so I suspect that people are happy with their batteries and have no need to know (or report) the truth.
 

mccune

Senior Member
Nov 21, 2005
2,678
50
www.mccune.nl
Will post this in the Rhodium section as well. Great idea!

Don't give up on projects like these. It looks like XDA has a lot of members compared to a few years back, but the group of tech geeks (this is actually meant positive) remain about the same. :p
 

tobbbie

Senior Member
Jan 5, 2007
1,452
252
Stuttgart
Please get back to this thread or PM me if you have reports of the test running on other devices. I'd prefer if you can deliver data along with your reports - of course.

Mind that the script can easily be enhanced to collect more information, e.g voltage or battery drain if these can be accessed via MortScript. A good place to observe is the HKLM\System\State\Battery\ where different drivers are updating useful information. Unfortunately not for mine, so I have not included it here.
 

mccune

Senior Member
Nov 21, 2005
2,678
50
www.mccune.nl
I've posted this in the Rhodium section as promised.
You can find it right HERE. I did copy your post to keep things more general.

concerning the images you've posted they seem to lack some quality and are a bit hard to read.
EDIT: It seems that the graphics in the attachment from the first post are just fine.

Currently I'm charging my TouchPro2 to perform the test!
 

tobbbie

Senior Member
Jan 5, 2007
1,452
252
Stuttgart
thanks, mccune!

I have added your post to the list in post 2 of this thread. I really hope that all the speculation on usage time and performance which is derived by comparing "average use" over time will fade away using this simple method.

If you like to adapt the script by adding related registry values from your device, feel free to do so. Many newer battery drivers are supplying data to the HKLM\System\State\Battery hierarchy of the registry.
If doing this, please do it conditionally on existence of the value so that the script can stay generic and still run on devices where the driver does not supply the data.

I would like to follow two real physical values when the battery runs down: battery voltage and current drain from the battery. This could put the comparison of batteries even out of the "device specific" cage - still assuming that the supplied values are sufficiently accurate though. However, since charging LiIon batteries is much depending on accurate voltage, this assumption should be valid.

Regarding the pictures: The board limits the picture size to 640x480 and resizes accordingly. As you found out the ZIP has the original pictures inside.
 

mccune

Senior Member
Nov 21, 2005
2,678
50
www.mccune.nl
@tobbie
I've finished the testing but I did not get the values quite correct in the Excel sheet it seems.

Can you have a look at it? You can just send me the pics and I'll post them in the Rhodium section for you.

I performed two tests.

First: just charging the battery till the LED turns green (100%) and followed the instructions from the first post to perform the test.

Second: After the first test I've removed the battery for about 30 seconds and inserted the battery but left the device turned off. After it was fully charged I removed the battery again for 30 seconds. I put back the battery and performed the test again. I've read that this is the way to calibrate your battery after flashing.
 

tobbbie

Senior Member
Jan 5, 2007
1,452
252
Stuttgart
The data looks fine - you can take the sheets directly to generate an individual graph in Excel. Just mark the first 2 columns, select the "Graph" button and then the "Points(XY)" graph type.

You also have to take care that the right % values are taking the time data. It sometimes happens that the % rundown is not getting all values, so certain % values are simply never seen (like 99,98 or 24 in your data).

If you want to use one of my sheets as a sample, then you need to create a % scale first for your device (it seems it can take all % values - while for the Tornado the < 20% are stepping in larger increments).
Then the copy/paste has to use the "transpose" option of the "paste information" menu to convert the column to line data.

I have done a quick graph on your data, see attach. You can further beautify this. I am surprised to see that the device has 10 hours of rundown time with the large display. Are you sure you have set the light to the maximum value on battery?
What were the current drain readings you got from the driver?
 

Attachments

  • Rhodium-Rundown.zip
    4.3 KB · Views: 20

mccune

Senior Member
Nov 21, 2005
2,678
50
www.mccune.nl
Thanks for this I can really work with this. I realized that I could just replace your data with mine but you've already done it.

Concerning the brightness. I did set it to maximum. The ROM used however is my own custom Rhodium ROM. Maybe I'll repeat the test with a WM6.5 ROM to see if you can actually notice any difference. At the moment I'm testing a Nokia E72 so my Rhodium can be used for testing a little longer :)

I normally use Homescreen++ to view the current drain. Another option would be to use BattClock 1.9 which seem to support this feature as well.
What method do you use to read out the current drain?
 

tobbbie

Senior Member
Jan 5, 2007
1,452
252
Stuttgart
The ROM used however is my own custom Rhodium ROM. Maybe I'll repeat the test with a WM6.5 ROM to see if you can actually notice any difference. At the moment I'm testing a Nokia E72 so my Rhodium can be used for testing a little longer :)
Good that you can spend some time on it. I doubt that the ROM is making a difference as the OEM drivers and settings (battery, display) are usually not changed when cooking.
You have seen in the charts that the "calibration" is actually not doing anything worth noting down. Put in a different battery (other vendor) and you will see a difference. Nice to see that the percentage rundown is nearly linear on the device :)

I normally use Homescreen++ to view the current drain. Another option would be to use BattClock 1.9 which seem to support this feature as well.
What method do you use to read out the current drain?
Both programs ask the same driver so they should deliver the same values.

Can you actually TELL what the value of your drain was on the Rhodium?

My "method" is to connect an Ampere-meter (an old analog one to get a clue on the average current) - a little tricky though but it works once you have managed to get the "adapter" assembled.
 

mccune

Senior Member
Nov 21, 2005
2,678
50
www.mccune.nl
My current drain on the Rhodium is:
- full lit display: 134 mA
- dim display: 35 mA
- Backlight can't be turned off so can't tell what the current drain for the third measurement is.

Modified the post in the Rhodium section.
Also added this line to the post:

"(If you want to use software try HomeScreen++ or BattClock to get the readings about the current drain.)"
 

tobbbie

Senior Member
Jan 5, 2007
1,452
252
Stuttgart
Yes it is - actually for calculating the capacity it is now simple: roughly 10 hours with 135 mA gives 1350 mAh capacity for the battery in the Rhodium. What is the rated capacity of the battery inside?
Was it the regular battery or a spare one from a different vendor?

If you use my sheets as a template you find fields for any of the interesting data that can be listed - also battery manufacturer and serial to tell apart different batteries.
I will add the two programs to the first post so that people do not have to read the full thread. Thanks for the information.
 

mccune

Senior Member
Nov 21, 2005
2,678
50
www.mccune.nl
Yes it is - actually for calculating the capacity it is now simple: roughly 10 hours with 135 mA gives 1350 mAh capacity for the battery in the Rhodium. What is the rated capacity of the battery inside?
Was it the regular battery or a spare one from a different vendor?........

I use the regular Rhodium battery. Age is about 6 or 7 months now.
 

mccune

Senior Member
Nov 21, 2005
2,678
50
www.mccune.nl
Today I've finished the test with a WM6.5 ROM. As you've predicted it's pretty much the same so I decided not to add it.

What might be useful to know is that you only get 10% increments when using the default battery driver from HTC. On my 6.1 ROM I was using a 1% driver so the data is measured much more frequent.
 

pgonza02

Senior Member
Apr 1, 2008
237
19
Miami, FL
Data for PURE

Hi,
I have recorded data for my PURE.
It seems to suck battery very fast. Doesn't normally last a workday.
I am running TESS LEO IV ROM.

Would love to compare with someone with a similar device but did not see a thread for the PURE/D2/Topaz

Thanks.
 

Attachments

  • PGonza02_PURE.jpg
    PGonza02_PURE.jpg
    85.5 KB · Views: 28

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Hi all,

    ...since I could not find a program to achieve this, I had to write one myself. Well, it is not a program, but just a MortScript to do the job of data collection while the battery is discharged.
    As MortScript runs on all WM platforms from WM2k3 onwards and on both: Smartphone (standard) and PocketPC (professional), you can use this concept for all devices that MortScript runs on.

    You have to take care yourself that the battery is full before you start and that the discharge is constant over time. Both is easy however :)

    The job to discharge your battery while measured is done by the display lit to the maximum brightness and all other big current drains should be off to get comparable data. The script runs in the background and whenever the Battery% goes down is writes to a file remembering the timestamp for this.

    For my devices the time to drain the batteries from full to zero was 1-16 hours, depending on how much the fully lit display draws off the battery and capacity and health of the battery.

    Evaluation is done off-line with a spreadsheet program.

    Usage:
    1. install MortScript
    2. unzip the attached file to your PC
    3. put the battery-rundown.mscr file to the folder \My Documents\Battery or \Storage\My Documents\Battery for WM2K3 on your device
    4. put the battery-rundown.lnk (*-wm2k3.* for WM2k3) file on your device to the \windows\startup folder. This makes sure that the script starts as soon as your device starts. It will not do any harm there and can even stay there for a longer time if you want to learn about your battery charge cycles. You can also copy it to any other place you like in the startmenu for easy access.
    5. make sure all radio access is off (GSM/UMTS, BT, WLAN)
    6. adjust the display and backlight on battery to stay on forever as well as backlight brightness for battery use to maximum
    7. switch off the device
    8. charge it until the battery is full (green light). Optionally leave it like this for another 1-3 hours to get the trickle charge squeeze the last electrons to the battery. Impact of this should not be more than 10% capacity - skip it if you are impatient.
    9. switch on, the script starts automatically and measurement has created a file where the mortscript resides. It will continue to write to this file until the battery goes to 0% and device switches off.
    10. disconnect from the charger (but you did this already, or?)
    11. You can check from time to time the content of the log-file to see the progress if you like.
    12. leave the device alone until is is off - this will take several hours, best is to do this over night. Put it at a place where the battery warning is not disturbing you at night.
    13. after the device is off due to the empty battery, reconnect the charger and switch on after a few seconds of recovery
    14. now you can look at the log-file and examine or post-process it in a spreadsheet program - the timestamp should tell you which file it was.
    The resulting file "bd_<date-time-started>.csv can be loaded to a spreadsheet and evaluated, so you can compare your own batteries to see which is the best.

    Even better, for the same device type the standardized method of measurement, where the current drain by the fully lit display should be reasonably identical for all devices, makes it possible to share battery quality data for 3rd party suppliers. A reasonable point of comparison for one device type is the time it takes until the battery is drained down to 10% - despite the discharge is not at all linear (usually).

    I did all this and supply you all my data as an example to depict what you can do yourself now.

    I hope you find the script useful.

    For device specific discussions, please open a thread in the relevant device forum - pointing to this thread for the method - and not here. This thread is only to discuss the scripts or the method of measurement.

    Note:
    Please also read post 2 (device specific links) and post 3 (general hints on batteries) of this thread. I will update them from time to time when new info is available.

    20100225 added:
    If you want to find out how much drain happens to your battery in the test-setup, you can ask the battery driver, e.g. by using HomeScreen++ or BattClock. Mind that this data is not immediately reliable, especially when you change conditions (e.g. dim the light) the change is often reflected only minutes later. The true value can only be found by measuring the drain with an Ampere-meter. This is harder than you may think as the impedance of the meter must be very low to get the device started up properly.

    20100313 added:
    More programs to read the power drain:
    free: acbpowermeter
    cost: acbtaskman (can also export data) same provider as above.

    Update to the script and few more data inserted to the spreadsheet:
    1. The script now logs several items from the registry, including the Data for CurrentDrain and BatteryTemperature that BattClock writes if it is configured to show them in display.
    2. Started to measure standby drain on all my spare devices - mileage varies. This is also not a real life measurement as the devices have everything shut off (light, radio etc..) and the only process that keeps them busy is the script waking up each 5 minutes. If you like you can change the value for MaxSleepTime in the script to much higher values to decrease the impact of drain to the measurement. I am not sure how this will behave on WM Professional with its complicated power model (standby mode) but on smartphone it runs very well. First data are available in the spreadsheet. It would be best of course to be notified by the system if the battery percentage changes instead of polling for it, but MortScript does not supply a method to achieve this.
    20101123 added:
    The script reads from data that the BattClock program writes to the registry if you configure it to do so. Further changes are:

    1. Also BatteryVoltage is read from BattClock Data
    2. Added log of status even if % has not changed if MaxLogWait has passed and if Battery % is below a given limit of LogForcePercent. This is needed as the last % (e.g. from 1 to 0) may take a long time (seen as 1h on an Asus P565) and the 0% will not be written because the device just switches off when 0% is reached. There is no chance for the script to write the last data to file in such case.
    3. added a delta-% column to easily detect non linear decrements
    The full change history is included in the script:
    Code:
    # Date        ID            comments
    # 20101123    tobbbie        changed script to match to a TAB alignment of 8 characters
    # 20101123    tobbbie        altered the logic  for LogForcePercent and set default to 0 to not log anything by default.
    # 20101010    tobbbie        Added log of status even if % has not changed if MaxLogWait has passed and if Battery % is 
    #                below a given limit of LogForcePercent. This is needed as the last % (e.g. from 1 to 0) may 
    #                take a long time (seen as 1h on an Asus P565) and the 0% will not be written because the 
    #                device just switches off when 0% is reached. There is no chance for the script to write the 
    #                last data to file in such case.
    #                added a delta-% column to easily detect non linear decrements
    # 20100425    tobbbie        added Registry Read for BattClock BatteryVoltage, rearranged sequence of items
    # 20100313    tobbbie        added evaluation of \HKLM\System\State\Battery "main" to logging
    # 20100313    tobbbie        added identification of device via HKLM\Ident and IMEI in headerline
    # 20100312    tobbbie        made dword registry data to be logged as "0" if no data retrieved
    # 20100302    tobbbie        added registry read for data created by BattClock
    # 20100205    tobbbie        added self-adjusting sleeptime (InitSleepTime to MaxSleepTime in ms)
    # 20100201    tobbbie        initial version
    # 20100128    tobbbie        draft versions, proof of concept
    1
    You can re-use any of the supplied charts for your purpose. Basically some advanced copy/paste actions. It requires some Excel know how to get useful charts and align the scales so it works. As the tilt2 seems to have a full scale of %, use the KS20 as your template if you want. I have quickly put something together - yet not as fancy as the supplied charts.
    1
    This battery has only ~15% capacity left even if fully charged. Another effect of this lost capacity is that the inner resistance of the battery has grown and so any higher current drain (like for activating radio or wifi) will drop the voltage below the shut-off level. A good battery should last with the testing conditions given about 8 hours (3600*8 seconds) on the Vox.
    It may be hard to get a good replacement as even new (unused) Li-Ion batteries die after a few years after production date - simply because Li-Ion chemistry is not stable in that regard.