Checking the proximity sensor on Xiaomi Mi 9S: from diagnosis to repair

The proximity sensor in the Xiaomi Mi 9S (the cepheus model) is responsible for turning off the screen during a phone conversation when you bring the device to your ear. If it fails, the screen can go out arbitrarily, not react to a closeup or, conversely, remain active during a call - which leads to accidental pressing. The problem is relevant for 15-20% of owners after 2-3 years of use, especially if the smartphone has been subjected to falls or moisture.

In this article, you will find 5 proven diagnostic methods, from software tests to physical inspection of the sensor, as well as instructions for calibration and repair, we will understand how to distinguish hardware failure from firmware failure, and what to do if the sensor stopped working after the MIUI update.

⚠️ Attention: On Xiaomi Mi 9S proximity sensor combined with illumination (module) STK3338). If the automatic brightness adjustment does not work, the problem is precisely in the hardware part - a replacement of the module or soldering of contacts is required.

Before you start checking, make sure that there is no protective film or glass on the screen that blocks the sensor's infrared signal, and also turn off the energy saving modes, which can affect the operation of the sensors.

Quick check through the engineering menu (##6484##)

The most reliable way to test the proximity sensor is to use Xiaomi’s hidden engineering menu, which is available on all Qualcomm Snapdragon processor devices, including the Mi 9S.

Open the phone app and enter the combination:

##6484##

The Hardware Test menu will then automatically open. Select Proximity Sensor. When you approach the top of the screen (where the sensors are located), the value should change from 5.0 cm to 0.0 cm, and the background of the screen should turn green.

⚠️ Warning: If the values don't change or if the Sensor failed error is displayed, this indicates a hardware failure.Try to restart the phone and repeat the test - sometimes resetting the sensor cache via fastboot helps.

In addition, you can check in this menu:

  • πŸ”¦ Light Sensor – Values should change when lighting changes.
  • πŸ“ž Automatically turn off the screen during a call (Call Test item).
  • πŸ”„ Calibration – If the values float, press Calibrate (root rights required).

Check for protective film |Reboot phone |Protest in safe mode |Reset sensor settings via ADB

-->

2. Application Verification (CPU-Z)

If the engineering menu is not available (for example, after the update) MIUI), Use third-party utilities. Best options for Xiaomi Mi 9S:

1. Sensor Test (from Innovative Apps)

Download the app from Google Play and select the "Proximity" tab. Real-time displays:

  • πŸ“Š Current distance (in cm).
  • πŸ”„ Sensor status (NEAR or FAR).
  • ⚑ Reaction time (should be) < 200 ms).

πŸ“Œ If the values constantly show 0.0 cm or 5.0 cm unchanged, the sensor is defective.

2. CPU-Z

In the Sensors section, look for Proximity, which shows the raw sensor data, and the normal readings for the Mi 9S:

  • πŸ”Ή Far from obstacles: 5.0 cm.
  • πŸ”Ή At arm approach: 0.0 cm.

⚠️ Attention: Some applications (e.g, AIDA64) They may not be able to show the sensors on MIUI Because of the limitations of the system. ADB (section).

Engineering menu|Sensor Test Application|Teams. ADB|Physical examination-->

3. Test during the call (practical method)

The easiest way to check the sensor is to call another phone and watch the screen behavior.

  1. Call another number (or use a voice assistant).
  2. Put your phone to your ear, the screen should go out instantly.
  3. Take the phone away - the screen should turn on in 0.5-1 seconds.
  4. Repeat 3-5 times, changing the angle of inclination.

πŸ” Signs of malfunction:

  • πŸŒ‘ The screen doesn't go out when you approach.
  • πŸ”¦ The screen goes out with a delay (> 1 second) or arbitrarily.
  • πŸ“΅ The screen does not turn on after the phone is withdrawn.
  • πŸ”„ During the call, the screen spontaneously turns on / off.

If the problem only occurs during calls, check your settings:

  1. Open Settings β†’ Applications β†’ Phone β†’ Permissions.
  2. Make sure the β€œChange System Settings” permission is enabled.
  3. Go to Settings β†’ Screen β†’ Autoturn and turn it off during the test.
What to do if the screen goes off too fast?
This may be due to the sensor's hypersensitivity. Try calibrating it through the engineering menu (##6484###) or editing the file /system/build.prop by adding the string ro.lge.proximity.delay=25 (root required). If that doesn't help, the problem is the firmware - try rolling back to the older version of MIUI.

4. Check through ADB (for advanced users)

If standard methods fail, use Android Debug Bridge (ADB), which is suitable for system-level diagnostics and allows you to get raw data from the sensor.

πŸ“Œ Preparation:

  1. Enable Developer Mode: Settings β†’ About Phone β†’ MIUI version (click 7 times).
  2. Activate "Debugging by" USBΒ» In Settings β†’ Additionally. β†’ For developers.
  3. Connect your phone to your PC and install ADB drivers (download from the XDA Developers website).

πŸ’» Test teams:

adb shell


su




cat /sys/class/sensors/proximity/proximity_raw

In normal condition, when approaching the hand to the sensor, the value should change from 5 to 0. If the output is empty or shows an error, the sensor is faulty.

πŸ”§ Additional teams:

Team team.Description
dumpsys sensorserviceShows all active sensors and their status.
getevent -lIt displays sensor events in real time.
echo 1 > /sys/class/sensors/proximity/proximity_enableForced to turn on the sensor (root required).
cat /proc/versionChecks the kernel version (useful for compatibility diagnostics).

πŸ’‘

If ADB does not recognize the device, try reinstalling the drivers in Device Manager (select Mi ADB Interface manually).

5. Physical check of the sensor (disassembly of the phone)

If software methods don't work, you'll have to look at the sensor visually, and on the Xiaomi Mi 9S, it's located at the top of the screen, next to the speaker and the front camera, and you'll need to take off the display module to access it, which is a complex procedure that requires experience and special tools.

πŸ› οΈ Essential tools:

  • πŸ”§ Setting screwdrivers T3, T5.
  • 🧲 Screen suction cup.
  • πŸ”₯ Fryer (for softening glue).
  • πŸ“ Plastic mediators.

πŸ” What to check:

  1. Integrity of the plume - often it is rubbed or moves away from the connector.
  2. Sensor pollution – dust or moisture can block the infrared signal.
  3. Salting contacts - there should be no microcracks on the board (use a magnifying glass).
  4. Glass over the sensor – cracks or chips can distort the signal.

⚠️ Note: If you do not have experience in dismantling smartphones, it is better to contact the service center. 9S β€” From 1,500 to 3,000 rubles (depending on the region) self-repair can damage the plume of the display or motherboard.

πŸ’‘

On the Xiaomi Mi 9S, the proximity and illumination sensor is combined into one module (STK3338). If both sensors are not working, the entire module needs to be replaced, rather than a single element.

Calibration of the sensor (if it is not operating in a stable manner)

Sometimes the proximity sensor will fail after updating the MIUI or resetting the settings, in which case calibration will help.

1.Using the engineering menu

  1. Open ##6484##.
  2. Select Proximity Sensor.
  3. Press Calibrate (if the button is active).
  4. Follow the instructions on the screen (usually you need to bring your hand closer and away 3-5 times).

2. via ADB (root required)

adb shell


su




echo "1" > /sys/class/sensors/proximity/proximity_calibrate

3. Reset sensor settings

  1. Go to Settings β†’ System β†’ Resetting settings.
  2. Select β€œReset App Settings” (does not delete data).
  3. After restarting, check the sensor again.

⚠️ Note: If the calibration does not help, and the sensor in the engineering menu shows incorrect values (for example, 2.5 cm instead of 0.0 cm), the problem is hardware - a replacement is required.

7. Frequent causes of sensor breakdown on Xiaomi Mi 9S

Analysis of service centers shows that 70% of the Mi 9S proximity sensor failures are due to the following factors:

  • πŸ’§ Moisture intrusion - even a small amount of condensate under the glass can block the infrared signal. check the moisture indicator (red dot under the tray) SIM-map).
  • πŸ“± Falls and impacts – the sensor is located next to the front camera, and when falling on the screen often suffers its plume.
  • ⚑ Unstable Firmware – After Updating to MIUI 12.5+ Some users are experiencing software failures of the sensor. MIUI 12.0.3.0.
  • πŸ”‹ Overheating – if the phone is frequently heated (such as when playing), the sensor may temporarily shut down. AIDA64.
  • πŸ› οΈ Poor-quality repairs – after replacing the screen, the master sometimes forgets to connect the sensor plume or damage it.

πŸ“Š Breakdown statistics (according to service centers, 2023):

Reason.Proportion of casesCost of repair
Fall/impact45%1 500–3 000 β‚½
Moisture/condensate25%2 000–4 000 β‚½
Firmware failure15%Free (flashing)
Wear of the plume10%1 000–2 500 β‚½
Factory marriage5%Guarantee.

FAQ: Frequent questions about the proximity sensor on Xiaomi Mi 9S

πŸ”Ή Why the proximity sensor only works after a reboot?
This is a typical sign of a driver failure or module overheating. Try: Reverse to the previous version of MIUI. Clear the cache via Recovery (Wipe Cache Partition). Check the temperature of the phone - if it warms above 50 Β° C, the sensor may shut down. If the problem remains - it's a hardware failure (for example, a microcrack on the board).
πŸ”Ή Can I turn off the proximity sensor if it interferes?
Yes, but it's not recommended -- the screen will remain active during calls, which will lead to accidental taps. If you still need to turn off: Install Xposed Framework and Disable Proximity Sensor. Use Tasker to create a rule to turn off the sensor under certain conditions. Edit the file. /system/build.prop, Add the line ro.lge.proximity.delay=999999 (root). ⚠️ After the sensor is turned off, the battery will discharge faster due to constant screen activity.
πŸ”Ή Sensor works, but the screen does not go out during the call – what is the matter?
The problem might be in: πŸ“± Settings of the Phone application - check the permissions. πŸ”„ Conflict with other applications (such as Truecaller or Call Recorder). πŸ› οΈ Damage to the backlight plume (the screen does not go out physically) Solution: Launch the phone in safe mode and check the sensor. Reset the settings of the Phone application in Settings β†’ Annexes β†’ Phone. β†’ Warehouse β†’ Check the sensor in another call app (e.g. Google Phone).
πŸ”Ή After the screen was replaced, the sensor stopped working – what to do?
It's one of the most common problems: πŸ”Œ The sensor plume is not connected (often forgotten during assembly). πŸ”§ Damaged connector on the motherboard. πŸ“± There's a non-original screen with no sensor cutout. Solution: Take the phone apart and check the plume connection. If the connector is damaged, soldering is required. ~2 000 β‚½). If the screen is not original, replace it with the original one (with a sensor). STK3338).
πŸ”Ή How to check the proximity sensor without a call?
Use one of the applications: πŸ“Š Sensor Test (Shows values in real time). πŸ” Phone Tester (Proximity tab). πŸ’‘ CPU-Z (Sensors section. You can also use commands. ADB (section 4) or engineering menu (#6484##).