Automatic Night Lamp Using an LDR
This simple project automatically switches on an LED when the surrounding light becomes dim and switches it off again during daylight. It is an excellent beginner project for learning about sensors, transistors and automatic control circuits.
Project Overview
A Light Dependent Resistor (LDR), also called a photoresistor, changes its resistance according to the amount of light falling on it.
During daylight, the LDR has a low resistance.
In darkness, its resistance increases dramatically. This change is used to switch a transistor ON, which powers an LED.
Project Difficulty
| Item | Value |
|---|---|
| Difficulty | ā Beginner |
| Build Time | 20ā30 minutes |
| Supply Voltage | 5ā12V DC |
| Soldering | Optional |
Components Required
| Quantity | Component |
|---|---|
| 1 | LDR (Photoresistor) |
| 1 | BC547 or 2N2222 NPN Transistor |
| 1 | LED |
| 1 | 330 Ī© LED Resistor |
| 1 | 10 kΩ Resistor |
| 1 | 100 kΩ Potentiometer (optional for sensitivity adjustment) |
| 1 | 5Vā12V DC Power Supply |
| 1 | Breadboard |
| Several | Jumper Wires |
How the Circuit Works
The LDR and resistor form a voltage divider.
As the light level decreases, the voltage at the transistor base changes.
Once the base voltage reaches approximately 0.7 V, the transistor turns ON and allows current to flow through the LED.
When daylight returns, the base voltage falls and the transistor switches OFF, turning the LED off automatically.
Circuit Connections
| Component | Connection |
|---|---|
| LDR | Connected between +V and transistor base. |
| 10 kΩ Resistor | Base to Ground. |
| BC547 Collector | LED through 330 Ī© resistor to +V. |
| BC547 Emitter | Ground. |
| Power Supply | 5ā12 V DC. |
How the LDR Works
| Light Level | LDR Resistance | LED |
|---|---|---|
| Bright Sunlight | Low (hundreds of ohms) | OFF |
| Indoor Lighting | Several kilo-ohms | OFF |
| Dim Room | Tens of kilo-ohms | Starts Turning ON |
| Darkness | Hundreds of kilo-ohms | ON |
Adjusting Sensitivity
Replacing the fixed resistor with a 100 kΩ potentiometer allows the light level at which the LED switches on to be adjusted.
This makes the circuit suitable for different environments.
Applications
- Automatic night lights.
- Garden lighting.
- Emergency lighting.
- Street light demonstrations.
- Security lighting.
- Display cabinet illumination.
- Solar lighting controllers.
Troubleshooting
| Problem | Possible Cause |
|---|---|
| LED never turns on | Incorrect transistor pinout or wiring. |
| LED always ON | LDR or resistor connected incorrectly. |
| Very poor sensitivity | Incorrect resistor values. |
| LED very dim | Supply voltage too low or resistor too large. |
| No operation | Power supply not connected. |
Project Improvements
- Use a relay to switch larger lamps.
- Add hysteresis using a comparator to prevent flickering.
- Replace the transistor with a MOSFET for higher current loads.
- Power the circuit from a rechargeable battery.
- Add a solar charging circuit.
- Use multiple LEDs for brighter illumination.
Skills Learned
- Using an LDR.
- Voltage divider circuits.
- NPN transistor switching.
- Automatic sensing circuits.
- Breadboard construction.
- Basic troubleshooting.