Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I just learned that some Lenovo laptops include a utility that offers to limit battery charging capacity to within 0–80% in order to slow the attenuation of the battery lifespan:

screenshot

How can I do this in Ubuntu?

share|improve this question
    
Can you confirm that aquaherd's answer works for you? –  cfi Oct 27 '11 at 8:29

5 Answers 5

up vote 32 down vote accepted
+50

The charging thresholds are, very unfortunately, firmware and vendor specific.

The Lenovo user is luckily provided with a solution outlined on ThinkWiki.

It basically says that you would have to install and load the tp_smapi kernel module:

sudo apt-get install tp-smapi-dkms
sudo modprobe tp_smapi

and write the desired charging thresholds to virtual files in /sys/devices/platform/smapi:

echo 40 | sudo tee /sys/devices/platform/smapi/BAT0/start_charge_thresh
echo 80 | sudo tee /sys/devices/platform/smapi/BAT0/stop_charge_thresh

Then it will stop charging once it reached 80% and only start charging when it drops below 40%.

Toshiba and others might have a similar kernel module that exposes firmware functionality to the /sys or /proc space, but it is very unlikely for patent issues. For the same reasons, an application that could handle this would be either Thinkpad- specific or only address a few select vendors.

share|improve this answer
    
Thanks for this info. It's a good start - hopefully at least for the original Q asker. Hardware vendors should offer more support for linux driver developers. It's a shame that so much time has to be wasted having to reverse engineer hardware protocols. –  cfi Oct 27 '11 at 8:32
    
Works just as described on my ThinkPad X60 running Ubuntu 11.10. –  ændrük Oct 27 '11 at 18:06
    
I'll hold off on accepting this until cfi's bounty ends so as not to turn away people who might know a more general solution before they view this page. Also, @cfi, ping. –  ændrük Oct 27 '11 at 18:12
    
Awarded the bounty as aquaherd took the time and at least successfully solved the original question. –  cfi Nov 1 '11 at 14:37
    
I did in Ubuntu sudo apt-get install tp-smapi-dkms. It installed. Then I'm doing echo 40 > /sys/devices/platform/smapi/BAT0/start_charge_thresh and it says bash: /sys/devices/platform/smapi/BAT0/start_charge_thresh: No such file or directory. Why? –  Alex Malex Dec 18 '12 at 9:07

On my Toshiba R830 running Windows 8.1, I installed the Toshiba Power Saver application in order to limit the battery charge to 80%

When I boot on Linux (Ubuntu, Mint, etc), the maximum charge is still limited to 80%.

Therefore, the Toshiba Power Saver seems to store its configuration into the bios.

The only drawback is that if I want to travel with a fully charged battery, I have to reboot on Windows and change the Power Saver configuration.

share|improve this answer
1  
welcome to askubuntu! Your results with Mint don't appear to be Ubuntu related. Can you rephrase your answer in terms that are relevant to this site? Thank you! –  Elder Geek Jun 21 at 13:49

Very often (almost always) this is an option in the BIOS that Windows can change remotely. It's very difficult to remote change this in Linux. My suggestion? When starting up your computer, smash the function keys, specifically F1, F2, F3, F6, F8, F10, and F12. One of these (maybe another) will put you into the bios menu. It says which key on startup, but it doesn't usually stay up long enough.

Look for power settings (only arrow keys here, no mouse). Find batter saver or batter optimizer or something along those lines. Change that to enabled, and then save and restart. This should do it.

Linux tends to freak out when the battery doesn't charge past 80%, but it will just ruin your expected charge times. Nothing to worry about here.

Still need help? Comment your question! Did I help? +1 me :)

share|improve this answer

If you would like to extend the lifetime of your battery, I would suggest no single application, but some more measures:

  1. Remove your batteries when not needed: If you do lots of desktop work without moving your laptop, remove your batteries. Usually this will save a lot of lifetime, because they are not (un)loaded. However you should remember that the batteries are not inside the laptop. I lay them near my keyboard. So I always remember that they are not inside.
  2. Load your battery at low temperature: Usually it is recommended that you load the battery when the temperature of your laptop is low (10-30°C, 50-86°F). Higher temperatures shorten the lifespan.
  3. Keep your laptop cool: High temperature is in general not a good idea. So you should always have an eye on the temperature. Make sure that enough air flows around your computer and keeps it cool.
  4. Avoid short loading: If you load your battery for five minutes, switch off power and load again, you can also shorten the lifetime. It is better to use have longer loading times (Load until battery is full).

However often it is claimed that batteries have some memory effect. This is not true. There were several studies which showed that the memory effect is a false claim. See also Repairfaq: NiCd Batteries do NOT have "memory".

I treat my batteries this way and they usually keep their abalities for years. My colleagues often wonder why my batteries don't get broken.

share|improve this answer
    
Someone said that: if I remove the battery , Power cutting-off will break the mainboard. Is it true? –  waterloo2005 Apr 20 '12 at 15:00
2  
Personally I never heard about such issues and I do the remove-batteries-trick since more than ten years without anything happened so far. –  qbi Apr 27 '12 at 20:42

Did you check to see whether there is a BIOS setting on your laptop for this? My laptop had a Windows Application as well as a "Battery Life Extender" setting in the BIOS for this exact feature.

share|improve this answer
1  
There is no such setting in the BIOS setup screen. –  ændrük Jun 2 '11 at 15:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.