Home Light sensor
Post
Cancel

Light sensor

Light sensor

Information

LDR is a sensor that lets electrons flow through it when it is exposed to enough light. When there is enough light, the electrons start flowing into the capacitor. The capacitor will start charging, and when the voltage across the capacitor goes above 2.1 V, the input pin of the GPIO will read HIGH. At that point, the program will set the output pin to LOW, which will turn the LED OFF. On the other hand, when there is not enough light out, the electrons stop flowing through the LDR, and the capacitor starts discharging. When the voltage across the capacitor drops below 2.1 V, the input pin reads LOW.

It is possible to use different capacitors. The value can be entered in the calibration part of the button. A lower value means faster response.

More information โ€ฆ

Setup

In order to use the Light sensor use the following settings:

Mandatory

Hardware
Light sensor
Address
Enter the physical pin number on which the device is connected
Ex: 27

Calibration

This is only available for light sensors.

Capacitor value in ยตF
Enter the value of the capacitor Other settings can be found at the button setup information
This post is licensed under CC BY 4.0 by the author.