(Step by step) How to work out battery efficiency - General Topics

Do u know how battery efficient ur smartphone is?
How is the battery efficiency of kernel X compared to that of kernel Y?
Is there an objective way to work out battery efficiency (ie. other than appealing to ur subjective impression)?
Below is my tentative solution to the above questions
Requirement:
1. You need to be able to bootup into recovery mode where u can wipe the battery stat (e.g. CWM Recovery can do that. In most cases, u need a rooted phone to obtain CWM Recovery);
2. You need to be able to take screen shots;
3. CPU Spy (by storm717, free from Google Play. Disclaimer: this author doesn't have any affiliation with the app or its creator )
4. Know the total capacity (in mAH) of ur battery (can be read from the face or the back of ur battery)
Procedure
Step 1. Calibrate the battery level indicator of ur phone
Concerning the battery level, theoretically only two points can be certain: 100% (when the battery is fully charged) and 0% (when it is totally depleted). All in the middle are extrapolations based on either the 100% or the 0% point.
Practically, the 100% point is the only point against which the battery indicator can be accurately calibrated. Below is the how:
1a. Fully charge ur phone. Switch it off when the fully charge indicator is on BUT leave the charger connected to it at this point;
1b. Half an hour later, with the charger still attached, boot up into recovery mode;
1c. Choose "Wipe battery stat" from the recovery menu: (for CWM Recovery) scroll to "advanced", then "Wipe battery stat", then scroll down to highlight "yes, wipe battery stat". When it is highlighted, WAIT FOR 1 MORE MINUTE before u press the Home button to activate it (the wait will make extra sure ur battery level is truly, totally, and absolutely 100% )
1d. When that extra 1 minute is over, press the Home button to activate "yes, wipe the battery stat" --- now, the battery level indicator is accurately calibrated to 100%. (U now can see why u can never totally accurately calibrate against the 0% point: as soon as u reach the true 0%, ur phone is out and u can't reset the battery level indicator to zero when ur phone is out. That's why )
Step 2. Monitor ur battery consumption
2a. With Step 1 completed, reboot ur phone;
2b. From this time on, DO NOT ATTACH UR PHONE TO UR PC VIA USB OR SWITCH OFF OR REBOOT UR PHONE until the whole monitoring process is over;
2c. U may then use the phone any way u wish (with exception 2b above applied), but from time to time (say for every 4 or 6 hours), run CPU Spy and take a screen shot of the results it obtains each time (see for e.g. the pictures attached);
2d. The monitoring should continue until the battery level is around 10%
Step 3. Calculate the rate of battery consumption
After Step 2, u will have multiple screen shots showing ur battery consumption at various levels of battery discharge. U may use the data obtained to calculate the rate of consumption of ur device. Below is how:
3a. Take my own consumption (battery: 2,500 mAH stock battery, phone: Samsung Galaxy Note) as an example --- see Fig 1 attached.
When the battery level is 74%, the CPU stats are as followed:
Deep Sleep: 15h 22m 55s, 90%
200Mhz: 1h 13m 21s, 7%
etc.
Understandably, the rate of battery consumption is different at different CPU frequencies. So, we will calculate the respective rates one by one (when the data obtained permit so).
3b. To calculate the rate of consumption (in mA/sec), when the phone is in Deep Sleep, C(Deep Sleep):
Amount of battery used = 2,500 mA * (100 - 74)% * 90% = 585 mA
= C(DS)*(15*60 *60 + 22*60 +55)sec
Thus, C(DS) = 0.0106 mA/sec ---------------------------------------(1a)
Similarly for C(200Mhz) (rate of battery consumption when CPU is at 200Mhz)
C(200Mhz) = 0.0103 mA/sec ----------------------------------------(2a)
In theory, we can similarly calculate the rates C(500Mhz), C(800Mhz), etc. However, becoz the consumption % for those frequencies are below 1 and CPU Spy rounds all decimals to the nearest digit, so in practice the figures obtained cannot be used.
3C. Now, let's look at Fig 2, when the battery level is at 47%. The data obtained are:
Deep Sleep: 19h 29m 27s, 81%
200Mhz : 3h 15m 1s, 13%
etc.
Thus, C(DS) = 0.0153 mA/sec ----------------------------------------(1b)
C(200Mhz) = 0.0147 mA/sec -----------------------------------(2b)
Hence in my case (Samsung Galaxy Note, GB 2.3.6, Kingdroid v5.4 ROM, Speedmod K1-5 kernel, 2,500 mAH stock battery) the rate of battery consumption is around 0.011 to 0.015 mA/sec.
Limitations
1. The results obtained from the above method to calculate rates of battery consumption is system-dependent, meaning that meaningfully comparison between results can only be made for the same combination of phone + battery (system). Say u obtain C(Deep Sleep) for certain phone, OS, ROM, kernel is, for instance, Z mA/sec, this doesn't mean that for the phone model having the same OS, ROM, kernel, C(Deep Sleep) must be Z, becoz even for the same models the hardwares may be different and the battery may also be a bit different (different batches may behave slightly differently; and more importantly, the AGE of a battery can have significant effect on its performance, so batteries of the same model and the same batch may perform different owing to their different age). Nonetheless, u may make meaningful comparison when u compare results obtained for different OS's, ROM's, or kernels u install to ur system (phone + battery).
2. The rate of battery consumption with CPU at higher frequencies may not be derivable owing to the rounding of figures by CPU Spy.
******************************
Pls click "Thanks" if u find this makes good sense

reserved for possible future use.

Interesting post!
What do you say if I only charge my phone to full, use Battery Calibration, reboot the phone. Will the phone still be 100% charged? Also, I think randomly using your phone between a certain range of battery levels, say 100-10%, doesn't really guarantee exact data for calculations. Maybe a stress-testing app will do a better job. Have you tested My Battery Drain Analyser and compared your results to its reading?
Please correct any technical fact if needed!

Your info is interesting but you may post it on the battery thread already is placed in general

Related

Raphael's battery performance

Hi,
I have a GSM version of Raphael.
Since day one I've had quite short battery life of the phone - something between 24 to 36 hours (including standby and very moderate use).
In an attempt to find out the reason, I've installed a few programs which monitor the phone's current consumption, battery voltage etc.
Making long story short - all programs indicate that the phone's current consumption is ~56-60mA in standby mode. Thus, 1350mAh battery should last for 1350/60 = 24h.
That far everything makes sense. However, I've looked for methods to reduce the current consumption, either by downclocking the CPU, by turning off all radios, removing all skins and programs running in normal mode etc.
No luck - the current consumption just won't move.
It doesn't make much sense that turning off all radios, turning off the screen, turning off all programs etc. won't reduce the power consumption by even a fraction (depending on the SW/HW metering ability, of course).
Another strange behavior of the battery is that the battery indicator does not change for quite some time, and then drops by 3-4% in a very short time (~1 minute). I've seen this phenomenon in several monitoring programs, regardless of the updating time of the program.
Has anyone figured a way to reduce power consumption in standby mode?
What about downclocking?
Does anyone know what is the current consumption on other longer lasting battery time HTC phones?
Yuval.
disabling 3G normally saves battery.
did you make tests while in 3G or 2G?
I would like my battery to last longer.
FYI- I dont need a monitoring program to tell me that wifi, data, and bluetooth visibility kill my battery...
Battery test conditions
Note that the 56mA current consumption is with all radios closed!! (alternatively only with 2G GSM on - no 3G, no WiFi and no BT).
The point is to reduce the amount of current drawn from the battery in standby mode.
yuvalm said:
Hi,
I have a GSM version of Raphael.
Since day one I've had quite short battery life of the phone - something between 24 to 36 hours (including standby and very moderate use).
In an attempt to find out the reason, I've installed a few programs which monitor the phone's current consumption, battery voltage etc.
Making long story short - all programs indicate that the phone's current consumption is ~56-60mA in standby mode. Thus, 1350mAh battery should last for 1350/60 = 24h.
That far everything makes sense. However, I've looked for methods to reduce the current consumption, either by downclocking the CPU, by turning off all radios, removing all skins and programs running in normal mode etc.
No luck - the current consumption just won't move.
It doesn't make much sense that turning off all radios, turning off the screen, turning off all programs etc. won't reduce the power consumption by even a fraction (depending on the SW/HW metering ability, of course).
Another strange behavior of the battery is that the battery indicator does not change for quite some time, and then drops by 3-4% in a very short time (~1 minute). I've seen this phenomenon in several monitoring programs, regardless of the updating time of the program.
Has anyone figured a way to reduce power consumption in standby mode?
What about downclocking?
Does anyone know what is the current consumption on other longer lasting battery time HTC phones?
Yuval.
Click to expand...
Click to collapse
Do you have the nuePower battery driver? I've heard that its not very accurate.
It's weird that you are looking for a way to extend the battery life as it is clearly stated that the battery lasts for about up to 419 minutes of talk time (about 7 hours). So, no matter what you do, that is the maximum. Please note that the 7 hours does not included standby time. Regarding standby mode, no use to play around with it as if you put your device in standby mode, it will last 367 hours. Of course, without even waking it up even for a moment (after a full recharge).
Running battery monitoring program normally makes thing worse as some do not allow the device to truely enter standby mode. Also, note that some 3rd party applications also cause that, for example S2U2 (version 1.40 seems to fix the problem). Plugging in the earphone (via the usb port) also does not let the device to truely enter standby mode. The easiest way to test is to play some music and press the power button. If the screen turns off and the music stops, then it is in standby mode. If not, then the device is does not truely enter standby mode, and it consumes power (but lesser than when it is awakes).
In other words, no matter what you do, the battery lasts 7 hours of usage. So, the only way to extend the battery life to is purchase an extended battery (1800mAH) for Touch Pro. It will make your device thicker though.
When all the lab/field tests are done, one of the tests is to measure voltage drop with a Scopemeter/power analyzer. All we did was put the STOCK device in standby, took the back cover off and measured voltage draw with a Scopemeter/power analyzer . That would be the most accurate means of testing. The Scopemeter I use is a fluke 225c. With a Fluke 43b power quality recorder. the max over a 36hr period in standby was a 24.9mh draw. the lowest recorded was 12.1mh draw. The average was 19.3mh. You could also do this with a basic DMM.
I should also note this was done with ALL radios off.
ramborami said:
Do you have the nuePower battery driver? I've heard that its not very accurate.
Click to expand...
Click to collapse
How would I find out which battery driver I have and also what alternatives are available?

how to compare a power consumption of your devices

So, for a long time reading the forum and asking a question along the way, why I have so quickly battery discharging on my phone, I came across an interesting thought: "and from what I actually compare?. someone wrote about 5% per night, someone love to confess on the tab "Journal of the battery and it shows that he is the difference between" running "and"phone on "0.5%. but what is a night (for me it's 8 hours for someone 5). which network who have (GSM or 3G)? Also, we are constantly being developed and modified ROMs and kernels, which also constantly featured the words "lowered energy consumption."
And how do you actually compared the energy consumption of the old firmware to new. usually it sounds like "on the old firmware, I charge the phone every day, and now I charge every 2 days." but we don’t know details of how actively you used options of your phone on the old version, and how use now "(for me, For example the first 3 weeks after buying the phone had lived only one days, but now 2-3 days. but not because the new firmware, but because I'm tired of constantly digging through the phone settings and install the different soft, thus discharging it).
So, our challenge is to develop an algorithm (and in the future opportunities programs), as can be correctly and objectively compare the power consumption of our devices. That at least from the transition to the firmware to the firmware, from one kernels to another to be sure that the phone will not live less than before. Search for programs of this kind I have not been successful, can someone tell me if he knows?
actually look to you for ideas, how best to develop an algorithm testing the phone, and simultaneously bring your own.
then everything will be set out with respect to the software part, because hardware is not subject to us
1. So, first of all we need to start with any initial data. Having read all the threads about power consumption, I have come to the conclusion that the original data should include the following:
- Do wipe battery stat. We fully discharge the phone till shutdown and charge it in off state. after the device is fully charged, unplug it from the charging device and do wipe batter stat from the recovery menu
- To make the calibration of the battery you need to discharge and completely charge in turned off state the device at least 3 times
Here is one of the toughest parts, considering the long battery charging our phones. charging off-state means 4 hours of losing connection. and we need to do it 4 times. One discharge-charge cycle for a complete calibration system, as I understood , is not enough.
all the widgets and programs that can perform any action to in background must be disabled.
well, and then discharges our apparatus up to 95% in quiet mode, to give the battery a little bit cool, and eliminate trouble with 99-98-97% and you can begin testing.
2. Measurement tool. I would have chosen for this purpose, program or Battery Monitor Widget (she effects on discharging battery, but it writes logs, which can be tracked over time the battery status in percentage and millivolts) or JuicePlotter (don’t have logs. We have to extract data from the graphs that it constructs). JuicePlotter showed the best result in power consumption while the CPU time drain more than BatteryMonitorWidget - here's the first interesting fact. Now I’m testing these programs repeatedly to confirm this effect
3. In order to reduce measurement error the device must be discharged at least 20% of one test. or better at 30%. then + / -1% in the testing will not be particularly significant. That why testing process will be long and tedious.
4. In order to understand the power consumption of device in general, you should at least try to understand and share the power consumption of its individual components:
5. power consumption of the screen. For this purpose you can use the widget to extend controls, where you can turn the screen on constantly. And choose any standard wallpaper with middle brightness. we need to measure how much battery discharging for 3 hours the screen on. for small, medium and very high brightness, respectively. you can check consumption on the automatic brightness too. is believed that the turning on an automatic brightness strongly discharge the device..
6. power consumption of the file system. In the good we ought to write a program that creates a file in a loop on the internal flash drive, and anything he writes and deletes the file. Repeat the loop few thousand times to the total time was about 2-3 hours. but until there is no such a program, you can simply copy the file size of 2-3 gigabytes of internal memory with a program such as ES Explorer. In this case, the screen must be enabled to minimum brightness (since we already know how much the phone is discharged from simply turn on the screen) to control the copy process and accordingly the percentage of discharge.
7. Estimation of consumption of the processor. To do this, too, we can write a program that would do any arithmetic operations within an hour of time. But here we get the maximum load, therefore the maximum power of the processor. and it is unlikely it will be different from the firmware to the firmware . But our processor is also able to reduce the frequency and consequently reduce power consumption. And here I think there is much to improve the software. Therefore, must be differences from firmware to firmware. And the best test for this, I think, show any video on device, it loads processor to 30% on average (better view a videoconcert, so there isn’t quite boring) for one hour and thus measure how much discharge our batteries from this view .
8. Estimation of Wi-fi. Then the test can serve up any file copy from PC (connected through wires to an access point, so this segment was not the brakes) to our unit. Since the maximum speed that I managed to squeeze out of the standard N on my Captivate is 0,8 MB / sec I think copying the file size of 2GB will be enough to discharge our device is not less than 20% battery. copy can be perform using the same ES Explorer
9. Rated power consumption in standby mode. here it must enable the network only GSM. turn off the wi-fi and bluetooth. the screen went off and did not touch the machine for 8 hours. Better course would be 24 hours, but I think hardly anyone will be able to perform such a test
Actually look to you for your suggestions and additions, as can be realized by comparing energy consumption of our devices.
from the general collective thoughts we can open thread with algorithm, where you can write your test results according to the algorithm ... and make any conclusions.

[Howto]Tips n tricks for better battery life

Since we have better battery life on Android r169 version thanks to our devs i'm going to post tips n tricks for a even better battery life
1. Use "GSM auto (PRL) to save more juice while still connecting through 3G
- in the phone setting>wireless and network>MobileNetwork>NetworkMode
we are only allow to choose GSM only/ WCDMA / Auto between two
- but if you use type "*#*#4636#*#*" to phone Information, you can choose more type of networkmode. It is claimed that choose "GSM auto (PRL)" allow you to save more battery (cell standby) while allow you to connect to 3G network.
-there is one more setting which you can change:click settings(windows logo)>select radio band and change it according to your needs
- Please provide feedback on this. Thanks
2. Use AutoKiller Memory Optimizer
- This tool is different from other app killer
- It fine tunes android systems inner memory manager to keep your device fast over time.
- As a side effect it also lowers battery consumption.
- At certain free memory level (e.g. 250mb), the android os will automatically close those apps not in use (according to original android os logic)
3.Use Autostart
- Instead of closing them, it would be better if we don't let the app start from the begining
- You can choose to disable those app that u feel unnessary, so that they will not run during your phone startup
4. Check your Battery Consumption
- Download "Current Widget" or "battery monitoring widget" from market
- these apps will monitor your battery usage and recoded in a log file
- This is the normal consumption rate (varied across ROM, kernel and CPUI frequency and other factors)
credits:XDA
to be continued....
Tips
General Lithium-Ion Battery (LIB) Usage:
• Discharging your LIB fully (or less than 2.4 Volt per cell) is bad for the battery. Every time you do that, it can be said that small part of your battery (some cells) dies (they forever lose their charge). Do not store your batteries depleted, there's a high chance they will die completely or will become very "weak".
• You cannot restore bad LIBs by overloading/heating/praying. You gotta go buy a new one. They DO degrade overtime, some cells naturally lose the ability to gain/give electricity.
• Although it is said that LIBs do not have memory, it's not entirely true. LIBs have gauges that monitor performance of cells, and if you do a lot of small charges, it won't let those gauges to monitor a full battery potential, causing an invalid indication of charge level. A complete charge/discharge should be made when battery capacity seems reduced, that will calibrate gauges and they will provide your phone with correct charge level status. A full charge/discharge cycle should be done every 30 (or so) partial charges.
• LIBs have a shelf-life. Do not buy them to store them. Use them early, use them often, they will die whether you use them or not. Do not buy LIBs to use them in 6 months/year/etc, buy them right before actually using them.
• LIBs have short lives (in comparison to NiCa batteries, etc). You should expect to buy a new battery in 2-3 years after being manufactured. It is caused by internal oxidation and there's nothing you can do to stop or prevent that.
• Worst LIB treatment is to keep it at 100% charge level at high temperature (think laptop/phone under direct sunlight, like car dashboard).
• Best LIB treatment, or LIBs "favorite" charge level - 40%. That's also the usual charge level you buy them with.
• LIBs don't like heat. For example, while always at 100%, typical LIB in a laptop, at temperatures of 25C (77F) will lose 20% (twenty percent!) of full capacity per year. That capacity loss is reduced to 6% (six percent) at 0C (32F), and increased to 35% loss at 40C (104F). So, keep them cool (LIBs like fridges), don't let your devices sit in the sun or overheat at charge. Also, keep in mind that while in use, battery will be significantly hotter than phone/outside environment.
• LIBs like frequent partial charges/discharges more than they like full charges/discharges.
General Android power usage advice from google:
• Although this part is somewhat controversial, they do recommend having a complete, full FIRST charge to be made. If time allows, a preferred time for the first charge is 12 hours. This may have more to do with the OS than the battery.
• Battery on a Android device, in average, will last about a full day with normal use (some videos, mail, calls). That's what you should kind-of expect.
• Speaking in averages, "idling" 3G/EDGE connection (when phone is sleeping and no data is transferred through 3G), drains almost no energy. Just a little more than having 3G/EDGE radio off completely. So when no apps are using 3G, you don't need to keep it off.
• Same goes to WiFi connection - although it's on, if there is no data flowing through it, it uses almost no energy.
• At full throughput (100% data flow), EDGE is using more energy than 3G. In average, 3G is more energy-efficient than EDGE.
• WiFi is using more energy than 3G (when both are at 100% use), but since it transfers files much faster and then goes to "sleep", it's actually recommended to use WiFi whenever possible. Since it'll "sleep" more often than 3G, overall it will use much less battery than using 3G.
• Some bad apps or widgets can use android's "WakeLock", keeping CPU at 100%, screen always-on, or both. I myself have encountered such widget (I won't mention the name, it's in the market) that used a WakeLock to keep CPU spun-up at 100% all the time. That makes a huge impact on battery life. My advice - use a CPU profiling app to monitor the CPU - make sure that CPU slows down by itself when it's not used. So, beware of such widgets/apps. To check for CPU cycles, many recommend OSMonitor (free from market, install it, go to options, sort by "Load" in descending order. It'll give you "busiest" processes at the top). At rest you should be getting about 10-20% for OSMonitor itself, and 1-10% Android System. At rest, everything else should be 0-1%.
• Android slows down CPU when not in use by itself, as a built-in feature. Apps that throttle/change CPU frequency, are not necessarily needed.
Sources:
Wikipedia - http://en.wikipedia.org/wiki/Lithium-ion_battery
BatteryUniversity - http://www.batteryuniversity.com/parttwo-34.htm
Google IO Conference 2009 - http://www.youtube.com/watch?v=OUemfrKe65c
Electropaedia - http://www.mpoweruk.com/life.htm
this one too
this is very useful information, thx a lot!
Sorry Tzacapaca, but I do not understand where I have to type the code in order to have access to other network modes
Could you clarify?
THX
doublej4473 said:
Sorry Tzacapaca, but I do not understand where I have to type the code in order to have access to other network modes
Could you clarify?
THX
Click to expand...
Click to collapse
Call this number with the phone dialer
Very good summary, thanks
I will definitely come back to read again and try in this way extend battery life.
Thnx, great tips to read !
Standard battery Capacity: 1200 mAh
HTC HD Mini have a standard battery Capacity: 1200 mAh.
When the battery loses capacity and you want to replace it, consider that there are batteries in the market for the HTC HD Mini with 1700 mAh Capacity, which would be logical to give a day or two extra pleasure
15MA1L said:
HTC HD Mini have a standard battery Capacity: 1200 mAh.
When the battery loses capacity and you want to replace it, consider that there are batteries in the market for the HTC HD Mini with 1700 mAh Capacity, which would be logical to give a day or two extra pleasure
Click to expand...
Click to collapse
I still like and need my phone so I wouldn't trust those batteries
I would better get an emergency recharge which can charge my phone on the go
Edit: here is one http://www.phonesuit.com/primo-cube-battery-pack-for-android-phones/
hi how do i send a log to show my battery level? its draining way to fast,temperature is 38.8 is that normal?
with the battery moniter widget temperature is fluctuating from 35.5 to 38,stabilising to just over 35.0,also says 190mA in top left for battery indicater
BATFINK74 said:
hi how do i send a log to show my battery level? its draining way to fast,temperature is 38.8 is that normal?
with the battery moniter widget temperature is fluctuating from 35.5 to 38,stabilising to just over 35.0,also says 190mA in top left for battery indicater
Click to expand...
Click to collapse
download current widget and enable log file,right now i have 32.5 C on 100% battery level
tzacapaca said:
download current widget and enable log file,right now i have 32.5 C on 100% battery level
Click to expand...
Click to collapse
thanks dude,can i post log file results here?
BATFINK74 said:
thanks dude,can i post log file results here?
Click to expand...
Click to collapse
sure
...
battery history
hi heres my battery history,is there any clue in here as to why its draining so fast?
also upload current widget log
BATFINK74 said:
hi heres my battery history,is there any clue in here as to why its draining so fast?
also upload current widget log
Click to expand...
Click to collapse
hi,tell me around when phone was in standby so i can figure out
anyway so far it looks bad :O
also i have some Q's :
do you have set brightness on auto in Android or on WM?
is it a fresh install of Android?
did you install apps after that?if yes,which?
do you have GPS on on droid or on wm?
With "CurrentWidget" you can also log applications which are running on background. Then it should be easier to find out cause of battery drain. Also don't forget to write about your current settings ...
tzacapaca said:
hi,tell me around when phone was in standby so i can figure out
anyway so far it looks bad :O
also i have some Q's :
do you have set brightness on auto in Android or on WM?
is it a fresh install of Android?
did you install apps after that?if yes,which?
do you have GPS on on droid or on wm?
Click to expand...
Click to collapse
hi thanks for replying
i have brightness turned down in android,havent touched in winmo
yes its a fresh install
iv installed angry birds rio,a 3d game,zedge,ebay and sky sports apps from market place
gprs is always on in both
my device is currently in sleep mode,will upload a fresh log to show results for sleep mode
For the nexus s 4G , just put brightness on low and turn of background data
Sent from my Nexus S 4G using XDA App

[Q] An App, that control charging process for enlarge battery lifespan?

Hey
First, please read this article:
http://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries
TL DR
A Li-Io or Li-Po battery charging cycle like charged to 100%, discharge to 15% and repeat, will have only 300-500 charge/discharge cycles battery lifespan, while a battery charging cycle like charged to 75%, then discharge to 25% and repeat, will get 1,500-2,500 charge/discharge cycles battery lifespan.
I have Samsung laptop, that have application (Samsung Easy Settings), that control charging process. When "BATTERY LIFE EXTENDER" is checked, then charging stops at 80% and will not get higher, and when laptop is constantly connected to wall, then app will let drop battery level 75%, then recharge to 80% again.
I'm using this laptop over 3 years and battery last over 5 hours (time on battery is shorter about 10-15min from "brand-new" state)
So, I'm looking for an android app (for rooted devices), that will stop charging at user predefined level (for example 80%), and cause alert/notification (on discharge), when battery level dropped below user predefined level (for example 25%) - to save battery lifespan.
PS: There is a trend, the newer, high-end devices have built-in batteries, without possibility to replacable (solid smarphone body, hard to open without damage), so that app could make device live longer
PS2: I read about charge control by "/sys/class/power_supply/battery/charging_enabled", but this doesn't exist in my ROM (crDroid, CM13 based on i9505)
PS3: The tasker helped me to "detect" charging over 80% (profile AC is ON and Battery level is over 79% -> task "say bla bla bla disconnect Your phone from wall"), but this is only "workaround" and doesn't work at night (You have to wake up and disconnect phone from wall)
Unfortunately this is a Question. This forum is only used to post actual apps.
You have already posted in right place so closing this.

[Guide]Using the Advanced Charging Controller (ACC) Magisk Module with Pixel 3a XL

While I've had many Android phones, this is the first phone that I decided to use a battery charging controller to regulate how my battery is charged. I just wanted to share my journey with others and encourage others to try this out if you are not already.
Although there are several different battery charging controllers out there (and more than one named "ACC" which makes it even more confusing) I decided to use the Advanced Charging Controller module developed by VR25. I choose this module because I felt it provided the most customization.
Step 1 - Installation
Installing the module is easy. It is listed in the Magisk repository. Simply browse the available modules and find the one titled, "Advanced Charging Controller (acc) created by VR25 @ XDA-developers". There are several ACC modules, so make sure you install the one by VR25 to follow this thread.
Magisk will flash the module and start it automatically. You don't even need to reboot, although it is the only way to clear the Magisk notification that the module will be started at the next reboot.
Step 2 - Changing the Charging Switch Setting
I found that the default charging switch setting (auto) does not work reliably with our phones. Therefore I would suggest changing it using the commands below. Personally I have choose option 2 (battery/charge_disable 0 1) but I listed all the options with the quirks that I have found with each one.
Step 2.1 - open your preferred command line app - I use Terminal Emulator.
Step 2.2 - type "su" and hit enter to gain root
Step 2.3 - type "acc -s s" and hit enter - this is the command that allows us to select another charging switch
Step 2.4 - type what number of the charging switch you want to use.
Here are the available charging switches and the issues I have found with them:
1) Automatic - this switch tries to cycle through the available switches until if find one that "works".
- Passes the ACC switch test (type "acc -t"): Yes
- Charges and discharges according to the cooldownratio: No - I found that the phone would charge anytime it was plugged in and below the Pause threshold. It did not seem to wait until the battery level was below the Resume threshold.
- Works with battery idle mode (the phone will pull power from the AC power and not the battery when the battery reaches the Pause threshold): Yes
- Begins charging when phone reaches Resume threshold: Yes
- Charging "chime" and battery icons correctly reflect if the phone is charging or discharging: ???
- Suffers from wakelock issues when phone is plugged in but not charging: It does have a "overheat_mitigation" wakelock when on the battery idle mode, but because the phone is not using the battery power, it doesn't effect battery life and therefore I don't concern myself with this issue.
- Other issues:​
2) battery/charge_disable 0 1 :
- Passes the ACC switch test (type "acc -t"): Yes
- Charges and discharges according to the cooldownratio: Yes
- Works with battery idle mode (the phone will pull power from the AC power and not the battery when the battery reaches the Pause threshold): Yes
- Begins charging when phone reaches Resume threshold: Yes
- Charging "chime" and battery icons correctly reflect if the phone is charging or discharging: ???
- Suffers from wakelock issues when phone is plugged in but not charging: It does have a "overheat_mitigation" wakelock when on the battery idle mode, but because the phone is not using the battery power, it doesn't effect battery life and therefore I don't concern myself with this issue.
- Other issues:​3) battery/input_suspend 0 1:
- Passes the ACC switch test (type "acc -t"): Yes
- Charges and discharges according to the cooldownratio: Yes
- Works with battery idle mode (the phone will pull power from the AC power and not the battery when the battery reaches the Pause threshold): No - phone begins discharging from battery when Pause threshold is reached but the phone is still plugged in
- Begins charging when phone reaches Resume threshold: Yes
- Charging "chime" and battery icons correctly reflect if the phone is charging or discharging: No - may show charging icon when phone is really discharging, especially during cooldownratio times and the chime doesn't always ring when charging resumes.
- Suffers from wakelock issues when phone is plugged in but not charging: No
- Other issues: The phone seems to follow the cooldown charge/discharge times even before reaching the cooldown threshold. I find the phone pausing for 10 seconds (my cool down ratio) when the batter level might be a 50% - long before the 60% cooldown threshold I have set in the config file.​4) dc/input_suspend 0 1:
- Passes the ACC switch test (type "acc -t"): NO, so this switch doesn't work with ACC
- Charges and discharges according to the cooldownratio:
- Starts discharging when the phone reaches the Pause threshold:
- Begins charging when phone reaches Resume threshold:
- Charging "chime" and battery icons correctly reflect if the phone is charging or discharging:
- Suffers from wakelock issues when phone is plugged in but not charging:
- Other issues:​5) battery/charge_control_limit 0 1:
- Passes the ACC switch test (type "acc -t"): NO, so this switch doesn't work with ACC
- Charges and discharges according to the cooldownratio:
- Starts discharging when the phone reaches the Pause threshold:
- Begins charging when phone reaches Resume threshold:
- Charging "chime" and battery icons correctly reflect if the phone is charging or discharging:
- Suffers from wakelock issues when phone is plugged in but not charging:
- Other issues:​
Step 3 - Configuration
You can configure the ACC controller using a couple of different methods. You can do everything using command lines, you can use the beta ACC app (see note below), or you can edit a config file that ACC creates when it is installed. Personally I found that editing the config file was the quickest and easiest method to make general changes.
The ACC config file is found at /storage/emulated/0/acc The file is named "config.txt" You can open the file with a text editor. I personally use the app Root Explorer. I long click on the file name, and then press the three dot button in the upper right hand corner. Choose "Open in Text Editor" and the config file will open and allow changes to be made. Saving the file will automatically push the changes to ACC, you do not need to reboot or restart the ACC daemon for changes to take effect.
I won't go into a lot of detail about all of the different configuration options here as the developer's xda thread is the best place to get that type of information. But I will talk about the most basic setting - the "capacity" setting. It is the second setting listed in the config file and it should look something like "capacity=0, 60, 70-80". Here is a break down of what those numbers mean:
- The First Number (0): is battery level were the phone will shut off. The default setting of 0 means the phone will turn off when the battery level hits 0. Personally I don't want my battery completely draining, so I have it set at 5.
- The Second Number (60): is the battery level where the module starts it's "cool down" functionality. Cool down (listed as coolDownRatio in the config file) is where the phone will stop charging briefly and then restart charging. The default "cool down" setting is coolDownRatio=50/10 which means the phone will charge for 50 seconds, and then stop charging for 10 seconds before charging again for 50 seconds, etc, etc, etc. This is designed to keep the battery temps low. A battery with a charge level less than this number (60 in this example) will charge without pausing, but when the battery level gets to this number or above, the phone will charge and pause based on the coolDownRatio.
- The Third Number (70): is the "resume" value. If the phone's battery level is below this resume value, the phone will charge. If the battery level is at or above this resume value, the phone will not charge even while plugged in.
- The Fourth Number (80): is the "pause" value. This is the battery level where the phone will stop charging and should not charge above this value.​
The default settings are set this way because research has shown that a phone's battery will last the longest with the least amount of battery capacity loss if it is charged to a max of 80% of the battery's capacity, and allowed to discharge just a small amount (10%) before being charged again. I realize this goes against the old "wives tale" that our phone's batteries have a very limited number of charges and it is best to limit the number of charges by only charging the phone when it gets to a low level. This is not true in actual battery performance however and if you charge like this, you are actually decreasing your battery's life expectancy and performance.
Obviously the default settings may not be the best setting for you. The default settings are probably only practical for a device that is plugged in 100% of the time. Personally I have changed my capacity setting to capacity=5, 60, 70-90. This means my phone will turn off when the battery level reaches 5% (something it has never dropped to yet), it is charged to a max of 90% and will discharge to 70% before charging again, and the cooldown charging cycling starts when the battery is 60% or higher. Obviously I'm not on my charger all the time, so it is very common for my battery to drop below 70%. However, if the battery is below 70% and I have a charger at my disposal, I am going to charge the phone back to 90% rather than let it the battery levels continue to fall.
Final Notes and Misc Thoughts
There are lots of other options and commands you can use in ACC. Feel free to share any changes you like to make, or post if you are having problems getting the module to work as expected on the 3a. I hope this helps some people feel give the module a try.
There is an ACC app that is available now that allows you to control some of the settings from a nice GUI. I personally did not like using it as I found it would overwrite settings in the config file that I was not intending to be changed.
There is an ACC telegram group if you want to join and have direct communication with the developer and others.
Thanks to @jellopuddingstick for educating me on what the battery idle mode does and why it is beneficial to have it working!
sic0048 said:
I just wanted to share my journey with others and encourage others to try this out if you are not already.
Click to expand...
Click to collapse
Was doing the same research when this popped up -- great job!
Can you discuss more on what unintended settings were overwritten by the app....
Also, thoughts have seem to have standardized now to lop off 40% of usuable capacity by having the battery charge btw 20-80% to extend life, such as... "capacity=20, 60, 70-80".
How were the defaults for ACC set and why have you chosen otherwise?
duh1 said:
Was doing the same research when this popped up -- great job!
Can you discuss more on what unintended settings were overwritten by the app....
Also, thoughts have seem to have standardized now to lop off 40% of usuable capacity by having the battery charge btw 20-80% to extend life, such as... "capacity=20, 60, 70-80".
How were the defaults for ACC set and why have you chosen otherwise?
Click to expand...
Click to collapse
The app works by writing to the normal config file. But it also has three profiles loaded into memory automatically when you install it. This makes it very easy to press on one of the other profiles by accident and totally change your settings. I eventually deleted all the "extra" profiles, but the charging switch isn't changeable via the app either (it seems like it defaults to auto) so the app will overwrite that setting back to auto if you aren't paying attention.
In the long run I found that using the config file was extremely easy and I found myself having the check the config file anytime I used the app to make sure it wasn't changing unintended settings, so I decided to remove the app and just use the config file.
As far as capacity, I decided to run 5, 60, 70-90. I think it is a good compromise between having a decent amount of capacity available and also not charging the phone to 100% all the time. I could probably get away with a limit of 80 or 85, but ultimately decided on 90. I do try to charge my phone when it hits 70 or below if I have a charger available vs waiting to do a larger/longer single charge.
sic0048 said:
I do try to charge my phone when it hits 70 or below if I have a charger available vs waiting to do a larger/longer single charge.
Click to expand...
Click to collapse
Don't you think 70 is too high to begin charging just to bring it back to 90. Doesn't number of charge cycles kill battery life as much as heat and fast rate charging?
Any good apps you like that intuitively monitor battery health, besides just stats and charts, that does it like apple, as a percent of remaining chargeable capacity?
Btw OT question, looking to move over my wifi connections from the previous phone and can't find the wpa_supplicant.conf file in /data/misc/wifi in the 3a. No reference online mentions that it's been moved. Any idea where they're hiding it now? Thx...
duh1 said:
Don't you think 70 is too high to begin charging just to bring it back to 90. Doesn't number of charge cycles kill battery life as much as heat and fast rate charging?
Click to expand...
Click to collapse
According to this research (https://batteryuniversity.com/index.php/learn/article/how_to_prolong_lithium_based_batteries/), the more your battery discharges, the fewer discharge cycles it will survive before really negatively effecting battery performance. So discharging your phone just 10% might give you 6000 discharge cycles, while discharging your phone 60% might reduce these discharge cycles by 90%.
Obviously I have to rely on other people's research as there is no way I can adequately test this myself. But I do trust this research as accurate. I know with other phones I've had where I did not try to control the charging system I have had to replace the batteries with pretty regular occurrence. But I would leave the phone on the charger overnight (not a good thing for battery life) and try to discharge the battery a lot before charging it back again (also not a good thing for battery life). That's why I decided to finally look into using a charging controller like ACC with this new phone.
duh1 said:
Any good apps you like that intuitively monitor battery health, besides just stats and charts, that does it like apple, as a percent of remaining chargeable capacity?
Click to expand...
Click to collapse
I've been using the ExperimentalX helper app to track battery usage. (You don't need to use their kernel to use the helper app). I like it because it breaks the battery usage stats into two parts: when the screen is on, and when the screen is off, but it doesn't attempt to give a percent of remaining chargeable capacity. I'm not aware of an app that does that (although I too would be interested to know if such and app exists).
duh1 said:
Btw OT question, looking to move over my wifi connections from the previous phone and can't find the wpa_supplicant.conf file in /data/misc/wifi in the 3a. No reference online mentions that it's been moved. Any idea where they're hiding it now? Thx...
Click to expand...
Click to collapse
I think the info you are looking for is now stored at /data/misc/wifi/WifiConfigStore.xml.
As I use my phone more, I realize that none of the charging switches seem to work 100% of the time as expected. I'll continue to do trial and error tests, but please share if you find a switch that works consistently.
I've continued to edit my original post to provide as much information about the different charging switches and the issues I see with each one. Hopefully it is easy to understand.
I still find myself defaulting to the 3rd charging switch option and while it can act a little erratic sometimes, it does work normally most of the time.
Is it possible to disable/bypass the cool down period?
creeve4 said:
Is it possible to disable/bypass the cool down period?
Click to expand...
Click to collapse
The default setting is for it to be turned off I believe. Look in the config file for "coolDownRatio=" and see if it is blank. If it is not, you can remove everything after the equal sign.
Another way to do it is set the cooldown threshold number to be equal or higher than your "pause" threshold. So you might set this as "capacity=5, 100, 70-90". The 100 represents the value at which the cooldown process would start, which is higher than the pause threshold (at 90 in this example) and therefore would never kick in.
All this being said, I find that the #3 switch option seems to allow the cooldown pause/charge process to start below the set cooldown threshold. I have my cooldown threshold set at 60, yet find the phone pausing and charging at battery levels below this threshold. This should not be happening, but is something I can live with, so I haven't bothered to follow up with it.
After several more weeks of use, I've updated the initial post again. I found some quirks with the "automatic" charging switch, so I have gone back to selecting charging switch option 2 (battery/charge_disable 0 1).
Great job!
May I ask you whick kernel you are using for "battery idle mode" support? It should not be supported on stock kernel.
Thanks

Categories

Resources