How to set up the proximity sensor on your Xiaomi phone: the complete guide

When a Xiaomi smartphone screen goes off on its own or doesn't turn off when you hold it to your ear, a classic symptom of a proximity sensor that locks the screen when you bring it to your face, is familiar to many users. Often the problem isn't a physical malfunction, but a software failure or calibration bias that's easy to fix on your own.

Redmi and POCO smartphone owners are facing this a little more often because of the design and location of the sensor under the display or in a narrow frame. Before carrying the device to the service center, you should try software calibration through a hidden engineering menu or special commands, this action takes only a couple of minutes and in most cases returns the sensor to correct operation.

In this article, we'll go through all the ways that we can diagnose and customize this module, and you'll learn how to test it, do a deep calibration, and what to do if standard methods don't work. It's important to understand that the touchpad and the proximity sensor are different components, but their work is closely related to the logic of the MIUI or HyperOS operating system.

Diagnostics and check of sensor performance

The first step before any manipulation of the settings should be a thorough diagnosis, to make sure that the problem really lies in the software part, not in contamination or mechanical damage. Xiaomi smartphones have built-in engineering test that allows you to see the current readings of the sensor in real time.

To start the diagnosis, open the Phone app and dial the combination ##6484##. If the code didn't work, try the alternative ##4636## or go to the Settings menu β†’ About Phone β†’ MIUI version (you need to quickly click 10 times on the logo to appear CIT menu).

In the window that opens, you'll see the numerical value and the Start button. Put your phone on a flat surface, nothing should cover the top of the screen. Press Start and hold your palm to the top of the display, then remove it. If the values change (usually from 5.0 to 0.0 or vice versa), then the sensor is physically intact.

  • πŸ“± Make sure there is no protective film on the screen that covers the sensor area at the top.
  • 🧹 Wipe the top frame of the device with a soft cloth, removing fat and dust.
  • πŸ” Check if there is a case with high sides that can overlap the view.

⚠️ Attention: If the values in the engineering test do not change at all, even with a tight finger press, there is a high probability of physical shutdown of the plume or failure of the component.

Once you pass the test, you can move on to sensitivity settings, sometimes standard factory settings get lost after a firmware update or a device drops, and calibration allows you to set new boundary values that the system will consider "normal."

Calibration through CIT Engineering Menu

The most reliable way to set up the sensor is to use the built-in CIT (Calibration Item Test) menu, which is available on most Xiaomi, Redmi and POCO models without obtaining superuser rights, and the process requires carefulness, as you will be required to perform several actions in strict sequence.

Log in to the CIT menu using ##6484## or system settings. Search in the list of "Proximity Sensor." You will see a window with a black screen and a "Calibration" button. Click on it. The system will ask you to remove your hand from the screen, and then start counting down.

Once the timer has reached zero, quickly but gently cover the top of the screen with your palm, without touching the matrix itself much. The system should fix the value of "Pass." If you see "Fail", repeat the procedure, making sure that there are no gaps between the hand and the screen, but there should be no strong pressure either.

β˜‘οΈ Checklist of correct calibration

Done: 0 / 4

Importantly, after successful calibration, the device needs to restart, and only after a full cycle of on and off, Android will apply new sensitivity factors, and if the problem persisted due to software bugs, it should disappear.

Setup through hidden commands and applications

If the standard CIT menu is not available or is not working properly, alternative methods can be used. In some versions of MIUI, the ##PROXIMITY## command (typed as ##77694786##) is used, which immediately opens the calibration window, but on new models, this code is often blocked by developers.

In these cases, specialized applications come to the rescue from the Google Play store, and popular utilities like Proximity Sensor Reset/Fix or Proximity Calibration can send hidden system requests to reset sensor values, and they work on the principle of emulating actions in the engineering menu.

When using third-party software, be careful about the permissions requested. The application only needs access to sensors, the requirement for contact rights or a microphone should alert. Once the program is running, follow the instructions on the screen: you usually need to close and open the sensor several times.

Method of setting upNecessary rightsEfficiencyDifficulty
Engineering Menu (CIT)No.Tall.Low.
Hidden. USSD-codeNo.MediumLow.
Third-party annexesAccess to sensorsMediumMedium
Root rights (Sensor Test)SuperUserMaximumTall.

It is worth mentioning that for some models, such as the Redmi Note 9 Pro or POCO X3 NFC, a software error that can only be corrected by resetting the sensor settings through ADB-This is a more complex method that requires a connection to a PC.

A command to reset through ADB
For advanced users: connect your phone to a PC with debugging enabled USB Enter the adb shell settings put system proximity_sensor_use_deblocking 0. This can help if the sensor is stuck in the software state.

Problems with the sensor under the screen

Special attention should be paid to smartphones with ultrasonic proximity sensor located under the display (for example, the Xiaomi Mi 10/11 series, Redmi K20 Pro). These devices do not have a physical hole in the case.

The main problem with these models is sensitivity to the quality of the protective glass, so if you use cheap glass with a thick adhesive layer or a matte film, the ultrasound may not pass through them correctly, and the screen will go out in your pocket or not respond to the ear.

Calibration of these sensors often requires a special mode activated by the code ##64663## (may vary depending on the region). From the menu, select "Uproximity" (Under-display proximity), a process similar to normal calibration, but requires perfect screen cleanliness.

  • πŸ›‘οΈ Use only original or certified safety glass.
  • 🧼 Carefully degrease the screen before sticking the protection.
  • 🚫 Avoid high-thick hydrogel films above the sensor area.

⚠️ Note: Owners of smartphones with a subscreen sensor are strongly advised not to use β€œliquid glass” or polishes that fill micropores, as this changes the refractive index and can permanently disrupt the sensor.

If the problem persists after the glass has been replaced, the system may have lost the calibration files persist, in which case only the flashing with data storage or a complete reset helps, but before that you should try to turn off the "pocket mode" in the call settings.

Impact of MIUI and HyperOS Updates

Users often notice that after updating the operating system, the sensor begins to behave inadequately. Xiaomi periodically changes the algorithms of the framework responsible for processing sensor signals.

In these situations, a simple reboot doesn't help. You need to reset the sensor. Go to the dial menu and type ##6485##. In the list that opens, find parameters that start with "PC" (Proximity Calibration). If the values are very different from the standard (usually the range is 0-5000 depending on the model), calibration is required.

πŸ“Š Have you experienced sensor problems after the update?
Yeah, the screen goes out.
Yeah, the screen's not going out.
No, it's working.
Didn't update the system.

It's also worth checking for updates to the Phone and Contacts app, and sometimes the bug is in the dialer shell, not the system, so go to Google Play or GetApps and update the system components.

If you're using custom themes, try switching to standard themes, and some themes change the system files that are responsible for animation and sensors during a call, which leads to conflicts.

Radical measures: resetting and reflashing

When software methods are exhausted and the sensor continues to malfunction, the last software option is a full reset (Hard Reset), which will remove all data from the phone, so be sure to back up important files.

Go to Settings β†’ Phone β†’ Settings β†’ Settings Reset β†’ Erase all data. Once reset, the phone will return to factory parameters, including calibrating all sensors. If that didn't work, the problem is likely hardware: the plume has gone off, the contact has oxidized, or the module itself has crashed.

πŸ’‘

Before resetting your settings, take pictures of important screens with settings or save them in notes to quickly restore the usual system configuration.

In rare cases, flashing the device through the computer using the Mi Flash Tool utility helps. Choosing a global stable firmware version instead of a regional one (for example, Chinese or Indian) can solve the problem if it is caused by a bug of a particular software build.

πŸ’‘

If the calibration and reset did not help, and in the engineering test the sensor does not respond, a replacement of the module in the service center is required.

Frequently Asked Questions (FAQ)

Why does the proximity sensor only work after restarting?
This is a sign of a software conflict, and it's likely that some application is intercepting the sensor, or that there's a cache of errors in the system, and try to delete the newly installed apps that are working with the screen or calls, and clean the cache of the system.
Can the proximity sensor be completely turned off?
MIUI is not, but there are some Google Play call replacement apps that ignore the sensor, and some firmware versions have a hidden switch in the engineering menu, but using it can cause the phone to malfunction.
Does the magnetic case affect the sensor?
Yes, it can. The magnets in bookcases sometimes affect the magnetometer and other sensors. If you have one, take it off and check the sensor. If the problem is gone, it's the accessory.
What if the screen goes off while watching a video in horizontal mode?
It might not be the proximity sensor, it might be the light sensor or the gyroscope, and check if you're occluding the top end of the phone with your hand, and also turn off the Auto Brightness function to check, and if the problem is only in YouTube or the browser, clear the cache of these apps.