Ambient Light Sensor Test

Start the test to read ambient light levels from your device sensor. Cover or shine a light on the sensor to see changes.

โ€” lux
โ€”
๐ŸŒ‘ Dark (<10)
๐ŸŒ™ Dim (10-50)
๐Ÿ’ก Normal (50-200)
โ˜€๏ธ Bright (200-1000)
๐ŸŒž Very Bright (>1000)
Ready to test

Tips for Light Sensor Testing

1

The Ambient Light Sensor API requires Chrome with experimental flags enabled.

2

Cover the sensor or shine a light on it to see the lux value change in real time.

3

Normal indoor lighting is typically 100-500 lux, while direct sunlight can exceed 100,000 lux.

Understanding Light Sensors

How Do Ambient Light Sensors Work?

Ambient light sensors (ALS) use photodiodes โ€” semiconductor devices that generate an electrical current when exposed to light. The current is proportional to the light intensity, measured in lux. Modern sensors include filters to match the human eye's spectral response, ensuring accurate readings that correspond to perceived brightness rather than raw light energy.

Light Levels & Lux Values

Lux measurements help categorize environments: Moonlight: 0.25 lux. Street lighting: 10-50 lux. Office lighting: 300-500 lux. Overcast day: 1,000-2,000 lux. Direct sunlight: 50,000-100,000 lux. Your device uses these readings to automatically adjust screen brightness โ€” a feature called adaptive brightness that helps save battery and reduce eye strain.

AmbientLightSensor API

The AmbientLightSensor API is part of the Generic Sensor API family. It has limited browser support โ€” currently only available in Chrome/Edge on Android with the chrome://flags/#enable-generic-sensor-extra-classes flag enabled. This is due to privacy concerns โ€” ambient light readings could potentially be used for cross-device tracking or inferring user behavior (e.g., detecting room occupancy).

Frequently Asked Questions

Why does my browser say the light sensor is not supported?

The AmbientLightSensor API has very limited browser support. It works in Chrome/Edge on Android but may need to be enabled in chrome://flags. It's not supported in Safari, Firefox, or most desktop browsers due to privacy concerns.

What is lux?

Lux is the SI unit of illuminance โ€” it measures the amount of visible light falling on a surface. One lux equals one lumen per square meter. For reference: a typical office has 300-500 lux, while direct sunlight can exceed 100,000 lux.

Can a phone case affect the sensor reading?

Yes. Phone cases that cover the light sensor area near the front camera can block or reduce light reaching the sensor, resulting in lower readings. Make sure the sensor area is uncovered for accurate measurements.