Approximation Sensor on Xiaomi: Device, Calibration and Problem Solving

Owners of Xiaomi smartphones often face a situation when the screen goes out or, conversely, does not turn off during a conversation. This function is responsible for a special hardware module that responds to the proximity of objects to the top of the case. Understanding the principles of its operation is necessary for every user who wants to customize the gadget for himself or eliminate interface malfunctions.

Modern devices in the Redmi, Poco and Mi series use different distance detection technologies, which sometimes causes confusion when finding solutions. In this article, we will discuss in detail how the touch system in your phones works, why it can crash, and what hidden tools MIUI offers for fine-tuning.

We're going to look at not only software methods for fixing bugs, but also physical designs, which will help you distinguish a software bug from a hardware breakdown and make the right decision about whether to go to the service center.

The principle of operation and types of sensors in Xiaomi smartphones

The main purpose of this component is to inform the operating system that the phone is held to the ear. At this point, Android blocks the touchscreen and extinguishes the display, preventing accidental pressing of the cheek or ear. Xiaomi devices most often use infrared sensors consisting of an emitter and a receiver.

But depending on the model and year of production, engineers use different solutions. Budget models often have a virtual sensor that uses artificial intelligence algorithms and accelerometer data, which has no physical hole on the body and operates programmatically, sometimes leading to reaction delays.

More advanced models come with physical sensors hidden under the screen or in a narrow frame, which provide instantaneous response, but require perfect surface cleanliness, and if you see a little black window next to a speaker, you have a classic hardware implementation.

  • πŸ“‘ Infrared sensor – a classical scheme with the emission of invisible light.
  • πŸ€– Virtual sensor – a software algorithm that analyzes the position of the phone.
  • πŸ’‘ Ultrasonic module – a rare technology that uses sound waves (found in flagships).
πŸ“Š What type of sensor does your Xiaomi have?
Physical (there's a hole)
Virtual (no hole)
I don't know/ I didn't notice.
I'm always sluggish.

It's important to understand that software is constantly polling this module, and if a MIUI system crashes, the phone can "think" it's in your pocket, even when you're on the table, which is why it's critical to be able to use it properly.

Signs of malfunction and program failures

It's easy to tell if the distance module is having problems by the symptoms, and most people complain that the screen doesn't go out during the call, and the cheek resets calls or the speakerphone is on, which is a classic sign of sticking or a software error.

The reverse situation, where the screen goes out immediately after the conversation starts and doesn't light up even if you remove the phone from your ear, also indicates a problem, in which case the system misinterprets the data, believing that the object is still in close proximity to the sensor.

⚠️ Note: If the screen goes out only in the presence of protective glass or a cover covering the upper part of the body, this is not a breakdown, but a physical obstacle to IR rays.

Sometimes the problem is application conflict: Third-party programs for calling or cleaning memory can intercept the control of the sensor. Before starting a deep diagnosis, it is recommended to check whether you have recently installed questionable utilities from unreliable sources.

There is also a risk of software bugs after a firmware update, where developers may incorrectly optimize drivers for a particular model, leading to chaotic interface behavior, in which case waiting for a patch or a rollback to a previous version of the software helps.

Diagnostics and testing through the engineering menu

The first step in troubleshooting should be to check the equipment with Xiaomi’s built-in tools, and there’s a dedicated engineering menu available on all the brand’s devices that allows you to test each component individually.

To enter the diagnostic mode, you need to open the standard Phone application and type a special code. Most models use the command ##6484##. After entering the characters, the CIT menu will open, where the full list of tests is presented.

What if the code doesn't work?
Some global firmware versions may have their code blocked, so try Settings β†’ About Phone β†’ Kernel Version (click 7 times). If that doesn’t work, install the Engineering Mode Calculator app from the Play Market Store.

In the test list, find the item associated with the proximity sensor. It's usually called or has an icon that looks like a sensor. When you click on it, you'll see the numerical values. Put your palm to the top of the screen, the values should change, and the indicator should switch from Far (far) to Near (close).

  • πŸ” Find the Proximity Sensor test in the list.
  • πŸ–οΈ Close the top of the screen with your palm.
  • πŸ“‰ Watch for changes in values in real time.
  • βœ… Make sure that the status changes clearly and without delay.

If the test values don't change or change randomly without touching, the problem can be hardware, but if the test is successful, but the phone is acting strangely in life, then software calibration or resetting is required.

Calibration of the proximity sensor on Xiaomi

Calibration is the process of "training" a system to correctly define the boundaries of distance, often after replacing the screen or protective glass, the standard settings are confused, and the phone stops responding correctly.

You can do this on your own. You can do this on your own.

There are two main ways to calibrate: through the engineering menu (described above) and through the hidden Android menu. In the second case, you need to dial the code ##7780## or go to the settings through the developer menu, although this path is often closed on new versions of MIUI.

β˜‘οΈ Algorithm of correct calibration

Done: 0 / 4

The most reliable method is to use the test in the CIT menu. Select the proximity sensor test and press the "Calibration" button. You will be asked to close the sensor (usually a black spot appears or you ask to close with your hand) and then open it. The system will record the new thresholds.

⚠️ Attention: During calibration, make sure that there are no dust, greasy spots or cracks in the upper speaker area on the screen, as this will distort the setting results.

Once the procedure is completed, the phone will automatically restart or prompt you to do so. Check the sensor in normal call mode. If the problem persists, you may need to reset data or deeper intervention.

Hidden settings and disabling the function

Some users prefer to turn off the sensor completely so that the screen never goes out. Xiaomi officially does not provide such a button in the usual settings, but there are workarounds. One of them is the use of special applications from Google Play, such as "Proximity Sensor Reset/Fix".

A more advanced method involves the use of debugging by USB and ADB-You can also try to activate the developer mode. β†’ About the phone and quickly press 7 times on the item "Version" MIUI".

In the Developer menu that opens, you can sometimes find a Quick Start or sensor settings option (depending on the Android version), but most often you need to enter a command through the terminal to completely disable it, for example, a command can look like changing the value in the settings database.

πŸ’‘

If you want to just reduce sensitivity, try removing the protective glass. Thick glass or glass with a black frame often block the IR radiation, causing false positives.

It’s worth remembering that completely disabling the sensor makes it impossible to use the Pocket Mode feature, which locks the screen in the bag, which can lead to battery drain and occasional calls when the phone is in your pocket.

Hardware causes and physical maintenance

If software methods don't work, it's inside the case. A common problem with Xiaomi's budget models is that the sensor plume shifts when it falls or fails to build properly, and in these cases, the sensor simply doesn't see anything because it's shifted away from its work window.

Another common cause is pollution, which eventually gets dust, skin fat and pile from your pockets into the sensor hole, which creates a permanent barrier to IR rays, and careful brushing with a toothbrush or using compressed air often works wonders.

Symptoms.Probable causeMethod of decision
The screen's not going out.Sensor contaminationCleaning the upper frame
The screen goes out immediately.Calibration failureCalibration in the CIT menu
Chaotic behaviorConflict POSafe mode/Dumping
No reaction to the arm.The plume's tearDisassembly and reconnection

In complex cases, such as after replacing the display with a non-original one, the sensor may simply be missing from the spare part kit. wizards sometimes forget to move the module from the old screen to the new one, which leads to complete inoperability of the function.

πŸ’‘

In 80% of cases, the problem is solved by simple cleaning of the speaker or recalibration, and only 20% require physical repair or replacement of the part.

Frequently Asked Questions (FAQ)

Why does the proximity sensor not work after the screen is replaced?
Most often, when you replace the display with a cheap analog, the sensor is either missing or its plume is not connected to the board. It is also possible that the new screen is incompatible with your version of the firmware, and the driver can not correctly poll the sensor.
Can I use my phone without a proximity sensor?
Yes, the phone will work, but when you make calls, the screen will not go out, and this will lead to occasional ear taps, so to minimize inconvenience, you can use a headset or hands-free mode, and you can also install an app to lock buttons during the call.
Does the security glass affect the sensor?
If the protective glass has a black frame that covers the sensor area (even partially), or if it is too thick and of poor quality, the IR rays will be reflected or absorbed, causing false positives.
How do I check if I have a physical or virtual sensor?
Look at the top of the screen when the phone is off under bright light. If you see a small round or oval black glass next to the speaker, the sensor is physical. If the frame is perfectly smooth and uniform, you probably use a virtual sensor.