Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
fnf
Old
(Last edited by fnf; 25th February 2012 at 07:25 PM.)
#1  
Member - OP
Thanks Meter 52
Posts: 39
Join Date: Sep 2007
Thumbs up [KERNEL][4.0.3] Limited voltage charging for battery-saving paranoid and developers

This is a stock kernel for GSM Galaxy Nexus 4.0.3 with the following properties:
  • Root access with adb (a.k.a. insecure)
  • Charger is modified to stop charging at 4000mV and > 80%, and start charging again at 3990mV or < 80%.

Rationales:
  • Stock kernel: I value compatibility and stability. While the various mods and new features are undoubtedly very useful for many people, some of them are not well tested which results in lower stability. That is not to say stock Android is extremely stable (it is not), adding new features on top of which very often increases the likelyhood of crashes.
  • Limited charging: As a developer, my phone is virtually plugged in the computer all the time. As many of you are aware, leaving the phone charged greatly reduces battery life (Ref). This kernel frees you from having to unplugging and plugging in the phone repeatedly in fear of destroying your precious battery.

Visible differences:
  • Charging percentage will not increase after the phone is charged to 80% or more.
  • The phone never reports full charge, even if it's charged while being turned off. That means battery stats can accumulate which, after a while, makes it practically useless as the diagram is too compressed. This is a plus to me as I can see how I manage the battery over time, although I can make an alternate version which reports full charge whenever the phone stops charging under requests.

Perhaps I'm the only one who is paranoid about keeping battery charge between 10-90%, I wouldn't be surprised if no one is interested it this at all.

The kernel can be flashed using Odin or fastboot. If someone wants a CWM-flashable zip let me know.

Cheers.
Attached Files
File Type: img boot.img - [Click for QR Code] (4.01 MB, 29 views)
The Following 3 Users Say Thank You to fnf For This Useful Post: [ Click to Expand ]
 
Ezekeel
Old
#2  
Ezekeel's Avatar
Recognized Developer
Thanks Meter 1656
Posts: 715
Join Date: Jun 2011
You could have simply used my BLX mod.
 
fnf
Old
#3  
Member - OP
Thanks Meter 52
Posts: 39
Join Date: Sep 2007
Quote:
Originally Posted by Ezekeel View Post
You could have simply used my BLX mod.
Glad to know I'm not the only one. When I was using the SGS2 I spent quite a bit of time looking for such mod to no avail. Searching for "android|galaxy nexus limit charging voltage" turned up lots of posts about changing kernel voltage which wasn't what I wanted.

I like to keep the kernel close to stock, but thanks anyway .
 
Guzmanus
Old
#4  
Senior Member
Thanks Meter 20
Posts: 173
Join Date: Aug 2010
Location: Alicante
Hey, an idea to you devs: what about a apk that schedules the charge limit? for example, if you use to charge your phone at night and you wake up at 7 that app could charge the phone @ 60% and at 6 start charging'till it reaches the 100%
With ezekeel BLX mod it should be easy to schedule modifying the file, but i have no idea on programming nor cron
 
fnf
Old
#5  
Member - OP
Thanks Meter 52
Posts: 39
Join Date: Sep 2007
Quote:
Originally Posted by Guzmanus View Post
Hey, an idea to you devs: what about a apk that schedules the charge limit? for example, if you use to charge your phone at night and you wake up at 7 that app could charge the phone @ 60% and at 6 start charging'till it reaches the 100%
With ezekeel BLX mod it should be easy to schedule modifying the file, but i have no idea on programming nor cron
You can do that with Tasker, it is a bit on the heavy side but saves having another service running in the background while leaves the possibility to do a lot more. I'm not aware of other light-weight but user friendly solutions for managing scripts, perhaps others could chime in.
 
sert00
Old
#6  
sert00's Avatar
Senior Member
Thanks Meter 486
Posts: 1,060
Join Date: May 2011
Location: cesena,IT
Quote:
Originally Posted by Ezekeel View Post
You could have simply used my BLX mod.
agree with ezekieel...his Battery Life eXtender (BLX)do the same thing(via file /sys/class/misc/batterylifeextender/charging_limit default 100),without give up at all the tweaks,oc,color control etc. try that if you want.anyway thanks for the work,personally it not interest me,but certainly someone will find it usefull!
My current mobile devices:
Samsung galaxy nexus maguro version 16Gb
Asus transformer WiFi-only 16Gb
Asus nexus 7 WiFi-only 16Gb
My current system embedded boards in use:
Raspberry Pi rev.B Cpu @ 920mhz max and 4Gb storage(350 mhz Gpu\450mhz Ram)
Hardkernel odroid-u2 with Exynos4412 PRIME cpu @ 2000mhz max and 64 Gb toshiba Emmc storage(533mhz Gpu\800mhz Ram)
Arduino UNO (x2)
Arduino Mega 2560 (ADK support with USBHost Shield)
 
Mikey
Old
#7  
Mikey's Avatar
Senior Moderator - Terror of the Trolls
Thanks Meter 781
Posts: 5,237
Join Date: Oct 2007
Location: Chicago

 
DONATE TO ME
Quote:
Originally Posted by fnf View Post
This is a stock kernel for GSM Galaxy Nexus 4.0.3 with the following properties:
  • Root access with adb (a.k.a. insecure)
  • Charger is modified to stop charging at 4000mAh and > 80%, and start charging again at 3990mAh or < 80%.

Rationales:
  • Stock kernel: I value compatibility and stability. While the various mods and new features are undoubtedly very useful for many people, some of them are not well tested which results in lower stability. That is not to say stock Android is extremely stable (it is not), adding new features on top of which very often increases the likelyhood of crashes.
  • Limited charging: As a developer, my phone is virtually plugged in the computer all the time. As many of you are aware, leaving the phone charged greatly reduces battery life (Ref). This kernel frees you from having to unplugging and plugging in the phone repeatedly in fear of destroying your precious battery.

Visible differences:
  • Charging percentage will not increase after the phone is charged to 80% or more.
  • The phone never reports full charge, even if it's charged while being turned off. That means battery stats can accumulate which, after a while, makes it practically useless as the diagram is too compressed. This is a plus to me as I can see how I manage the battery over time, although I can make an alternate version which reports full charge whenever the phone stops charging under requests.

Perhaps I'm the only one who is paranoid about keeping battery charge between 10-90%, I wouldn't be surprised if no one is interested it this at all.

The kernel can be flashed using Odin or fastboot. If someone wants a CWM-flashable zip let me know.

Cheers.
Source code?? It has to have a link.
Since you modified the kernel
Code:

Phone: Samsung Galaxy Nexus               Tablet: Google Nexus 7
ROM: PURITY JDQ39                         ROM: PURITY JDQ39
Kernel: AK Kernel Diamond ed.             Kernel: M-Kernel
Baseband: I925OUGLH1                      Bootloader: v4.18
Recovery: TWRP v2.4.3.0                   Recovery: TWRP v2.4.3.0
 
fnf
Old
#8  
Member - OP
Thanks Meter 52
Posts: 39
Join Date: Sep 2007
Quote:
Originally Posted by Mikey View Post
Source code?? It has to have a link.
Since you modified the kernel
Not much to speak of tbh. Here is the patch. You can build it from the stock branch 4.0.3_r1 . I changed the compilation flags so it better matches Cortex A9 but I'm sure there are rooms for performance improvements.

GLaDOS kernel has this value configurable as well so aside from being stable, this kernel is worse all around .
Attached Files
File Type: patch limit-charging-voltage.patch - [Click for QR Code] (1.9 KB, 24 views)
 
Entropy512
Old
#9  
Elite Recognized Developer
Thanks Meter 20814
Posts: 11,504
Join Date: Aug 2007
Location: Owego, NY

 
DONATE TO ME
I assume you meant 4000 mV, not 4000 mAh? Considering that not even extended batteries I've seen exceed 3500 mAh?
*so much sig updating needed*

My Github profile - Some Android stuff, some AVR stuff

An excellent post on "noobs vs. developers"

A few opinions on kernel development "good practices"

Note: I have chosen not to use XDA's "friends" feature - I will reject all incoming "friend" requests.

Code:
<MikeyMike01> Smali is a spawn of hell
<shoman94> ^^^ +!
Code:
<Entropy512> gotta be careful not to step on each other's work.  :)
<Bumble-Bee> thats true
<jerdog> compeete for donations
The Following User Says Thank You to Entropy512 For This Useful Post: [ Click to Expand ]
 
fnf
Old
#10  
Member - OP
Thanks Meter 52
Posts: 39
Join Date: Sep 2007
Quote:
Originally Posted by Entropy512 View Post
I assume you meant 4000 mV, not 4000 mAh? Considering that not even extended batteries I've seen exceed 3500 mAh?
Post amended, thanks .

 
Post Reply+
Tags
battery, charge, gsm, limit, voltage
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

Xposed Framework Module for the AT&T Galaxy S 4

Got yourself a brand new Galaxy S 4? Are you looking for some fun mods to make it truly your … more

Job Interview Prep: Phone Screen Part 1 – XDA Developer TV

XDA Developer TV Producer Jayce has been very busy creating videos to help … more

Auto Test Your Android Apps with Robotium

You’ve just finished coding your very first app, but before you release it to the wild, you … more

Open Source CPU Info App for Windows

So you’re playing with your shiny new Windows 8 tablet PC, when one of your like-minded geeky … more