Light Sensor (LDR)

What is LDR?
A Light Dependent Resistor (LDR) is a photoresistor whose resistance decreases as the intensity of light increases. It's the simplest way to give your projects the gift of sight. Perfect for basic Arduino projects.
Made from Cadmium Sulfide (CdS), LDRs work on the principle of Photoconductivity. Resistance ranges from 1MΩ in darkness to ~1kΩ in bright light. Learn more about Arduino analog inputs.
Key Features
Wide Range
Resistance varies from 1MΩ (dark) to 1kΩ (bright light) for versatile applications.
Low Cost
One of the cheapest sensors available, perfect for budget-friendly projects.
Simple Interface
Passive component requiring only a voltage divider circuit with one resistor.
No Power Required
Passive sensor that doesn't need external power supply to operate.
Day/Night Detection
Perfect for detecting ambient light levels and day/night cycles automatically.
Easy Integration
Works with any microcontroller's analog input pin without special libraries.
Pin Configuration
Pin 1
Connect to voltage divider circuit with 10kΩ resistor. Non-polarized component.
Pin 2
Connect to Arduino analog pin (A0-A5) to read light intensity values.
⚠️ Important: Voltage Divider Circuit
LDR must be used with a 10kΩ resistor in a voltage divider configuration. Connect: 5V → LDR → Analog Pin → 10kΩ Resistor → GND
How It Works
The Science Behind It
An LDR works based on Photoconductivity. The sensor is made of a high-resistance semiconductor material like Cadmium Sulfide (CdS).
When photons (light particles) hit the sensor, they are absorbed and transfer energy to the electrons, allowing them to jump the "band gap" and flow as electricity. This effectively lowers the resistance of the component.
Resistance Behavior:
Dark Environment = High Resistance (1MΩ)
Bright Light = Low Resistance (1kΩ)
Analog Reading = (Voltage at Pin / 5V) × 1023Wiring Tips & Best Practices
Voltage Divider
Always use with 10kΩ resistor. Higher values (100kΩ) work for more sensitive detection.
Placement
Mount LDR where it can receive ambient light without direct shadows or reflections.
Response Time
LDRs are slow (20-30ms response). Not suitable for fast-changing light detection.
Temperature
Resistance varies with temperature. Keep away from heat sources for accurate readings.
Calibration
Read values in your environment (dark/bright) and set thresholds in code accordingly.
Non-Polarized
Can be connected in either direction. No positive or negative terminal.