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.
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:
- Install the necessary package. Run the following command in your terminal:
This command uses the
sudo apt-get install tp-smapi-dkms
apt-getpackage handling utility to install
tp-smapi-dkms, a kernel module for ThinkPad laptops.
- Load the module with the following command:
sudo modprobe tp_smapi
modprobecommand is used to add a loadable kernel module (
tp_smapiin this case) to the Linux kernel.
- Set the desired charging thresholds. Use the following commands:
These commands write the values 40 and 80 to the respective virtual files in the
echo 40 | sudo tee /sys/devices/platform/smapi/BAT0/start_charge_thresh echo 80 | sudo tee /sys/devices/platform/smapi/BAT0/stop_charge_thresh
echocommand prints the specified value, and the
teecommand writes this value to the file. The
sudocommand is used to run these commands with root privileges.
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:
- Install TLP. Run the following commands:
sudo add-apt-repository ppa:linrunner/tlp sudo apt update sudo apt install tlp
add-apt-repositorycommand adds the PPA (Personal Package Archive) for TLP to your system’s software sources. The
apt updatecommand updates the package list, and the
apt installcommand installs TLP.
- Open the TLP configuration file:
This command opens the TLP configuration file in the Gedit text editor with root privileges.
sudo gedit /etc/default/tlp
- 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.
- Save the file and restart TLP:
This command starts the TLP service.
sudo tlp start
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.
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.
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.
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.
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.