Professional calibration of Xiaomi battery via computer

Xiaomi, Redmi and POCO are all known for their energy efficiency, but over time, even the most reliable lithium polymer battery starts to give out incorrect data on the percentage of charge. The user may notice that the phone suddenly turns off at 15% or, conversely, "stuck" 100% for too long. These are classic signs of desynchronization of the power controller and the software part of the system that needs to be eliminated.

Many people mistakenly believe that calibrating a battery can physically restore the chemical structure of a worn cell, but it is not. The essence of the procedure is to zero out the controller statistics so that the MIUI or HyperOS operating system “re-examines” the real capacity of the battery. Using a personal computer in this process provides a key advantage: the ability to deep monitor voltage and accurately control discharge processes without the intervention of the smartphone system.

In this guide, we will discuss advanced methods that are only available when connecting to a PC. You will learn how to use the ADB debugging bridge to get detailed statistics, how to work with the engineering menu through terminal emulators and what utilities can help in diagnosis. It is important to understand that interfering with system files requires care, so follow each step of the algorithm.

Diagnostics of battery status before the procedure

Before you start any manipulation, you need to make sure that the problem is a software failure, not a physical wear or defect of the board. The charge controller is a chip that controls currents, and if it is damaged, the software calibration will be useless. Initial diagnosis allows you to weed out cases when you need to replace hardware components.

The easiest way to get primary data is to use the hidden engineering menu available on most Xiaomi devices. You don't need root access, just enter a special code in the Phone app. In the window that opens, you're interested in the section associated with Battery Status or Power Info, which displays the current voltage, temperature and design capacity.

  • 🔋 The voltage at rest should be 3.7-3.8 V, and when charging to grow to 4.2-4.45 V.
  • 🌡️ Temperature should not exceed 45°C in active operation or fast charging.
  • 📉 If the display capacity (Design Capacity) is significantly lower than the passport, the battery is physically degraded.

⚠️ Warning: If the battery temperature rises dramatically during diagnosis or the smartphone warms up even when it is off, stop any calibration attempts.This is a sign of an internal short circuit that could cause a fire.

For more in-depth analysis, you can connect your smartphone to your computer and use monitoring tools that read data directly from the controller. But with standard Windows or macOS tools, it's hard to access raw battery data without specialized software, and that's where the developer toolkit comes in.

📊 Have you noticed a sharp jump in the percentage of charge on your Xiaomi?
Yes, the phone turns off by 10-15%.
No, the battery holds it honestly.
Sometimes the charge is "sticky" 100%.
I didn't pay attention.

Preparation of the ADB development environment and drivers

To perform professional calibration via PC, you will need to install the Android SDK Platform Tools on your computer. This is the official toolkit from Google, which contains adb and fastboot utilities. Without them, low-level interaction with the system partitions of a smartphone is impossible. The installation process is simple, but requires careful adjustment of environmental variables.

The first step is to download the current version of Platform Tools from the official Android developer site. Unpack the archive into the root directory of the disk, for example, in the C:\platform-tools folder, so that the path does not contain Cyrillic or spaces, which often causes errors when executing commands.

The most important step is to install Xiaomi USB Driver drivers. Without properly installed drivers, the computer will see the device only as a media player or charger, ignoring debugging commands. After installing the drivers and turning on the debugging mode on the phone, enter the adb device command in the terminal.

adb devices


List of devices attached




8X5Y2Z3A4B device

If a device with a serial number and device status appears on the list, the connection is established. Unauthorized status means that you need to confirm the debugging permission from that computer on the smartphone screen. Make sure you use an original or quality USB cable, since cheap cables often do not provide stable data exchange.

💡

Use USB 2.0 ports on the motherboard to connect older devices, as they provide better debugging compatibility than USB 3.0/3.1 ports.

Method of resetting statistics through ADB teams

The most effective software calibration method is to clean up the batterystats.bin file, where Android stores the history of charge and discharge cycles. Over time, this file becomes overrun with erroneous data, and the system mispredicts battery life, and deleting this file forces the system to recalculate parameters from scratch.

This operation requires superuser rights (Root) if your smartphone is not rooted, this method will not work, since the Android security system will block access to system files. Owners of devices with an unlocked bootloader and Magisk installed can complete the procedure in a few seconds.

Connect your smartphone to your PC, open the command prompt in your ADB folder, and enter the following sequence of commands: Each command should end with a success message or confirmation on the device screen.

adb shell


su




rm /data/system/batterystats.bin




reboot

The first command runs the shell on the device, the second asks for root rights (the phone will have a request to confirm), the third command deletes the statistics file, and the fourth reboots the smartphone. Once turned on, the system will begin to generate new statistics, ignoring the old erroneous data about the “stretched” or “compressed” charge.

  • 📱 Make sure the charge level is at least 20% before the procedure so that the phone doesn’t turn off at a critical moment.
  • 🔒 If the su command issues an access error, then the superuser rights are absent or not provided for the shell. ADB.
  • 🔄 After restarting, don’t charge your phone right away, let it drain before it shuts down for better calibration.

Use of engineering menus and terminal emulators

If root rights aren’t part of your plan, you can use an alternative method that mimics deep reset through system applications, which is less invasive, but also requires a PC connection to use a terminal emulator if the smartphone itself doesn’t have a user-friendly command-input interface.

There are terminal emulator apps that can be installed on a smartphone (such as Termux or Terminal Emulator), but for the purity of experimentation and control, it is better to use an ADB shell without root rights if the Android version allows accessing system settings through hidden intentions. However, a more reliable method for non-root devices is using engineering menu codes through a PC controller or simply manual input.

Enter the dialer code ##6485##. The menu will open. MB_INFO, We're interested in the item where you can see a lot of parameters. MB_06: Battery Health (should be "Good") and MB_00: Current Battery Level. Some Xiaomi models allow you to reset the calibration via "Reset Battery Stats" or similar if it is available in your firmware version.

Parameter (Code)DescriptionNormal value.
MB_06Battery health statusGood
MB_01Current voltage3700-4400 mV
MB_02Temperature.250-400 (x0.1 °C)
MB_05Remaining capacityDepends on the model.

If there is no reset feature in the engineering menu, you can try resetting the network and Bluetooth settings, which sometimes indirectly affects the power module, but this is less efficient. The main emphasis for owners of non-root devices should be on the correct charge-discharge cycle, described in the next section, controlled via PC.

What is BMS and why is it important?
BMS (Battery Management System) is a board of protection inside the battery, which prevents overcharging, deep discharge and overheating. Calibration works with the BMS controller, aligning its readings with the actual chemical potential of the cells.

Manual Charging Cycle Algorithm for Synchronization

After performing software manipulations (deleting statistics or checking the engineering menu), a physical calibration is necessary, which is critical because it allows the controller to write down new cut-off points: 0% and 100%. Without this step, all previous actions will have only a temporary effect.

The essence of the method is to completely discharge the device before turning off automatically, followed by uninterrupted charging to maximum. Use a computer to monitor the process if you have the ability to track the current consumption through the USB-The tester that's inserted into the PC port, or just watch the indicator. The main thing is not to interrupt the charging process after reaching 100%.

  1. Discharge your smartphone until it shuts down completely. If it doesn't turn off by itself, use heavy apps or high-resolution videos.
  2. When switched off, put the phone on charge. The indicator should catch fire.
  3. Wait until you reach 100%. After that, don't turn off the cable for at least 1-2 hours. This is called "top-up" or recharging, it's necessary for balancing the cells.
  4. Perform a forced reboot (press the power button for 10-15 seconds), without turning off the charger.
  5. Once turned on, check the charge level again. If it's down below 100%, finish it again.

This cycle is recommended to be repeated 2-3 times in a row, and this is a "training" for a lithium-ion battery that helps the controller to more accurately determine the voltage corresponding to the full capacity. Don't be afraid of a deep discharge as part of the calibration, it is not as scary for modern batteries as constantly operating in the buffer zone of 20-80% without periodic "zero" of the meter.

☑️ Checklist of the correct calibration cycle

Done: 0 / 5

Analysis of results and work with the BMS controller

Once the calibration cycle is complete, you should do the diagnostics again to assess the performance of the work done. Compare the readings of the engineering menu and the actual behavior of the smartphone. If the charging percentage began to change more linearly, and the sharp jumps disappeared, then the procedure was successful.

However, if you see the phone still sit down or shut down 30-40% as quickly as possible, the problem may be deeper, and it may be that the wear and tear of the battery’s physical capacity has reached a critical level (usually more than 20% of the loss from the original capacity), and software methods are no longer able to compensate for the degradation of the chemical elements.

In this case, the BMS controller can block the current output at certain voltages, considering the battery to be faulty. Software calibration cannot restore the lost milliamp hours. The only solution is to replace the battery with a new, preferably original or high-quality analogue from proven brands like Nohon or BS.

⚠️ Warning: Don’t use the Play Market calibration apps that promise to “restore” the battery in 5 minutes. They just repeat the above discharge-charge cycle, but often less efficiently and with a lot of advertising.

To extend the life of a new or calibrated battery, try to keep your smartphone from being permanently charged after reaching 100%.The Optimized Charging feature in MIUI helps with this by learning your habits and suspending charging at 80% until you normally take your phone off the charge.

💡

Calibration is a software setup of a "line" that measures charge. If the battery itself is broken, the setup won't help, you'll need to replace the part.

Frequently Asked Questions (FAQ)

Is it safe to delete batterystats.bin?
Yeah, it's safe. batterystats.bin When it is deleted, the system automatically creates a new clean file the next time it reboots, which is a standard Android maintenance procedure that does not affect the user's personal data (photos, contacts, applications).
Do I need to be calibrated after each reflash?
Not necessarily, but desirable. Once you install a new version of MIUI or custom firmware, the file structure may change, and the old statistics may conflict with the new system, and running one full charge-discharge cycle after the software update will only be beneficial.
Can a battery be calibrated without root rights?
Full calibration with the removal of the system statistics file requires root rights. However, the "training cycle" method (full discharge and long charge) is available to all users and in most cases gives a comparable visual result, forcing the controller to recalculate capacity.
Why does the phone warm up during calibration?
Heating during charging, especially in “recharging” mode after 100%, is a normal physical process, but if the device gets so hot that it is unpleasant to hold it in your hands, or warms up when it is off without charging, this is a sign of a malfunction of the power controller or the battery itself.
How often should you calibrate?
Prophylactic calibration is enough once every 3-6 months. Frequently performing full discharge cycles (up to 0%) is harmful to lithium batteries, so do not do it weekly. Use this method only when clear signs of dissynchronization of the charge indicator.