How to completely disable Xiaomi charging through USB from the computer: all working methods

Connecting Xiaomi smartphone to your computer through USB-The cable automatically starts the battery charging process – even if you only wanted to transfer files or use the device in debugging mode. USB. For some users, this creates inconvenience: the battery wears out faster due to constant microcycles of charge, and when diagnosed through the use of a battery. ADB Fastboot or excess power can distort test results.

In this article, we will discuss all the current ways to disable charging on the USB on smartphones Xiaomi, Redmi and POCO β€” standardized MIUI to hidden commands for power users, special attention will be paid to the nuances for different versions of the firmware (including: MIUI 14/15 HyperOS and other risks that are important to consider before changing system settings.

Why Xiaomi is charging through USB computer and whether it can be turned off

By default, Xiaomi smartphones are set for maximum compatibility with the USB-ports: when connected to a PC, laptop, or even a low-current charger (e.g, 0.5A) The phone is trying to squeeze everything out of the connection. It's done at the firmware level and it's connected to several factors:

  • πŸ”‹ Optimizing charging time: MIUI The battery is recharged at any opportunity, even if the power supply is weak.
  • πŸ“± Universality USB-port: one cable is used for both data and power – the system does not share these functions by default.
  • ⚑ Fast charging algorithms: even at low current (e.g., from USB 2.0: The smartphone can activate modes like Quick Charge 2.0, which leads to heat.

It is technically possible to turn off charging, but there are nuances:

  • βœ… At the level MIUI (without root – only partial restriction through the developer settings.
  • βœ… With superuser rights - complete power outage USB.
  • ❌ On some models (for example, Xiaomi 13 Ultra or POCO F5) β€” Hardware limitations do not allow you to completely block charging without physically damaging the port.

Before you start settings, check if your desire to turn off charging is due to battery problems.If the battery is quickly discharged or overheated, wear and tear may be the cause, not wear. USB-In this case, it is better to check the status of the battery first through the engineering menu (#4636##).

πŸ“Š Why you need to turn off the charging on USB?
To keep the battery longer.
Interferes with debugging through ADB
Phone overheats
Other

Method 1: Disable charging through developer settings (without root)

The safest method is to use hidden options. MIUI, This method works on most models (including Redmi Note 12, Xiaomi) 12T, POCO X5 Pro) and does not require superuser rights.

Activate Developer Mode (7 times press "Version" MIUI" on the telephone")

Connect the phone to the PC and select the "File Transfer" mode

Open "Developer Settings" and find the settings USB

-->

Step-by-step:

  1. Open the Settings. β†’ About the phone and tap 7 times on the item Version MIUI, Notice: β€œYou have become a developerΒ».
  2. Return to the main settings menu and select Additional settings β†’ Developer settings.
  3. Scroll down to the Network block and find the configuration option USB by default (on some firmware β€” USB-configuration).
  4. Select Charging Only (if available) or No Data – this will limit current but will not turn off charging completely.
  5. To completely disable, find the debugging parameter by USB β†’ Disable charging when debugging (not available on all devices).

Limitations of the method:

  • ⚠️ Nana MIUI 14/15 HyperOS option Disable charging may be absent – instead there will be only a limit to the current to 500 ma.
  • ⚠️ After restarting the phone, settings may reset (especially if connected to others). USB-port).

πŸ’‘

If there is no option to disable charging in Developer Settings, try connecting your phone to your PC in Charging Only mode and then manually select File Transfer – sometimes this resets the restrictions.

Method 2: Use of the ADB-commands to cut off power USB

For users who are ready to work with Android Debug Bridge (ADB), There is a more flexible way to control charging, which is suitable for all Xiaomi models (including Redmi). K60, Xiaomi 13 Lite, but requires pre-configuration ADB computer-based.

What you need:

  • πŸ–₯️ Computer with installed Xiaomi drivers and package ADB Tools (you can download from the official Android website).
  • πŸ“± Included Debugging by USB on the phone (in the Developer Settings).
  • πŸ”Œ USB-cable with data transmission support (not all charging cables are suitable!).

Instructions:

  1. Connect your phone to your PC and select File Transfer mode.
  2. Open the command prompt (cmd on Windows or Terminal on the macOS/Linux) and type: adb devices Make sure your device appears in the list (permission confirmation on the phone may be required).
  3. Execute the command to disable charging: adb shell dumpsys battery set usb 0 This command simulates the absence of USB-power-up.
  4. To return the charge, use: adb shell dumpsys battery reset

Important observations:

  • ⚠️ After restarting the phone or disconnecting USB Commands will be thrown off – they must be re-run.
  • ⚠️ On some firmware (e.g. HyperOS), the dumpsys battery command may be blocked.
What if the ADB can’t see the device?
1. Make sure that the "Developer Settings" option is enabled "Allow debugging by USB (Safe mode)” 2. Try another one. USB-cable (preferably original from Xiaomi). 3. Install drivers manually via Device Manager (for Windows). 4. Reboot your phone and PC, then reconnect.

Method 3: Change the configuration file (root required)

If you have superuser rights (root), you can edit the system file responsible for power management. USB. This method is the most reliable, but requires caution - incorrect changes can lead to inoperability of charging at all.

Warning:

⚠️ Note: Editing system files without a backup can make the phone inoperable.We recommend pre-create a backup through TWRP Or OrangeFox Recovery.

Instructions:

  1. Install any file manager with root support (such as Root Explorer or FX File Explorer).
  2. Cross the path: /system/etc/ and find the file. usb_config.xml (firmware β€” usb_settings.conf).
  3. Open the file in the text editor and find the line: <usb_power_delivery enabled="true"> Replace true with false.
  4. Save the changes, set the rights to 644 (rw-r--r---) and restart the phone.

Alternative path (for MIUI 14+):

If the file usb_config.xml No, try editing:

/vendor/build.prop

Add a line to the end of the file:

persist.usb.charging.disabled=1

Xiaomi modelThe path to the fileNotes
Redmi Note 10/11/system/etc/usb_config.xmlYou need to disable dm-verity before editing.
Xiaomi 12/13/vendor/build.propChanges will only be applied after a full reboot.
POCO F4/F5/system/vendor/usb/usb_config.xmlOn HyperOS, the file can be protected by SELinux.

πŸ’‘

Editing system files is the only way to completely and permanently disable charging USB, It requires root rights and may disrupt other functions (e.g., root rights, OTG).

Method 4: Using a magnetic USB-switch-wire

If the software methods are not suitable or you are afraid to interfere with the settings, you can solve the problem hardwarely - with the help of a special USB-This is a physical power switch cable, and it's often used to do this:

  • πŸ”Œ Connecting peripherals (keyboards, mice) to the phone without charging.
  • πŸ“± Diagnostics of devices through ADB heat-free.
  • πŸ”‹ Extending battery life with frequent connection to a PC.

How it works:

In the cable installed microswitch that breaks the power chain (+5V and GND), Only data lines (D) are left.+ and D-. Example of such cables:

  • UGREEN USB 2.0 Data Sync Cable (with switch).
  • Baseus Magnetic USB Cable (magnetic connector with power lock).

Pros and cons of the method:

AdvantagesDeficiencies
βœ… No changes to your phone or PC.❌ Quality cables are more expensive than normal.
βœ… Works on any device (including iPhone and other brands).❌ Can reduce data transfer speed if the cable is of poor quality).
βœ… Compatible with Fastboot and ADB.❌ Not all models support magnetic connectors.

Where to buy it?

  • πŸ›’ AliExpress (search on request Β«USB data only cableΒ»).
  • πŸ›’ Official Xiaomi stores (sometimes come across in the accessories section).
  • πŸ›’ Local electronics stores (check the availability of a power switch).

πŸ’‘

Check reviews before buying – some cheap cables may not work properly with protocols MTP or PTP, This means that the phone will not be identified as a storage device.

Method 5: Disconnect power through the engineering menu (hidden codes)

Xiaomi smartphones have a hidden engineering menu through which you can manage many hardware functions, including: USB-This method doesn't require root, but it doesn't work on all firmware.

How to open the engineering menu:

  1. Open the Phone app and enter the combination: ##4636## Select Battery Information.
  2. If the combination doesn’t work, try it: ##36446337## (for MIUI 12-14) or ##284## (for HyperOS).
  3. In the menu, find a tab. USB Settings or Hardware Testing.
  4. Select the option. USB Power Supply and set the Disable value.

Important observations:

⚠️ Note: Some models (Xiaomi 13 Pro, Redmi) K50 Ultra) the engineering menu may be blocked by the manufacturer, and trying to enter codes on such devices will result in resetting or blocking the settings!

Alternative code for new firmware:

If the standard combinations don’t work, try:

##283##

This is a hardware component testing menu where you can manually turn off power. USB-port (option) USB Port Test β†’ Power Off).

What to do if nothing helps: radical methods

If none of the above methods worked, there are extreme measures that should be considered only if the power out is critical to your task (e.g., for professional diagnostics or equipment testing).

Option 1: Physical disconnection of contacts USB-port

In the connector USB-C Micro-USB is responsible for the power supply. VCC and GND. They can:

  • πŸ”§ Carefully isolate with scotch (temporary solution).
  • πŸ”§ Stifle with heat glue (irreversible but reliable).

⚠️ Risks: Incorrect insulation can lead to short circuit or damage to the port!

Option 2: Use USB-powerless

Connect your phone to your PC through USB-There's a hub without a power supply, and many hubs don't transmit power to connected devices unless they're plugged in:

  • TP-Link UH720 (disconnect the power in the absence of an external source).
  • Anker 4-Port USB 3.0 Hub (to remove the power supply).

Option 3: Software lock through TWRP

If the phone has custom recovery installed (TWRP Or OrangeFox), you can edit the fstab file to block mounting. USB food-supply:

  1. Download to TWRP.
  2. Go to Advanced β†’ File Manager.
  3. Open the file. /etc/fstab.qcom (or similar to your model).
  4. Find the line with usb and add the nocharge option.

πŸ’‘

Radical methods should be used only in extreme cases. USB-Ports lose warranty and can damage the phone.

FAQ: Frequent questions about disabling charging on USB

❓ Can I turn off the charger on USB Xiaomi without root?
Yes, but only partially, through the developer's settings or ADB You can limit current to 500 mA or simulate a lack of power, but completely disable charging without root is impossible on most firmware.
❓ Why After Disabling Charging, Your Phone Still Warms When Connecting to a PC?
The heat may not be associated with charging, but with: πŸ”₯ Transfer data (especially when copying large files). πŸ”₯ Debugging by USB (processes ADB processor). πŸ”₯ Faulty cable (check the cable on another device) Try connecting your phone in Charging Only mode and watch the temperature.
❓ Will the phone charge from wireless charging if turned off? USB?
Yes, the charging disconnection. USB It does not affect wireless charging (Qi or Mi Wireless Charging) and these systems are controlled by separate controllers.
❓ Can I turn off the charger on USB Always so that it does not turn on even after restarting?
Root only (see Method 3) or through physical port modification. All root-free software methods are reset once the reboot is complete.
❓ Why some Xiaomi models don’t have the option to turn off charging in the settings?
The manufacturer has removed this option from the MIUI 14+ HyperOS and other factors for several reasons: πŸ“‰ Reduced number of calls to the service (users accidentally turned off charging and complained of β€œmalfunctionΒ»). πŸ”‹ Optimization of charging algorithms (the system itself regulates the current depending on the task). πŸ”’ Security (on corporate devices, a power outage could have been used to bypass protections).