Proximity Sensor in Mobile Devices — What It Is, Types, and Operating Principle

Author: IT Sectr Published: 2026-03-23 Reading time: 9 min

A proximity sensor is an infrared sensor that detects the presence of an object in front of a smartphone screen without physical contact. Its main function is to turn off the display during a phone call to prevent accidental cheek touches and save battery life. According to the Google Android Developer Guide, 2024, modern proximity sensors measure distances from 0 to 10 cm with 0.5 cm accuracy and a response time of less than 50 ms.

Key Takeaways

  • Proximity sensor — an infrared (IR) sensor that detects objects at distances from 0 to 10 cm.
  • Operating principle based on measuring reflected IR radiation — time-of-flight (ToF) or triangulation method.
  • Android API uses Sensor.TYPE_PROXIMITY with two states: 0 (near) and max range (far).
  • Power consumption is minimal — about 0.5 mA, allowing it to operate without affecting battery life.
  • Screen in pocket — the sensor prevents false touches when the phone is in a pocket or bag.

What Is a Proximity Sensor in a Phone

Proximity sensor — a contactless infrared sensor located at the top of the smartphone’s front panel, next to the earpiece speaker. It consists of an infrared LED (IR LED) and a photodetector (photodiode or phototransistor). The first mass-market smartphone with a proximity sensor was the Apple iPhone (2007) — since then, the sensor has become a mandatory component in all modern phones.

Position and Design

The sensor is usually hidden under the display glass and is only visible from a certain angle as a small dot. Modern models use an optical module with a narrow beam angle (15–30 degrees) to prevent false triggers from glass reflections. Manufacturers include Sharp, ams OSRAM (TMD series), Silicon Labs, and their contract partners.

ParameterValue
Wavelength850–940 nm (invisible IR range)
Range0–10 cm
Resolution0.5 cm
Power Consumption0.3–0.7 mA
Response Time10–50 ms

Two Types of Sensors

Mobile devices use discrete sensors (a separate chip with IR LED + photodiode) and integrated modules (both elements on a single chip). Integrated solutions (ams TMD2635, size 1×1×0.5 mm) are used in ultra-thin chassis of modern flagships and take up minimal board space.

How an Infrared Sensor Works

The operating principle of a proximity sensor is based on measuring the intensity of reflected IR radiation. The infrared LED emits a light pulse (850–940 nm), and the photodiode measures the amount of light reflected from an object. If the reflected signal exceeds a threshold, the object is considered near (less than 3–5 cm).

Ambient Light Suppression

The main technical challenge is solar interference and noise from other IR sources. The solution is emission modulation: the IR LED emits pulses at 10–100 kHz, and the photodetector synchronously detects the signal, filtering out the DC component. According to ams Application Note AN000610 (2024), synchronous detection suppresses background illumination by 40–60 dB.

Calibration and Thresholds

The trigger threshold is set by the manufacturer during calibration and depends on the display glass transparency. A typical threshold corresponds to a reflection distance of 2–4 cm. When a finger or ear is placed closer than the threshold, the sensor outputs 0 (near); otherwise, it returns the maximum range value (8–10 cm depending on the model).

Difference Between a Proximity Sensor and a ToF Sensor

IR proximity sensor measures reflection intensity — a binary sensor with two states. Time-of-Flight (ToF) measures the time light takes to travel to an object and back, allowing precise distance measurement up to several meters. In mobile devices, ToF sensors (VL53L5 from STMicroelectronics) are used for camera autofocus and AR applications.

When to Use IR Proximity vs. ToF

For the task of turning off the screen during a call, a simple binary IR sensor is sufficient — its cost is $0.10–$0.30 compared to $1–$3 for a ToF module. A ToF sensor adds precise distance measurement but is overkill for the basic task. Some flagships (Samsung Galaxy S23 Ultra) use combined modules that integrate both technologies.

ParameterIR ProximityToF Sensor
PrincipleReflection intensityLight time-of-flight
Range0–10 cm0–400 cm
Accuracy0.5 cm0.1 cm
Cost$0.10–$0.30$1–$3
ApplicationScreen during callsAutofocus, AR

Programmatic Access to the Sensor in Android

Android provides access to the proximity sensor through Sensor.TYPE_PROXIMITY. A key feature of the API is that the sensor returns only two practically meaningful values: 0 (object near) and the maximum range value (usually 5–10 cm) when no object is present. Internal algorithms hide the analog nature of the signal.

Working with the Sensor

The binary nature of the sensor means the app cannot get the exact distance to an object — only whether an obstacle is present or absent within the sensing zone. This is a hardware limitation. For more precise measurements, use a ToF sensor (if available) through the standard TYPE_PROXIMITY API, but on devices with ToF it returns analog values.

kotlin
val proximitySensor = sensorManager
    .getDefaultSensor(Sensor.TYPE_PROXIMITY)

sensorManager.registerListener(
    object : SensorEventListener {
        override fun onSensorChanged(event: SensorEvent) {
            val distance = event.values[0]
            val maxRange = proximitySensor?.maximumRange ?: 10f

            when {
                distance < maxRange -> lockScreen()
                else -> unlockScreen()
            }
        }

        override fun onAccuracyChanged(
            sensor: Sensor, accuracy: Int
        ) {}
    },
    proximitySensor,
    SensorManager.SENSOR_DELAY_UI
)

Wake Lock and Power Management

When registering the proximity sensor, it is important to use SCREEN_OFF_WAKE_LOCK if the app needs to keep running with the screen off (e.g., call recording). Without a Wake Lock, the CPU may enter sleep mode and stop receiving sensor data. The SENSOR_DELAY_UI flag (200 ms) is sufficient for most scenarios.

Using the Proximity Sensor in Applications

Although the sensor’s primary function is turning off the screen during calls, developers find more creative uses. The Glimmer app uses the proximity sensor to skip tracks with a hand wave in front of the screen — swipe your palm to skip a song. Battery life is unaffected: the sensor consumes only 0.3–0.7 mA.

  • Auto-answer and call recording — the app detects when the phone is held to the ear and activates the speaker or recording.
  • Pocket mode — locks the screen and disables vibration when the phone is in a pocket. The sensor is polled every 1–2 seconds.
  • Hover preview — in gallery apps, bringing your hand near the screen reveals hidden controls.
  • Touchless gaming — simple games where hand movement in front of the sensor replaces button presses.

Problems and Limitations

The main issue with proximity sensors is false triggers when using screen protectors and cases. Some manufacturers (Google Pixel 8, 2023) use an ultrasonic proximity sensor instead of IR — it works through any screen protectors and displays of any thickness but has lower accuracy and higher latency (up to 100 ms). Thick glass (over 0.5 mm) scatters IR radiation, causing constant triggering. The solution is to use cases with a precise cutout for the sensor. A second drawback is the inability to work through OLED displays with variable transparency (under-display sensor).

Under-Display Proximity Sensor

In 2024–2025, manufacturers began implementing under-display proximity sensors, reducing the top bezel to 1–2 mm. The first mass-produced device with an under-display proximity sensor was the Xiaomi 14 Ultra (2024), followed by the OnePlus 12 and Samsung Galaxy S25. The technology uses IR radiation at 940 nm, which partially passes through OLED pixels. According to Samsung Display Technical Paper (2024), OLED transparency for IR radiation is 15–25% — sufficient for the sensor to operate at screen brightness up to 600 cd/m². At higher brightness, the matrix becomes opaque to IR, requiring the backlight to be turned off for 1–2 frames for measurement.

Software Emulation of the Proximity Sensor

When developing Android apps, the emulator does not support the proximity sensor — it must be emulated in software. On a physical device, you can use the adb command: adb shell sendevent /dev/input/eventX with the appropriate ABS_MT_TOUCH_MAJOR codes. To simulate screen-off during a call in tests, use SensorManager with a mock object that returns 0 when onSensorChanged is called.

Testing the Proximity Sensor

To test the proximity sensor on an Android device, open the Phone app, dial *#0*# (on Samsung), and select Sensor. When you bring your finger close to the top of the screen, the sensor value should change from “Far” to “Near.” If the sensor does not respond, clean the top of the screen and check for a screen protector covering the sensor. On iPhone, testing is done through system diagnostics in Settings.

Frequently Asked Questions

Why doesn’t the screen turn off during a call?

The most common cause is a screen protector or case covering the proximity sensor. Make sure the area near the earpiece is not blocked. If the problem occurs on a bare phone, it may be a hardware defect or a dirty sensor.

Where is the proximity sensor located?

The sensor is located at the top of the front panel, next to the earpiece speaker. In modern smartphones, it is hidden under the display glass. You can see it by shining a bright flashlight at an angle — it looks like a small dot or slit.

Can the proximity sensor be calibrated?

With standard Android tools — no. However, there are apps that access the engineering menu (dial *#0*# on Samsung) for testing. On some devices, sensitivity can be adjusted through service mode.

How to get the exact distance from the proximity sensor?

The standard proximity sensor API returns only a detection flag — 0 or maxRange. For precise distance, use a Time-of-Flight sensor (if the device has one) — available through the same TYPE_PROXIMITY on compatible devices.

Does the proximity sensor work through a screen protector?

It depends on the thickness and material. Thin flexible protectors (0.15–0.2 mm) do not affect operation. Thick tempered glass (0.5+ mm) can scatter IR radiation and cause false triggering. Protectors with a precise cutout or a black frame around the sensor are recommended.

Summary

  • Proximity sensor — an infrared sensor that detects objects at a distance of 0–10 cm from the screen.
  • Operating principle — measuring reflected IR radiation with synchronous detection to suppress ambient light.
  • Binary nature — the sensor returns only two states: object near or absent, without exact distance.
  • Android API — Sensor.TYPE_PROXIMITY, power consumption 0.3–0.7 mA with a response time of 10–50 ms.
  • Primary function — turning off the display during phone calls to prevent accidental touches.
  • ToF sensors differ by measuring light time-of-flight, providing precise distance up to 4 meters.
  • Thick screen protectors and cases — the main cause of proximity sensor malfunction in everyday use.

We will develop a mobile application turnkey

IT Sectr creates iOS and Android applications for startups and businesses since 2017. We will advise you and propose the best solution.

Discuss the project

Read also