Understanding the Proximity Sensor's Role
The proximity sensor is a small but critical component in modern smartphones, including OnePlus devices. It primarily functions to detect the presence of nearby objects without physical contact. During phone calls, it senses when your ear is close to the screen and automatically turns off the display to prevent accidental touch inputs and save battery. It also plays a role in features like pocket mode, preventing unintended operations while the phone is in a bag or pocket. This sensor typically uses an infrared (IR) LED and an IR light detector. When an object is near, it reflects the IR light back to the detector, triggering the system response. Accurate calibration ensures this interaction is seamless and reliable.
Common Symptoms of Calibration Issues
Recognizing when your OnePlus proximity sensor needs calibration is the first step. The most frequent symptom is the screen remaining on during a phone call, leading to accidental muting, dialing, or app launches with your cheek. Conversely, the screen might not wake up promptly when you move the phone away from your ear, forcing you to manually press the power button. You may also experience erratic behavior with automatic brightness adjustments or false triggers of the pocket mode. Before proceeding with software calibration, rule out simple physical obstructions. Check if your screen protector, especially a thick or poorly aligned one, is covering the sensor area. Clean the top bezel of the phone gently with a soft, dry cloth to remove any dust or grease that could interfere with the IR beam.

Pre-Calibration Checklist and Preparations
A systematic approach increases the success rate of calibration. First, ensure your OnePlus device is running the latest available OxygenOS/Android version, as updates often contain sensor optimizations. Back up important data as a general precaution. The calibration process requires a stable environment. Avoid performing it under direct, bright sunlight or in areas with strong infrared interference. Have a flat, stable surface ready. You will also need a completely dark environment for one phase of the calibration. A small, opaque object like a book or your hand is necessary to cover the sensor. Close all running applications and ensure the phone is not in a call or any other sensor-intensive operation. Charge your device to at least 50% battery to prevent shutdown during the process.

Accessing the Hidden Engineering Mode for Calibration
OnePlus devices, like many Android phones, have a built-in engineering or diagnostic menu for hardware testing. This is the primary gateway for manual proximity sensor calibration. To access it, open your phone dialer and enter a specific code. The most common code for OnePlus devices is#808#. This should open the "Engineering Mode" or "OnePlus Logkit" menu. If this code does not work on your specific model, alternatives like##64663## or##3646633## can be tried. Please note that code availability can vary by model and region. Within this menu, navigate carefully. Look for tabs or entries labeled "Sensor," "Hardware Testing," or "Single Item Test." Find and select the "Proximity Sensor" or "PSensor" test option.

Step-by-Step Calibration Procedure
Once inside the proximity sensor test menu, you will typically see a real-time value display and two buttons: "Calibration" and "Start." Follow these steps precisely. First, tap "Start" to begin the test. The display will show a numerical value, often representing the reflected IR intensity. Without any object near the sensor, note this "Far" value. Next, gently place your finger or the opaque object directly over the proximity sensor (usually located at the top of the display, near the earpiece). The numerical value should change significantly. Note this "Near" value. Now, tap the "Calibration" button. The system will prompt you through a sequence. It will first ask you to remove all objects from the sensor (Far calibration). Then, it will ask you to cover the sensor completely (Near calibration). Follow the on-screen instructions. A critical step often involves placing the phone face down on a flat surface in a pitch-dark room for a few seconds. This allows the sensor to calibrate its baseline zero point. Complete the sequence until a "Calibration Success" or "Pass" message appears.
Post-Calibration Verification and Testing
After a successful calibration, exit the engineering menu and restart your device. A reboot ensures the new calibration data is fully loaded by the system. To verify the fix, make a test call to your voicemail or a friend.