LDR Controlled Street Light using Arduino UNO
An automatic street light that turns ON when it gets dark and OFF during daylight — powered by a Light Dependent Resistor and Arduino UNO. Perfect for beginners learning sensor-based automation.
The LDR Controlled Street Light using Arduino UNO is a simple and energy-efficient automation project. This system automatically turns ON a street light when it gets dark and turns it OFF during daylight — without any human intervention.
This project can be designed and simulated using Tinkercad, making it perfect for beginners and students learning Arduino before touching real hardware.
Project Objectives
Auto-control lights based on ambient brightness
Save electrical energy with smart switching
Learn how to use LDR with Arduino analog pins
Understand voltage divider circuits in practice
Components Required
| # | Component | Value / Note |
|---|---|---|
| 01 | Arduino UNO | Main microcontroller |
| 02 | LDR (Light Dependent Resistor) | Any standard photoresistor |
| 03 | Resistor | 10kΩ — voltage divider pull-down |
| 04 | LED | Any colour — simulates street light |
| 05 | Resistor | 220Ω — LED current limiting |
| 06 | Breadboard | Full or half-size |
| 07 | Jumper Wires | Male-to-male |
Working Principle
The LDR (Light Dependent Resistor) changes its resistance based on light intensity. Combined with a 10kΩ resistor, it forms a voltage divider that feeds a varying voltage into Arduino's analog pin A0 (values 0–1023).
☀️ Bright Light
- LDR resistance decreases
- Voltage at A0 increases
- Value > threshold (500)
- LED turns OFF
🌙 Darkness
- LDR resistance increases
- Voltage at A0 decreases
- Value < threshold (500)
- LED turns ON
Analog Reading Range (0 – 1023)
Tip: Adjust the threshold value (500) in the code depending on your room's ambient light level. Print ldrValue to Serial Monitor to find the right threshold for your environment.
Step-by-Step Circuit Connections
Step 1 — LDR Voltage Divider
The 10kΩ resistor pulls A0 toward GND so the voltage changes proportionally to light intensity.
Step 2 — LED (Street Light)
The 220Ω resistor limits current to protect the LED from burning out.
Arduino Code
Upload this sketch to your Arduino UNO. The code reads the LDR value on A0 and controls the LED on pin 7 based on a threshold.
// =========================================
// LDR Controlled Street Light
// MakeMindz.com | Arduino UNO Project
// LDR → A0 (voltage divider with 10kΩ)
// LED → Pin 7 (via 220Ω resistor)
// =========================================
int ldrPin = A0;
int ledPin = 7;
int threshold = 500; // Adjust based on your environment
void setup() {
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
Serial.println("LDR Street Light — Ready");
}
void loop() {
int ldrValue = analogRead(ldrPin);
Serial.print("LDR Value: ");
Serial.println(ldrValue);
if (ldrValue < threshold) {
digitalWrite(ledPin, HIGH); // Dark → Turn ON light
} else {
digitalWrite(ledPin, LOW); // Bright → Turn OFF light
}
delay(500); // Check every 0.5 seconds
}
Serial Monitor tip: Open the Serial Monitor (baud: 9600) after uploading. Cover the LDR with your hand and watch the value drop below 500 — the LED should turn ON automatically.
Simulate in Tinkercad
You can run this project entirely in your browser using Tinkercad — no physical components needed. Great for testing before building the real circuit.
- 1Open Tinkercad.com and log in
- 2Click Circuits → Create New Circuit
- 3Add these components: Arduino UNO, LDR, 10kΩ Resistor, 220Ω Resistor, LED
- 4Wire the LDR voltage divider to A0, and the LED via 220Ω to Pin 7
- 5Click Code → Blocks or Text, paste the Arduino code above
- 6Click Start Simulation
- 7Click on the LDR in the simulation and drag the light slider to test dark vs bright conditions
Try It on Tinkercad Now
Open the pre-built simulation — no sign-up required to view. Click "Copy and Tinker" to edit your own version.
Open Tinkercad SimulationReal-World Applications
Advantages
- ✓Saves electricity — lights only turn ON when truly needed
- ✓Reduces human effort — fully automatic, zero manual switching
- ✓Low cost and simple design — under ₹150 / $2 in components
- ✓Beginner friendly — ideal first sensor project for Arduino students
- ✓Expandable to IoT — add Wi-Fi module for remote monitoring
Conclusion
The LDR Controlled Street Light using Arduino UNO is a simple yet powerful automation project. It automatically controls lighting based on environmental brightness, reducing power consumption and removing the need for manual switching.
This project builds a strong foundation in analog sensor reading, voltage dividers, and conditional logic — core skills you'll use in every future Arduino and IoT project.
Next step: Upgrade this project by adding a relay module to control a real AC bulb, or add an ESP8266 to monitor light levels over Wi-Fi from your phone.
Comments
Post a Comment