How to set up screen lock during a conversation on Xiaomi: fix sensor problems

The situation when the screen of a Xiaomi or Redmi smartphone does not go out during a phone conversation is familiar to many users. This not only causes discomfort, but also leads to accidental cheek pressing, resetting calls or turning on standby, the problem most often lies in the incorrect operation of the proximity sensor, which is designed to lock the display when you bring the device to the ear.

MIUI and the new HyperOS have complex algorithms that sometimes conflict with security windows or covers. Understanding how it works allows you to quickly fix a malfunction without going to a service center. In this article, we will discuss in detail the software settings and the physical causes of failure.

Before we get to the tricky part, calibration is the first and most effective step. Standard system tools often get lost after a device drops or a firmware update. Factory sensor reset solves 80 percent of all screen lock problems.

The principle of the proximity sensor on Xiaomi smartphones

The main element that is responsible for screen damping is the infrared sensor, which emits an invisible beam and analyzes the reflected signal from a nearby object, in this case your head. If the distance is less than a given threshold, the Android system sends a command to turn off the display. On modern Xiaomi models, this sensor is often hidden under the screen or integrated into the top speaker.

But it doesn't just depend on the sensor to function properly, because the software processes the data with a certain delay to avoid the screen blinking when it moves randomly, and MIUI algorithms can be too sensitive, or they can ignore the reading when there's interference, and it causes the screen to either burn all the time, or go out immediately after the phone is put up.

πŸ’‘

If you use a tight black-framed protective glass, make sure it does not cover the sensor area at the top of the case.

And you have to consider that some budget models use a virtual sensor that works in conjunction with an accelerometer and a gyroscope, which detects the position of the phone in space and locks the screen if the device is rotated vertically and close to the face, and the accuracy of these measurements is lower than that of infrared analogues, which requires more careful tuning.

Hardware causes: covers, glass and pollution

Often the problem is not software bugs, but physical obstacles. Protective films, especially those that are skewed or have a thick black edge, can overlap the sensor. Even a microscopic layer of fat or dust in the upper speaker area can distort the readings of the infrared beam.

Owners of Redmi Note and POCO models often find that high-sided cases create a shadow over the sensor, in which case the system β€œthinks” that the phone is constantly in the ear, and the screen goes out immediately after the call begins or does not turn on at all.

  • 🧼 Clean the sensor area: thoroughly wipe the top of the screen with an alcohol napkin, paying attention to the area above the speaker.
  • πŸ›‘οΈ Accessories check: remove the cover and protective glass to exclude their impact on the sensor.
  • πŸ‘οΈ Visual inspection: make sure that the speaker hole does not get dust or pile from your pocket.
  • 🌑️ Temperature: At extremely low temperatures, sensor sensitivity may temporarily decrease.
The effect of temperature on the sensor
When operating in the cold below -10Β°C, infrared sensors can be unstable, a physical feature of semiconductor cells that passes after the device is warmed to room temperature.

If you take all the accessories off and clean them up, it's the software part, but you can't ignore the physical condition of the device, because even a crack on the screen at the top can disrupt the light.

Engineering menu and sensor calibration

The most effective way to fix the error is to recalibrate, and the MIUI shell has a special engineering menu that is accessed through the number encoder, allowing you to run a hidden diagnostic module without superuser rights.

To run the test, you need to dial the combination ##6484##. If the code does not work, try ##4636## or go to the menu via the settings. In the CIT (Customer Integration Test) list you need to find the item "Proximity sensor" or "Proximity Sensor".

β˜‘οΈ Calibration algorithm

Done: 0 / 1

The calibration process is like this: you close the top of the screen with your hand, press the calibration button, then remove your hand and press the button again. The system remembers the minimum and maximum light values. Once the test is completed, you need to restart the smartphone to make the changes take effect.

It is important to perform the procedure in good light, but without direct sunlight falling on the screen. If the test shows a constant value of "5.0" or "0.0" regardless of the position of the hand, this may indicate a hardware failure of the sensor.

Lock settings in the MIUI and HyperOS interface

In addition to hardware calibration, there are software switches in the system that affect the behavior of the screen. In new versions of Xiaomi firmware, some options have been hidden or renamed, you can find them in the call settings section or in the advanced system settings.

Go to Settings β†’ Applications β†’ System Applications β†’ Phone. Here, in the Incoming Calls section, the Approximation Sensor option may be available, depending on the Android version and regional firmware. If you have one, try changing the status and checking the result.

ParameterLocation on the menuRecommended valueImpact on work
Approximation sensorPhone β†’ Incoming callsIncluded.Blocking the screen in the ear
Pocket mode.Screen lockingOff (for test)Prevents false pressing
Increased recruitmentSpecial opportunitiesOff.Could be in conflict with sensors
Saving energyBatteryNo restrictions.For the phone app

It's also worth checking the power saving settings. If a phone application has a tight power limit, the system can force the proximity sensor to shut down to save battery power. Set the battery mode for this application on "No Limits."

πŸ’‘

Resetting the settings of the application "Phone" to factory often solves the problem of software conflicts after updating the system.

Using third-party applications to control the screen

If Xiaomi’s regular funds fail, Google Play apps come to the rescue, intercepting sensor data and forcibly controlling the state of the display, especially for older models that have stopped receiving driver updates.

One popular solution is the Proximity Sensor Reset & Fix app, which allows you to perform deep calibration and reset the sensor cache at the system level. Another option is Screen Off and On, which adds its locking algorithms while ignoring standard MIUI settings.

  • πŸ“± Proximity Sensor Reset: a specialized tool for resetting and calibrating sensors.
  • πŸ”’ Screen Off and On: An app with flexible sensitivity and delay settings.
  • πŸ› οΈ Fix Proximity Sensor: a utility for forced activation of the sensor in the background.

When using third-party software, it is important to carefully monitor permissions, the application will need access to the phone and sensors, after installation, calibrate the application and check the operation during the actual call.

πŸ“Š How often do you have problems with the proximity sensor?
Every day at every call: After updating the firmware: Only in the case: Never encountered: There was a problem, but I solved it

Specificity of the virtual sensor on AMOLED screens

Owners of Xiaomi’s flagship AMOLED models may notice that there is no physical sensor hole, which uses either subscreen sensor technology or virtual emulation, and is different from classic infrared sensors.

The virtual sensor analyzes the accelerometer, the gyroscope, and the front camera, and it detects whether you've brought your phone to your head, by the change in angle and distance to the object that the camera captures, which makes the system more vulnerable to software failures and requires all modules to work smoothly.

⚠️ Note: On devices with a subscreen sensor, it is critically important not to glue the top of the screen even with transparent stickers, as this disrupts the operation of recognition algorithms.

If the lock is no longer working on an AMOLED device, try updating all system applications through the GetApps store or Google Play. Often, the fixes for virtual sensors come with updates to the system components, not the firmware itself.

Radical measures: resetting and reflashing

When neither calibration nor third-party applications help, you have the option of a complete reset, which will return all system parameters to factory status by removing possible conflicts in the settings registry.

Reset is done via the Settings menu β†’ About Phone β†’ Reset β†’ Erase all data. Once turned on, the phone will be as new. Check the sensor immediately after the initial setup, without installing unnecessary applications to exclude their impact.

In extreme cases, if the problem occurred after a firmware update, you may need to roll back to the previous version or install a global stable version of the software.

Risks of flashing
Self-flashing of the device can lead to loss of warranty. If the phone is in warranty service, it is better to contact an authorized service center Xiaomi.

Remember that in some cases, a sensor malfunction is caused by a physical impact or moisture. If the software methods are powerless, and the calibration in the engineering menu shows zero values, you will most likely need to replace the module.

Why does the screen go out when I hold my phone on my outstretched arm?
This is a sign of a false alarm, perhaps a thick protective glass on the screen that distorts the signal, or the sensor is contaminated, and the problem may be the software bug of the current version of MIUI.
Can the proximity sensor be completely turned off?
The system is not standard, because it's a system feature of Android, but you can use emulator apps that ignore the sensor readings and keep the screen on.
Does the β€œIn your pocket” mode affect the sensor’s performance when you talk?
Yes, this mode uses the same light and proximity sensor, and if it doesn't work properly, there can be conflicts when the phone confuses being in your pocket with being in your ear.
What if nothing changes after calibration?
Try calibrating it several times in a row. If that doesn't work, check for system updates. In rare cases, you need to reset all settings to factory settings.
Is it true that some cases block the sensor?
Absolutely true. Cases with magnetic fasteners or high sides at the top often overlap the sensitivity zone, which leads to permanent screen quenching.