Skip to main content

Light Sensor and LED Bar

This demo will show you how to use light sensor. In order to indicate the intensity of light, we need a Led Bar.

Hardware Required:

  • Arduino

  • Light Sensor

  • LED Bar

Circuit:

The output of Light Sensor is analog signal, so we connect it to A0 of Seeeduino.

LED Bar needs 10 IOs, about the connection, please refer to LED Bar.

Code:

Open Arduino IDE, click File -> Sketchbook -> light_sensor.

We can use analogRead() to read the value of light sensor, this value will indicate the intensity of light. When the light stronger, the value larger.

To make the data more smoothly, we need some simple filtering. We read the value 32 times, and take the average value.

Tech Support & Product Discussion

Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.

Loading Comments...