- Light Dependent Resistor (LDR) also known as Photoresistor.
- This project demonstarate how to use LDR in Arduino.
- The Value of LDR changes with the Light Exposed.
- The Value of LDR is printed to Serial monitor.
Working with LDR
EXPANDED TECHNICAL DETAILS
Analog-to-Digital Intensity Mapping
The LDR (Photoresistor) is the most common way to detect light levels in hobbyist electronics.
- Voltage Divider Theory: Since the Arduino cannot measure resistance directly, the LDR is paired with a 10kΩ resistor in a voltage divider circuit. As light intensity increases, the LDR's resistance drops, causing the voltage at the analog pin to rise.
- ADC Sampling: The Arduino's 10-bit ADC converts the voltage into a value from 0 (Deep darkness) to 1023 (Direct sunlight).
Practical Applications
- Auto-Nightlights: Includes logic to trigger a relay or LED when the light level drops below a set threshold.
- Hysteresis: The firmware implements a small "Deadzone" to prevent the light from flickering back and forth when the ambient light is exactly at the threshold, ensuring a stable and professional user experience.