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.

If a laptop is powered on and connected to AC power, is there a way to issue a command that tells it not to charge the battery?

EDITED:
Perhaps charging of the battery may be stopped if there were a way to fool the system into thinking the battery is already at 100% charge.

share|improve this question
1  
It is possible -- I know that Lenovo computers are able to do that with Windows loaded. Not sure if there is a facility to do this with Ubuntu. –  cprofitt Nov 16 '12 at 18:02
    
Can you explain why you would want to do this? –  coteyr Nov 16 '12 at 18:43
    
I have a BIOS option to do so. Not what you want exactly, but have a look there. –  Timo Nov 16 '12 at 23:23
add comment

3 Answers

On Thinkpad devices, you can control the start and stop of the battery charging in Ubuntu. Run these commands in your terminal to install tp-smapi:

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

Then write your desired charging thresholds (your own values) to the virtual files in /sys/devices/platform/smapi:

echo 10 | sudo tee /sys/devices/platform/smapi/BAT0/start_charge_thresh
echo 100 | sudo tee /sys/devices/platform/smapi/BAT0/stop_charge_thresh

In the above commands you can change the values 10 and 100 to any value. The first one will help you to choose at what level charging must start and the second value will let you choose at what level charging must stop.

share|improve this answer
add comment

You can't disable charging using any known software interface from user space. As it is, the battery controls from /sys/class/power_supply/BAT0 are static and dynamic readings as returned from the ACPI _BIF, _BIX and _BST controls, these are read only.

There are no ACPI controls that allow you to disable battery charging and on all the common x86 mobile platforms I've ever worked on the battery controls are not exposed. Normally this data comes from a battery gas gauge and are read using bit-banging i2c usually by an embedded controller. So you realistically have very little chance of reverse engineering this and most won't allow battery charging disabling.

share|improve this answer
add comment

This is highly dependent on hardware. Most laptops at the hardware level, will not allow you to stop charging the battery. LION batteries actually benefit from a small uncharge - recharge cycle, and most laptops will have that cycle built in at the hardware level.

Meaning as your battery indicator says 100% the battery is actually discharging and recharging a tiny little bit to keep it healthy. Also, for most laptops 100% is not full.

Some laptops in windows, have an option to "Disable charging", but this was just a throwback to NiCad batteries. These days all that "setting" does is enable "performance" mode.

If your looking for the same kind of switch then I recommend Jupiter. It will allow you to easily move between performance modes, but again not control charging directly.

Because stopping that charging cycle is very bad for current batteries it's not very popular. Because it's not popular, I doubt you will find a good GUI tool to do it. Your best bet, might be looking around in /sys/class/power_supply/BAT0 like areas and seeing what you can find, but I am pretty sure, that your not going to be able to disable charging.

share|improve this answer
add comment

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.