How the proximity sensor works in the Xiaomi smartphone

Today’s Xiaomi smartphones are equipped with many sensors that make using the device comfortable and safe. One of the key components that ensures convenience during a conversation is the proximity sensor, which is responsible for automatically quenching the screen when you bring the phone to your ear, preventing accidental pressing of the cheek or ear.

Many Redmi and Poco owners face a situation where the screen does not turn off during a call or, on the contrary, goes out too early. Understanding the principles of this sensor will help avoid unnecessary trips to the service center. In this article, we will discuss in detail the physical foundations of the technology, the software features of MIUI and HyperOS, and provide step-by-step diagnostic instructions.

Importantly, Xiaomi devices use different types of sensors, from classic infrared to ultrasonic to virtual. The virtual proximity sensor embedded in MIUI 12 uses machine learning algorithms to determine the position of the phone without a physical hole in the screen. This revolutionary change has allowed manufacturers to make thinner bezels, but sometimes raises questions from users accustomed to the classic circuit.

Principle of operation and types of sensors in Xiaomi

The physical proximity sensor in Xiaomi smartphones is most often an infrared module, consisting of an emitter (LED) and a receiver. The emitter emits light invisible to the human eye, which reflects off nearby objects and returns to the receiver. If the reflected signal exceeds a certain threshold, the system receives a command to lock the screen.

More modern and expensive models, such as the flagship Xiaomi Mi series or Xiaomi 13/14, may have different technology, using ultrasonic sensors or laser rangefinders that more accurately determine the distance to the object and are less susceptible to contamination. However, in the budget segment, including the popular Redmi Note, classic infrared sensors are still widely used, requiring a cutout in the display or a thin grille at the top of the body.

Software emulation is a special focus: models without a physical sensor (such as the Redmi Note 9 Pro or Poco X3 NFC) use what's called a virtual sensor, which analyzes data from the accelerometer, gyroscope and capacitive touch layer of the screen. MIUI algorithms define a characteristic scenario: the phone is raised, the screen touches the face, and locks the display.

⚠️ Attention: Using thick protective glass or film covering the top of the screen can completely disrupt both the physical and virtual sensor.

Understanding what type of sensor is installed in your device is critical when choosing accessories, and if you don’t know the specifications of your model, you can use engineering menus or specialized applications to check hardware.

📊 What type of sensor does your smartphone have?
Physical (IR-beam)
Virtual (software)
I don't know/I haven't checked.
I have an iPhone.

Software calibration through the engineering menu

If your screen is not behaving properly during calls, the first step is to program calibrate, and there's a hidden engineering menu in the MIUI and HyperOS shell that's accessible through standard dialing, and that's the most efficient way to reset the sensor and reset it.

To start your diagnosis, open the Phone app and dial ##6484##. This command will open the CIT menu, which lists all the hardware components of the device, and you will need to find the "Proximity sensor" or "Proximation Sensor" item in the list.

In the window that opens, you'll see two numerical values. The first shows the current distance to the object in centimeters, the second shows the calibration value. To perform the calibration, close the sensor with your finger (the screen should go out or change the color of the display), then remove your finger. If the values change, press the "Calibration" or "Start" button. The process will take a few seconds, after which the success message will appear.

☑️ Checklist before calibration

Done: 0 / 4

After successful calibration, you need to restart your smartphone to make the changes take effect. If you see in the CIT menu that values do not change even when you close the top of the screen with your finger, this may indicate a hardware malfunction or the absence of a physical sensor (a virtual one is used).

What if the code doesn't work?
Some global firmware versions may have limited access to CIT, so try entering ##4636## to go to the phone information menu, even though the sensors are limited, and the code may not work if you don't have root rights or custom firmware installed.

Sensitivity setting in the system menu

Some versions of the Android operating system with the MIUI shell provide the ability to manually adjust the sensitivity of the sensor through standard settings, especially for devices where the sensor is triggered too early or too late.

To find these settings, go to Settings → Lock and Protection → Approach Sensor. The path may vary slightly depending on the Android version. Here you can see the Pocket Mode switch or the Sensitivity Slider. Enabling Pocket Mode allows you to lock the screen when the phone is in a dark enclosed space, such as in a bag.

However, be careful with sensitivity. Too high a trigger threshold can cause the screen to go out even if you just hold the phone 5-10 cm away from your face without making a call. The optimal is the average, which is checked by experiment.

ParameterLow sensitivityMedium sensitivityHigh sensitivity
Response to the callThe screen may not go out.Stable workThe screen goes off instantly.
Pocket useRisk of accidental pressingProtection is on.High risk of false blocking
Work with protective glassBetter compatibilityNormal work.Failures are possible

If problems persist after setting up through the menu, it is possible that a third-party application with access to call management causes the conflict. Check the permission list for messengers (WhatsApp, Telegram, Viber), as they also use the proximity sensor for the “talk” function.

💡

Try turning off the “Close Up in Your Pocket” feature in the audio settings, which sometimes conflicts with the proximity sensor, causing the screen to behave chaoticly.

Diagnosis and health testing

Before you carry the device for repair, it is worthwhile to conduct a self-diagnosis. There are several ways to check if the proximity sensor on your Xiaomi is alive, and the easiest way is to call someone or your second number and hold your finger to the top of the screen.

If the screen goes out and lights up when you remove your finger, the sensor is physically intact, and the problem is the software, and if the reaction is not at all, or the screen goes out on its own without your actions, you need a deeper check. You can use third-party apps from Google Play, such as "Proximity Sensor Reset/Fix" or "Sensor Test."

These apps display raw data from the sensor in real time. Pay attention to the graph: it should be flat when there is nothing in front of the screen, and change the value dramatically when an object approaches. Graphic jumps without external influences indicate a software failure or electrical interference.

⚠️ Note: If the sensor shows a value of “0” or “NaN” (Not a Number) in testing applications constantly, regardless of the position of the hands, there is a high probability of a hardware plume break or the module itself failing.

Also worth checking is that the device's RAM is not overloaded. If resources are scarce, Android can turn off the polling of minor sensors to save power, leading to delays in the approach sensor. Close all background applications and repeat the test.

Problems with protective films and accessories

One of the most common reasons for sensor malfunction in Xiaomi smartphones is poor quality protective glass. Accessories manufacturers often make a solid black coating at the top, covering the sensor window. Even if the glass is transparent, a thick layer of glue or the material structure itself can distort the IR ray.

Virtual sensors are particularly sensitive to changing screen capacity. Cheap films can create dead zones or false-touch zones, which can knock out the algorithms for determining the position of the phone in the ear. If you recently replaced the glass and the problem appeared immediately after that, the accessory is almost certainly the cause.

The solution could be to neatly cut the hole above the sensor (if it is physical) or completely replace the glass with a model labeled “Compatible with proximity sensor.” For virtual sensors, sometimes recalibrating the touchscreen through an engineering menu helps.

💡

The quality of the security glass directly affects the performance of sensors. Cheap accessories can cost you the convenience of using your phone during a conversation.

Hardware malfunctions and repairs

If software and accessories replacements didn’t work, it’s a hardware problem. In Xiaomi smartphones, the proximity sensor is often integrated into the front camera plume or into a separate module connected to the motherboard. Over time, the contact can oxidize or depart after a fall.

Symptoms of hardware failure include a permanent black screen during a call (the sensor is stuck in a closed state) or the inability to lock the screen with your hand. In some cases, the oxidation of the contacts occurs due to moisture, even if the phone did not sink, but was simply used in a wet room.

Self-repair is possible only with soldering skills and tools. You need to disassemble the device, disconnect the display plume and check the contacts of the sensor. Often it helps to simply clean the contacts with alcohol or solder the module. However, in modern models with glue display disassembly carries a high risk of damage to the matrix.

⚠️ Warning: When you open the case of your smartphone, you lose your warranty. If the device is warranty, contact your Xiaomi authorized service center for free diagnostics.

The table below gives the main symptoms and probable causes:

Symptoms.Probable causeMethod of decision
The screen doesn't go out when you ring.Pollution or software failureCalibration, cleaning.
The screen goes off on its own.Damaged glassGlass replacement
Black screen after the callSticking of the sensorReloading, repairs
Sensor's not responding.The plume breakReplacement of the module

In conclusion, the proximity sensor is an important but often underrated element of the smartphone, and the right setting and care for the top of the screen will ensure a comfortable connection, and if the problem lies deeper, timely diagnosis will help to avoid more serious breakdowns.

Can I turn off the sensor completely?
You can physically turn it off without disassembling it. There's no software option in the standard settings, but there are screen-locking applications that ignore the system sensor and use their algorithms, but that consumes more battery.

Frequently Asked Questions (FAQ)

Why does the proximity sensor only work with the original charger?
It's a common myth. The sensor is independent of the charger, but if the power supply is poor, it can create strong electromagnetic interference that affects the sensors and the touchscreen, and only use certified cables and units.
Does the sensor calibration reset after the MIUI update?
In most cases, the calibration is saved because the data is stored in a separate partition of memory, but after a major update to Android (for example, from 11 to 12), it is recommended to recalibrate through the engineering menu for the correct operation of the new algorithms.
Can a virus turn off the proximity sensor?
It is unlikely that a virus will directly shut down the sensor, but malware can intercept screen control or block system functions. If you notice strange sensor behavior after installing an unknown app, check the phone with an antivirus.
How does the sensor work in hands-free mode?
In hands-free mode, the proximity sensor is usually ignored by the system, and the screen does not go out even if you hold the phone to your ear, so that the user can see the information on the display during a conference call.