Main Content

Light Sensor

Measure ambient light


Simulink Support Package for Android Devices / Sensors

  • Light Sensor block


Get the ambient light measurement in lux (lx) from the light sensor on the Android™ device.

The block port outputs a single—precision value.

The light sensor is located near the front camera and device display. The device typically uses this sensor for automatic adjustment of the screen brightness.


During simulations without hardware, this block outputs zeros. See Block Produces Zeros or Does Nothing in Simulation.


Sample time

Specify how often the block reads the sensor.

Smaller values require the processor to complete the same number of instructions in less time, which can cause task overruns.

Version History

Introduced in R2014a