An ambient light sensor is a photodetector that measures external light levels to automatically adjust the display brightness. It measures illuminance in lux (lx) from 0 (complete darkness) to 100,000+ lx (direct sunlight). According to the Vishay Application Note, 2024, auto-brightness based on ALS reduces display power consumption by 25–40% compared to manual control.
Key Takeaways
Ambient Light Sensor (ALS) is a semiconductor photodetector located on the front panel of a smartphone near the earpiece speaker. The first mobile phones with ALS appeared in the mid-2000s (Nokia N95, 2006), and today the sensor is installed even in budget models starting at $100.
Modern ALS sensors have spectral correction that brings their sensitivity close to that of the human eye (photopic curve V(λ) with a peak at 555 nm). The sensor measures illuminance in lux — a unit that accounts for the eye’s spectral sensitivity. Typical manufacturers include ams OSRAM (TSL, TMD series), Vishay (VEML series), and Broadcom (APDS series).
| Parameter | Value |
|---|---|
| Range | 0 – 100,000+ lx |
| Resolution | 0.1 lx (low light) |
| Consumption | 0.1–0.5 mA |
| Size | 1.5×1.0×0.4 mm |
| Spectral Peak | 555 nm (V(λ)) |
Beyond auto-brightness, the ambient light sensor is used for camera calibration (determining shooting conditions), in lighting monitoring apps (Light Meter), and in smart home systems. According to Strategy Analytics (2024), more than 95% of all smartphones sold are equipped with ALS.
At the heart of ALS is a silicon photodiode that generates a photocurrent proportional to the intensity of incident light. The photocurrent is converted to voltage through a transimpedance amplifier and digitized by a built-in ADC (12–20 bit). Interference or absorption optical filters are used for spectral correction, attenuating IR and UV components.
The human eye perceives brightness logarithmically, so ALS has a logarithmic or programmable amplifier to operate from 0.1 lx (deep night) to 100,000+ lx (bright sun). According to the Broadcom APDS-9306 Datasheet (2024), the sensor automatically switches gain when illuminance changes by more than 100 times — switching time does not exceed 100 ms.
Modern ALS sensors (ams TSL2520) support flicker detection from LED lamps and fluorescent sources at 50/100 Hz or 60/120 Hz. This function is used by cameras to synchronize the shutter — without it, dark bands appear in photos from lamp flicker. ALS detects the frequency and passes it to the camera’s ISP processor.
Auto-brightness is the main function of ALS. The algorithm includes 5 stages: measuring illuminance, noise filtering, calculating target brightness, smoothing the transition, and applying it to the display. Typical target brightness for different conditions: 2–5 cd/m² at night, 200–400 cd/m² in the office (500 lx), 600–1000+ cd/m² in sunlight (50,000+ lx).
Starting with Android 9 (Pie), Google introduced adaptive brightness curves that learn from user behavior. If a user manually changes brightness at a certain illuminance level, the system remembers this deviation and adjusts the curve. On Android 13+, an on-device machine learning model (TensorFlow Lite) is used to predict brightness preferences based on time of day and context.
Abrupt brightness changes are uncomfortable for the eyes. Modern algorithms use a low-pass filter with a time constant of 0.5–3 seconds and a brightness change rate limit (ramp rate limit). Apple uses a 200–400 ms transition animation when changing brightness, making the process imperceptible to the user. Sharp jumps (more than 5% per frame) are blocked.
class AdaptiveBrightnessController {
private val smoothFactor = 0.15f
private var targetBrightness = 0.5f
fun calculateBrightness(
lux: Float,
userOverride: Float?
): Float {
val mapped = luxToBrightnessCurve(lux)
val adaptive = userOverride
?.let { it * 0.7f + mapped * 0.3f }
?: mapped
// Low-pass filter (smoothing)
targetBrightness = smoothFactor * adaptive +
(1f - smoothFactor) * targetBrightness
return targetBrightness
}
private fun luxToBrightnessCurve(
lux: Float
): Float = when {
lux < 10f -> 0.05f
lux < 200f -> 0.15f + lux * 0.0005f
lux < 5000f -> 0.25f + lux * 0.00005f
else -> 0.7f + lux * 0.000005f
}
}
Sensor.TYPE_LIGHT provides the current illuminance in lux. This sensor belongs to the Environmental Sensors category — it requires no calibration and works immediately. The polling rate of SENSOR_DELAY_NORMAL (200 ms) is sufficient for all scenarios. No user permissions are required for ALS to work.
When illuminance changes abruptly (exiting a tunnel into sunlight), ALS reports a value with a delay of 50–300 ms due to the built-in low-pass filter in the sensor chip. This prevents brightness flickering during rapid light changes (e.g., driving past streetlights). An app can further filter data using a moving average with a window of 3–5 samples to eliminate noise.
class LightSensorMonitor {
private val windowSize = 5
private val readings = LinkedList<Float>()
fun smoothLightReading(lux: Float): Float {
readings.add(lux)
if (readings.size > windowSize) {
readings.removeFirst()
}
return readings.average().toFloat()
}
fun detectLightChange(
currentLux: Float
): LightChange = when {
currentLux < 5f -> LightChange.DARK
currentLux < 200f -> LightChange.INDOOR
currentLux < 5000f -> LightChange.OUTDOOR_SHADE
else -> LightChange.DIRECT_SUNLIGHT
}
}
enum class LightChange {
DARK, INDOOR, OUTDOOR_SHADE, DIRECT_SUNLIGHT
}
The ambient light sensor is present in 99% of modern smartphones, but for correct operation, check via PackageManager.hasSystemFeature(FEATURE_SENSOR_LIGHT). In rare cases (ultra-budget models, tablets), the sensor may be absent — the app should properly handle a null return.
Beyond auto-brightness, the ambient light sensor is used in photography and AR applications. The Camera FV-5 app uses ALS for automatic exposure pairing in manual mode. ARCore adjusts the brightness of virtual objects based on real lighting, making AR scenes photorealistic.
The display is the most power-hungry component of a smartphone: at 600 cd/m², it consumes 3–5 W. Auto-brightness based on ALS reduces average display brightness by 30–50% indoors (200–500 lx) compared to maximum manual setting. According to DisplayMate research (2024), users with auto-brightness enabled get 25–40% more battery life than those who set brightness manually to maximum. Outdoors at 50,000+ lx, ALS instead increases brightness to 800–1000 cd/m² for screen readability.
Modern smartphone cameras use ALS data to automatically select a shooting mode: HDR in backlit conditions, night mode at illuminance below 10 lx, portrait mode in studio lighting. According to the Qualcomm Snapdragon ISP Whitepaper (2024), ALS enables the camera to determine the light source type — daylight, incandescent, LED, or fluorescent — within 100 ms and adjust white balance before the shutter button is pressed.
Under-display ambient light sensors are becoming the standard in 2025–2026. Samsung and Apple are already patenting technologies for placing ALS under OLED display pixels. The development of spectral sensors will allow measuring not only intensity but also the color temperature of light (CCT) — this will improve True Tone and the camera’s auto white balance.
Frequently Asked Questions
The ambient light sensor measures the external light level in lux, the system maps it to a brightness curve, and sets the corresponding display brightness. On Android 9+, the curve adapts to user preferences using on-device machine learning.
The sensor is located in the upper part of the screen, near the earpiece speaker and the front camera. In most modern phones, it is hidden under the display glass and is not visible to the naked eye. On older models, the sensor looks like a small dot.
Reasons: sensor contamination (dust, greasy marks), a thick protective glass covering the sensor area, or a glitch in the adaptation curve. Wipe the upper part of the screen with a soft cloth. If that doesn’t help, turn auto-brightness off and on again in the settings.
No — the camera and ALS are different sensors. The camera captures an RGB image, while ALS measures light intensity with a spectrally corrected photodiode. Lux meter apps that use the camera have an error of 50–100% compared to ALS.
Dial *#0*# in the phone app (for Samsung) to enter the engineering menu and select Light Sensor. For other brands, use Sensor Test from Google Play. Point the phone at a light source — readings should change from 0 to 10,000+ lx.
Summary
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.
Read also