There is an analog light sensor, part number ALS-PT19, in the top left part of the board. This can be used to detect ambient light, with similar spectral response to the human eye. There is a 10K balancing resistor to convert the current drive to voltage.

This sensor is connect to analog pin #A5, you can use analogRead or the library to read the analog value. It will read between 0 and 1023 with higher values corresponding to brighter light levels. The range is approximately 0 Lux to 1500 Lux maximum.

1000 Lux will roughly read as 2 Volts (or about 680 as a raw analog reading). A reading of about 300 is common for most indoor light levels. Note that outdoor daylight is 10,000 Lux or even higher, so this sensor is best suited for indoor light levels!

Library Reference

You can request the raw analog reading (0 = no light, up to 1023 = ~1500 Lux) with CircuitPlayground.lightSensor()

This guide was first published on Jul 19, 2016. It was last updated on Oct 22, 2017.

This page (Light Sensor) was last updated on Jul 15, 2016.

Text editor powered by tinymce.