How the proximity sensor in Xiaomi smartphones works: device, malfunctions and repairs

The proximity sensor is one of those small but critical components in Xiaomi smartphones that users only remember when it stops working. This miniature sensor is responsible for automatically turning off the screen during a phone conversation, preventing accidental tapping of the cheek or ear, but its role goes beyond basic functionality: it depends on the energy efficiency of the device, the quality of voice calls and even the operation of some applications.

In this article, we will understand how the proximity sensor in Xiaomi smartphones (including Redmi models) works, POCO And you'll learn how to test the sensor yourself, adjust its sensitivity, and fix the typical problems, from software glitches to hardware breakdowns. Particular attention will be paid to the differences between infrared and capacitive sensors, as well as the nuances of their operation in devices with a high-performance system. AMOLED-screen.

The device and principle of operation of the proximity sensor

The proximity sensor in Xiaomi smartphones is a compact electronic module that detects the presence of an object (like your head) near the top of the device. Most models use an infrared (IR) sensor consisting of two key elements:

  • πŸ”¦ Emitter – LED emitting infrared rays (invisible to the human eye).
  • πŸ‘οΈ Receiver - photodiode that captures the infrared signal reflected from the object.

When you hold the phone to your ear, the infrared beam bounces off the surface of your head and returns to the receiver. The microcontroller analyzes the strength of the reflected signal and, if it exceeds a predetermined threshold, sends a command to turn off the screen and touch layer, which takes a split second and operates completely autonomously without loading the main processor.

Some budget models (e.g. Redmi 9A or POCO C31) can use a capacitive sensor that responds to changes in the electrostatic fieldnear surface of the screen, which is cheaper to produce, but less accurate and often gives false positives when moisture is ingested or protective glasses are used.

πŸ“Š What type of proximity sensor in your Xiaomi?
Infrared (IR)
Capacitive
I don't know.
I'm a different brand.

Where is the proximity sensor in Xiaomi

In most Xiaomi smartphones, the proximity sensor is integrated into the top of the display, next to the front camera and speaker.

  • πŸ“± In notch devices (e.g. Xiaomi Mi 11, Redmi Note 10 Pro) the sensor is on the left or right of the camera.
  • πŸ–₯️ In the hole-screen models (POCO F4, Xiaomi 12T) β€” sensor hidden under the display in the upper central part.
  • 🌊 In smartphones with a full-screen design (Xiaomi Mix 4) – the sensor can be combined with a subscreen camera.

To accurately determine the location of the sensor on your model, use the test mode:

  1. Open the Phone app and enter the code ##6484## (for some models, #4636###).
  2. Select the Hardware Testing option β†’ Proximity Sensor.
  3. Close the sensor with your hand – the value of 0 (object detected) or 1 (no obstacles) should appear on the screen.

πŸ’‘

If the test code doesn’t work, try installing the Phone INFO app β˜…Samsungβ˜… (although it’s called Xiaomi) from Google Play, which has a Sensors section with detailed sensor information.

Why you need a proximity sensor: key functions

The main purpose of the proximity sensor is to prevent accidental taps during a conversation, but its role in the smartphone ecosystem is much broader:

FunctionHow it works.Examples of use
Screen shutdownThe screen goes out when approaching the ear, saving battery power.Calls, voice messages on WhatsApp.
Sensor lockingTurns off touches to avoid pressing buttons with the cheek.Voice chat games, video calls.
Optimization of soundActivates the "talk speaker" mode for better audibility.Calls in noisy places (streets, transport).
Accessories workRecognizes magnetic lock cases or wireless charging.Automatic on/off when opening the cover.

Xiaomi’s MIUI 13+ smartphones also use the proximity sensor for the Settings β†’ Display β†’ Ambient display β†’ Lift to wake function. When you bring your hand to the top of the screen, the system recognizes the gesture and turns on the display without pressing the buttons.

Some apps, like Google Assistant or Xiaomi AI Voice, also rely on the proximity sensor to activate voice control, for example, if you hold your phone to your ear and say, "OK, Google," the assistant will turn on even with the screen locked.

Typical malfunctions of the proximity sensor and their causes

If the proximity sensor has stopped working, this may occur as follows:

  • πŸ“΅ The screen does not go out during the call (remains active, leading to occasional taps).
  • πŸ”„ The screen spontaneously turns on/off in a pocket or bag.
  • 🎧 The β€œRise to Awaken” function does not work.
  • πŸ”Š The sound from the speaker switches to the spoken for no reason.

The causes of problems can be divided into software and hardware:

Type of malfunctionPossible causesHow to eliminate
ProgrammaticMisfired MIUI after the update, conflicts with applications (e.g. launchers), incorrect sensitivity settings.Resetting, flashing, sensor calibration.
Hardware.Sensor contamination or damage (dust, moisture) detachment of sensor plume after falling, failure of infrared emitter.Cleaning, replacing the sensor or plume in the service center.
What to do if the sensor is triggered in your pocket?
If the screen is turned on in your pocket due to false sensor positives, try: 1. Turn off the "Raise to wake up" function in the screen settings. 2. Install the Proximity Sensor Reset app from Google Play to calibrate the sensitivity threshold. 3. Use a magnetic lock case - it locks the screen when closed.

How to check the proximity sensor on Xiaomi

Before you bring your phone to the service, do the diagnostics yourself. Here is a step-by-step instruction:

Enable Engineer Mode (#6484##)

Select Proximity Sensor from the test menu

Close the sensor with your hand – the value should change from 5 to 0

Check the screen response during the call simulation (type ##4636## β†’ Usage statistics β†’ Phone information β†’ Run ping test)

-->

If the test code does not work, use third-party utilities:

  1. CPU-Z (Sensors section) – shows the status of all sensors in real time.
  2. Sensor Test is a specialized application for checking sensors.
  3. MIUI Hidden Settings – reveals additional MIUI settings, including sensor calibration.

Pay attention to the sensor values:

  • 🟒 0 - object detected (sensor closed).
  • πŸ”΄ 5 - no obstacles (sensor open).
  • ⚠️ -1 or null – the sensor is faulty or disabled.

πŸ’‘

If the sensor shows a value of 0 even when nothing closes the sensor, this indicates sticking (typical for devices after moisture hits).

How to Calibrate the Approximation Sensor on Xiaomi

If the sensor is unstable (for example, the screen goes out with a delay or fires too early), it can be recalibrated.

  1. Install the Proximity Sensor Reset app from Google Play.
  2. Run it and press Calibrate.
  3. Follow the instructions on the screen: first close the sensor with your hand, then remove it.
  4. Reboot your smartphone.

For manual calibration through the engineering menu:

  1. Enter the code ##36446337## (for some models, #4636###).
  2. Go to Hardware Testing β†’ Sensor β†’ Proximity Sensor.
  3. Press Calibration and perform the procedure.

If the calibration didn’t help, try resetting MIUI settings:

  1. Open Settings β†’ About Phone β†’ Backup & Reset
  2. Select Erase all data (factory reset).
  3. After reset, check the sensor before recovering data from the backup (sometimes old settings conflict).
fastboot devices


fastboot erase persist

Attention!

What to do if the proximity sensor is not working

If the diagnosis showed that the sensor is defective, act on the algorithm:

⚠️ Warning: Don't try to disassemble your smartphone yourself unless you have experience with microelectronics.The proximity sensor at Xiaomi is often soldered to the motherboard, and replacing it requires a soldering station and an accurate tool.

  • πŸ”§ Software methods: Update MIUI Up to the latest version (Settings) β†’ About phone β†’ Remove recently installed applications (especially launchers and optimizers). Reset via Fastboot (fastboot erase persist command).
  • πŸ› οΈ Hardware methods: Clean the top of the screen from dust and dirt (use a soft brush or compressed air). Check the integrity of the sensor plume (disassembly required). Replace the sensor at an authorized service center (cost from 800 to 2500 rubles depending on the model).

If the sensor is physically damaged, but you do not want to spend money on repairs, you can turn it off programmatically:

  1. Install the Button Mapper app.
  2. Create a rule: when an incoming call, the screen goes out after 2 seconds (simulate the operation of the sensor).
  3. Use a headset with a microphone to avoid accidental taps.

For models with AMOLED-There is an alternative way to use the Always-on Display feature in the Notifications Only mode (for example, Xiaomi 13 Ultra), which will reduce the risk of accidental touches, but will not replace the full operation of the sensor.

FAQ: Frequent questions about the proximity sensor in Xiaomi

Why does the proximity sensor work when I’m just holding my phone in my hand?
This is a typical problem for capacitive sensors in budget models (e.g. Redmi 9C), because the sensor is sensitive to hand heat. Solution: Reduce sensitivity through the engineering menu (code ##6484##). Turn off the "Raise to wake up" function in the screen settings. Use a magnetic lock case, it blocks false positives.
Can I replace the sensor by myself?
Theoretically, yes, but in practice, it's extremely difficult: Most Xiaomi models have a sensor soldered to the motherboard. You need a specialized tool (sweeping station, microscope), the risk of damaging the screen plume or other components. If you don't have experience, you better contact the service. The cost of replacing in official Xiaomi centers is from 1500 rubles.
Why did the MIUI update stop working?
This is a common problem with: firmware errors (especially in beta versions of MIUI); conflict with user settings (such as modified access rights); sensor calibration reset. Solution: Reverse to the previous version of MIUI via Fastboot. Reset via Settings β†’ About phone β†’ Backup & reset. Contact Xiaomi with error logs (can be obtained through the Logcat app).
Does the protective glass affect the approach sensor?
Yes, but only in three cases: If the glass covers the sensor area (especially for models with a cutout); If you use metallized or too thick glass (more than 0.3 mm); If you get moisture or dust under the glass that blocks the infrared signal; Solution: use glass with a cutout for the sensor or thin flexible films.
Can I turn off the proximity sensor completely?
Technically, yes, but it would lead to: Constantly switching on the screen during calls (battery discharge), random taps of the cheek or ear, incorrect operation of voice assistants. If you still need to turn off the sensor: Set up the sensor: ADB Connect your phone and execute the command: adb shell settings put global proximity_sensor_enabled 0 Reboot the device. To get it back, use the same command with a value. 1 instead 0.