Software & AppsOperating SystemLinux

Limiting Lenovo Laptop Battery Charging to 80% in Ubuntu

Ubuntu 10

Maintaining the health of your laptop’s battery is crucial for ensuring its longevity. One effective strategy is to limit the battery charging to 80%. This is particularly useful for Lenovo laptops running Ubuntu. In this article, we will explore several methods to achieve this.

Quick Answer

Yes, it is possible to limit Lenovo laptop battery charging to 80% in Ubuntu. You can achieve this by using the tp_smapi kernel module, TLP power management tool, or BIOS settings.

Why Limit Battery Charging to 80%?

Before we dive into the how-to, let’s understand the why. Lithium-ion batteries, such as those in laptops, have a finite number of charge cycles. A charge cycle is defined as the process of charging a battery from 0% to 100%, then discharging it back to 0%.

Over time, these cycles can degrade the battery’s capacity. By limiting the charge to 80%, you can effectively reduce the number of full charge cycles, thus extending the battery’s overall lifespan.

Using the tp_smapi Kernel Module

For Lenovo ThinkPad laptops, you can use the tp_smapi kernel module. Here’s how:

  1. Install the necessary package. Run the following command in your terminal:
    sudo apt-get install tp-smapi-dkms
    This command uses the apt-get package handling utility to install tp-smapi-dkms, a kernel module for ThinkPad laptops.
  2. Load the module with the following command:
    sudo modprobe tp_smapi
    The modprobe command is used to add a loadable kernel module (tp_smapi in this case) to the Linux kernel.
  3. Set the desired charging thresholds. Use the following commands:
    echo 40 | sudo tee /sys/devices/platform/smapi/BAT0/start_charge_thresh
    echo 80 | sudo tee /sys/devices/platform/smapi/BAT0/stop_charge_thresh
    These commands write the values 40 and 80 to the respective virtual files in the /sys/devices/platform/smapi directory. The echo command prints the specified value, and the tee command writes this value to the file. The sudo command is used to run these commands with root privileges.

Using TLP

TLP is a power management tool for Linux. It supports battery charge thresholds for various laptop models, including Lenovo. Here’s how to use it:

  1. Install TLP. Run the following commands:
    sudo add-apt-repository ppa:linrunner/tlp
    sudo apt update
    sudo apt install tlp
    The add-apt-repository command adds the PPA (Personal Package Archive) for TLP to your system’s software sources. The apt update command updates the package list, and the apt install command installs TLP.
  2. Open the TLP configuration file:
    sudo gedit /etc/default/tlp
    This command opens the TLP configuration file in the Gedit text editor with root privileges.
  3. Find the battery settings section. Uncomment the lines for start and stop thresholds and set them to your desired values. For example:
    These lines set the start and stop charging thresholds to 75% and 80%, respectively.
  4. Save the file and restart TLP:
    sudo tlp start
    This command starts the TLP service.

BIOS Settings

Some laptops have BIOS settings that allow you to limit battery charging. To access these settings, reboot your laptop and enter the BIOS setup by pressing the appropriate key (usually displayed during startup). Look for power settings or battery options and check if there is an option to enable battery charging limits. If available, enable the setting and set the desired charging threshold.


Limiting your Lenovo laptop’s battery charging to 80% can help extend its lifespan. Whether you use the tp_smapi kernel module, TLP, or BIOS settings, the process is relatively straightforward on Ubuntu. Remember to check the documentation or support pages for your specific laptop model to find the most suitable method for your system.

Why is it important to limit the battery charging to 80%?

Limiting the battery charging to 80% can help extend the overall lifespan of the battery by reducing the number of full charge cycles. Lithium-ion batteries degrade over time due to these cycles, and by limiting the charge to 80%, you can minimize this degradation and ensure better long-term battery health.

Can I use the methods mentioned in this article for non-Lenovo laptops running Ubuntu?

The methods mentioned in this article, such as using the tp_smapi kernel module or TLP, are specifically tailored for Lenovo laptops. While TLP may work on other laptop models, the tp_smapi module is designed for ThinkPad laptops. For non-Lenovo laptops, it is recommended to explore alternative power management tools or check if your laptop’s manufacturer provides any specific software or BIOS settings for battery charging control.

Is it possible to set different charging thresholds using the methods described in this article?

Yes, both the tp_smapi kernel module and TLP allow you to set different charging thresholds. In the tp_smapi method, you can modify the values in the commands mentioned in step 3 to set your desired start and stop charge thresholds. Similarly, in the TLP method, you can uncomment the lines in the TLP configuration file and adjust the values for start and stop thresholds according to your preferences.

Can I use both the `tp_smapi` module and TLP simultaneously?

It is not recommended to use both the tp_smapi module and TLP simultaneously as they can conflict with each other. It is advised to choose one method and stick with it to avoid any potential conflicts or unexpected behavior.

Leave a Comment

Your email address will not be published. Required fields are marked *