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?

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.

  • 2
    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
  • 1
    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
  • @coteyr: This vaguely-related question of mine explains why it's not ideal to always keep your laptop charged at 100%. – unforgettableidSupportsMonica Aug 28 '15 at 2:43

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.

| improve this answer | |
  • +1 for one of the most complicated answers I've read in awhile. I've decided to buy a smart plug and write a script to turn off power to laptop charger once a week until charge depletes to 20% or some threshold set by user. – WinEunuuchs2Unix Dec 31 '19 at 0:14

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.

| improve this answer | |

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.

| improve this answer | |

In most laptops is the Embedded Controller the one responsible for that. I suggest you to study the ec_sys module. modprobe ec_sys then hexdump -C /sys/kernel/debug/ec/ec0/io

you will see differences when charging and when discharging. There are also more interesting things to do like:

1) use AC power (if connected) 2) use battery (even if AC is connected) 3) charge/discharge etc

| improve this answer | |
  • You can also find a detailed Embedded controller map in DSDT acpi table. – Zibri Jan 6 '18 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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