Approximation Sensor on Xiaomi 12: Full configuration and troubleshooting

Xiaomi 12 is a flagship smartphone with advanced hardware, but even in such a device can have problems with the proximity sensor. This small but important sensor is responsible for turning off the screen during phone conversations, preventing accidental pressing of the cheek or ear. However, users often find that the screen does not go out when you bring the phone to the ear, or vice versa β€” does not turn on after the call is completed. In this article, we will discuss how to properly configure the proximity sensor on Xiaomi 12, calibrate it manually and fix typical malfunctions.

Proximity sensor problems can be caused by software failures (e.g., after a MIUI update) and hardware defects (sensor contamination, plume damage).We will look at all possible diagnostic and solution methods, from basic settings to hidden engineering menus. We will focus on sensor calibration, which often solves the problem without going to the service center.

If you notice that the Xiaomi 12 screen is unpredictable during a call, whether it turns on/off spontaneously or does not react to an approach, don’t rush to carry the phone for repair. In 80% of cases, the problem can be fixed by yourself following our recommendations. And for those who like to dig deeper, we will reveal the secrets of the engineering menu and sensor testing through ADB.

What is a proximity sensor and how it works on Xiaomi 12

The proximity sensor is an infrared sensor located at the top of the Xiaomi 12 screen (near the speaker and the front camera), its main task is to detect when the phone is near the ear or other object, and automatically turn off the screen light during a call.

  • πŸ“± Accidental taps on the screen with the cheek or ear
  • πŸ”‹ Unnecessary battery consumption (screen is one of the main consumers of energy)
  • 🀯 Discomfort from the screen on during a conversation

The Xiaomi 12 uses an infrared proximity sensor that emits invisible light and analyzes the reflected signal. If an object (such as an ear) is too close, the sensor sends a command to the system to turn off the display. Once the object is removed, the screen is turned on again, ideally this process should be instantaneous, but in practice users often face delays or false positives.

It's important to understand that the proximity sensor works in tandem with a light sensor (which regulates the brightness of the screen). Sometimes failures in one sensor can affect the other. For example, if the light sensor is contaminated, this can lead to a malfunction of the proximity sensor. On Xiaomi 12, both sensors are located in the same module, so their cleanliness and serviceability are critical.

⚠️ Attention: If the proximity sensor stopped working after the phone fell or moisture hit, the problem is likely hardware.

Signs of malfunctioning proximity sensor on Xiaomi 12

How do you know if your Xiaomi 12’s proximity sensor isn’t working properly?

  • πŸ“΅ The screen does not go out during the call, even when the phone is held to the ear.
  • πŸ”¦ The screen does not turn on after the conversation is over (you have to press the power button)
  • πŸ€– The sensor is triggered arbitrarily – the screen goes out for no reason or flashes during a call.
  • πŸ“± In some applications (for example, in messengers for voice messages), the screen behaves unpredictable.
  • πŸ”§ After updating MIUI sensor stopped responding to the approach

If you see any of these signs, it means that the sensor needs adjustment or diagnosis, but before you start calibrating, make sure that the problem is not with the protective film or the case, because too thick film or a case with high sides can block the infrared signal of the sensor, which causes it to fail.

It is also worth checking whether Do Not Disturb or Save Battery is activated, some users confuse their effect with a sensor malfunction, for example, in Extreme Saving mode, the system can turn off sensors to reduce power consumption.

πŸ“Š What problems do you have with the proximity sensor?
The screen does not go out during the call.
The screen will not turn on after the call.
False positives (screen goes out for no reason)
Sensor's working fine.
Another problem.

Basic setting of the proximity sensor through the Xiaomi 12 menu

Before you start to make complex manipulations, try the basic settings. In most cases, the problem is solved through the standard Xiaomi 12 menu.

  1. Open the Settings β†’ Screen.
  2. Scroll down and find the Automatic Screen Shutdown (or Approach Sensor in some versions of MIUI).
  3. Make sure the switch is activated. If it's not activated, move on to the next step.
  4. Go back to the main Settings menu β†’ Applications β†’ Application Management.
  5. Find the Phone app and open its settings.
  6. Check Permissions: The app must have access to body sensors and phone calls.

If your version of MIUI doesn't have an explicit point to adjust the proximity sensor, it doesn't mean it doesn't. The manufacturer often hides these options in the engineering menu. But before you climb in, try resetting the screen settings:

  1. Go to Settings β†’ System β†’ Resetting settings.
  2. Select Reset screen settings (not to be confused with a full reset!).
  3. Confirm the action and restart the phone.

This method helps in 30% of cases when the failure is caused by a configuration conflict after the update. If the problem persists, proceed to calibration.

β˜‘οΈ Preparation for calibration of the proximity sensor

Done: 0 / 4

Calibration of the proximity sensor through the engineering menu

If the basic settings didn't work, it's time to move on to calibrating the sensor, and for that, we're going to need the Xiaomi 12 engineering menu, which is hidden from the general public, and there are two ways to get there: through code or through ADB. We'll look at both.

Method 1: Through Secret Code (Simple Method)

The fastest way to open the engineering menu is to enter a special code in the Phone app:

  1. Open the standard phone application.
  2. Go to the keyboard tab (as if you are going to dial a number).
  3. Enter the code: ##6484## or #4636###.
  4. If the code works, you will see the Testing menu or the Engineering menu.

If the code doesn't work, your version of MIUI is blocking this method, so use method 2 with ADB.

Method 2: ADB (for advanced users)

For this method, you'll need a computer with ADB drivers installed and USB debugging enabled on your phone.

  1. Activate Developer Mode: Go to Settings β†’ About Phone β†’ Click 7 times on the MIUI version.
  2. Return to Settings β†’ Additional β†’ For developers and enable USB debugging.
  3. Connect Xiaomi 12 to your computer and confirm the debugging permission.
  4. Open the command prompt (or Terminal on Mac/Linux) and type:
adb shell am start -n com.android.settings/.DevelopmentSettings

After completing the command, the developer menu will open, where you can find additional options for testing sensors.

When you're in the engineering menu, look for the Proximity Sensor section, and here you'll see the current sensor readings in real time.

  1. Press Calibrate (or Calibration).
  2. Follow the instructions on the screen: usually you need to close and open the sensor with your hand.
  3. After completion, save the settings and restart the phone.

⚠️ Attention: Incorrect calibration may worsen the sensor. If the problem worsens after the procedure, reset the screen settings (described above) and recalibrate.

What to do if the engineering menu is not opened?
If none of the codes worked and the ADB issues an error, it could mean that the manufacturer has blocked access to the engineering menu in your firmware. In this case, two options remain: 1. Update MIUI to the latest version (sometimes access is returned). 2. Use third-party applications for testing sensors, such as Sensor Test or Phone Doctor Plus (available on Google Play).

Checking the proximity sensor with third-party applications

If you don't want to mess around with the engineering menu or it's not available, you can use third-party tools to diagnose the sensors, and they show real data from the sensors and help you see if the proximity sensor is working.-3 apps 12:

AnnexFunctionsReference
Sensor TestIt shows the values of all sensors in real time, including the approximation, and there's a validation test.Google Play
Phone Doctor PlusFull phone diagnostics, including sensor, screen, battery tests, suitable for detecting hardware problems.Google Play
CPU-ZIt shows the phone's specifications, including sensor information, and it's useful for checking if they're in the system.Google Play

How to use the Sensor Test to check the proximity sensor:

  1. Install and open the application.
  2. Go to the Proximity tab (or Approximation Sensor).
  3. Look at the current value. Usually 0 means there are no objects nearby, and 1 or 5 (depending on the model) means that the object is detected.
  4. Close the sensor with your hand, the value should change, and if it stays 0 or changes unstablely, the sensor is defective.

If the app shows that the sensor is working correctly, but the problem during calls remains, it is likely that the firmware or conflict with another application (for example, with a launcher or a Magisk module, if you have root).

πŸ’‘

If the proximity sensor is working too late (the screen is going out with a delay), try turning off animations in the developer settings. To do this, go to Settings β†’ For developers and set all three animation options (Animation Score, Transition Animation Score, Animation Duration Duration Scale) on Off..

Fixing software failures: reset, update, and clean firmware

If the calibration and application testing didn't work, the problem could be in the software.

  • πŸ”„ Update. MIUI Sensor bugs are often fixed in new builds. Check the updates in Settings. β†’ The phone. β†’ Updating the system.
  • 🧹 Clear the cache. Go to Settings. β†’ Memory. β†’ Clear the cache. It won't delete your data, but it can solve the problem with the sensor hanging.
  • πŸ“² Reset the settings of the Phone app. Go to Settings. β†’ Annexes β†’ Application management β†’ Phone. β†’ Warehouse β†’ Clear the data. Attention: this will delete the call history!
  • πŸ”§ Perform a factory reset (last resort). Pre-backup data through Settings β†’ The phone. β†’ Backup.

If you use custom firmware (like LineageOS or Pixel Experience), the problem may be building it. Try flashing your phone to an official MIUI via Fastboot or Mi Flash Tool. Firmware instructions can be found on the Xiaomi.eu or 4PDA forums.

It's also worth checking if the sensor is in conflict with the Magisk or Xposed modules installed. Turn off all modifications and check the sensor's performance. If the problem is gone, turn on the modules one by one to find the culprit.

πŸ’‘

Before resetting to factory settings, make sure to check if your contacts are saved to your Google or Mi Cloud account.

Hardware problems: when you need to replace the sensor

If all software methods have been tried, but the proximity sensor on the Xiaomi 12 still doesn’t work, it’s probably a hardware problem.

  • πŸ’§ Moisture infestation – even if the phone hasn’t sunk, condensation or high humidity can damage the sensor.
  • πŸ’₯ Hit or fall – the sensor may move away from the board or the plume may be damaged.
  • 🧴 Sensor contamination – dust, fat, or adhesive residue from the film blocks the infrared signal.
  • πŸ”Œ Problems with the plume – oxidation or break of contacts on the flexible plume of the sensor.

It is difficult to diagnose a hardware malfunction on your own, but you can try the following:

  1. Carefully clean the sensor area (top of the screen) with an alcohol wipe.
  2. Light a flashlight on the sensor – if it is contaminated, you will see stains or stains.
  3. Check if the top of the screen is moving away (sometimes after the display is replaced, the sensor stops working due to improper assembly).

If you suspect a hardware breakdown, it is better to contact the service center.Replacement of the proximity sensor on Xiaomi 12 is inexpensive (from 800 to 1500 rubles depending on the region), but requires accuracy - the sensor is soldered to a flexible plume, which is easy to damage if unqualified repair.

⚠️ Warning: If you choose to replace the sensor yourself, buy only original parts. Cheap Chinese counterparts often have incompatible connectors or incorrect calibration, which will lead to repeated failures.

FAQ: Frequent questions about the proximity sensor on Xiaomi 12

πŸ” Why the proximity sensor only works in some applications?
This is because not all apps are properly processing sensor signals. For example, on WhatsApp or Telegram, when you're talking to voice, the screen might not go out because those apps aren't optimized to work with Xiaomi sensors. Solution: Update the app to the latest version. Check the app's settings -- sometimes there's an option to "turn off the screen while you're calling." Use the standard Phone app for calls -- it's guaranteed to support the proximity sensor.
πŸ“± Can I turn off the proximity sensor on Xiaomi 12?
Technically, but it's not recommended. Turning off the sensor will keep the screen on during calls, which: Increases the risk of accidental tapping (e.g., ending the bell with the cheek); increases battery consumption; can cause discomfort from the backlight of the screen near the ear; if you still need to turn off the sensor, do it through the engineering menu (described above) or using the Sensor Disabler app (root required).
πŸ”§ After updating MIUI The sensor stopped working?
This is a typical problem after major updates. Try: Clear the system cache (Settings β†’ Memory β†’ Clear cache); Reset the phone app settings (as described above); Calibrate the sensor through the engineering menu; If nothing helps, roll back to the previous version of MIUI or wait for a patch from Xiaomi.
πŸ’‘ The screen goes out too late (with a delay) How to speed up the reaction?
The delay in the approach sensor response can be related to: System animations (turn them off in the developer settings); CPU load (close the background applications); improper calibration (repeat the procedure); Protective film or case blocking the signal; also try to turn on No Animations mode in special features settings (Settings β†’ Special features β†’ No animations).
πŸ› οΈ How much does it cost to replace the proximity sensor on Xiaomi 12?
The cost of replacement depends on the region and the service center: Official Xiaomi service: 1200-2000 rubles (with spare parts). Informal workshops: 800-1500 rubles. Self-replacement: 300-600 rubles (the cost of a sensor on AliExpress) + the risk of damage to the plume. Repair usually takes from 30 minutes to 2 hours. Before replacing, make sure that the problem is in the sensor, not in the plume or firmware.