Learning Objective
Learn how to use a photoresistor (LDR) to detect light levels and create an automatic brightness control system with Arduino Uno.
What is a Photoresistor (LDR)?
A Photoresistor, also called a Light Dependent Resistor (LDR), is a special type of resistor whose resistance changes based on the amount of light hitting its surface.
Key Principle
More Light = Less Resistance
Less Light = More Resistance
Typical Resistance Values:
- ☀️ Bright Sunlight ~200Ω
- 💡 Normal Room Light ~1kΩ - 10kΩ
- 🌙 Complete Darkness ~1MΩ - 10MΩ
The Voltage Divider Principle
Since Arduino can only read voltage (not resistance directly), we use a voltage divider circuit to convert the LDR's changing resistance into a changing voltage.
📐 Voltage Divider Formula
Vout = Vin × (R2 / (R1 + R2))
Where:
• Vin = 5V (Arduino power)
• R1 = LDR (variable resistance)
• R2 = 10kΩ fixed resistor
• Vout = Voltage read by Arduino
How It Works:
- Bright Light: LDR resistance LOW → Vout HIGH (close to 5V)
- Darkness: LDR resistance HIGH → Vout LOW (close to 0V)