Skip to main content

LDR Controlled Street Light Using Arduino UNO – Step by Step Tutorial

LDR Controlled Street Light using Arduino UNO | MakeMindz
Beginner Project

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.

🌿 Energy Efficient ⚡ Beginner Friendly 🔬 Tinkercad Compatible
Circuit diagram: LDR voltage divider on A0, LED on Digital Pin 7 via 220Ω resistor

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

#ComponentValue / Note
01Arduino UNOMain microcontroller
02LDR (Light Dependent Resistor)Any standard photoresistor
03Resistor10kΩ — voltage divider pull-down
04LEDAny colour — simulates street light
05Resistor220Ω — LED current limiting
06BreadboardFull or half-size
07Jumper WiresMale-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)

0 → LED ON 500 1023 → LED OFF
⚙️

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

LDR → Arduino UNO
Leg 15V (Arduino)
Leg 2Analog Pin A0
A010kΩ Resistor → GND (voltage divider)

The 10kΩ resistor pulls A0 toward GND so the voltage changes proportionally to light intensity.

Step 2 — LED (Street Light)

LED → Arduino UNO
Anode (+)220Ω Resistor → Digital Pin 7
Cathode (−)GND

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.

sketch.ino — Arduino C++
// =========================================
//  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.

Arduino code screenshot for LDR controlled street light project
Arduino IDE code screenshot — LDR Street Light sketch

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.

  1. 1
    Open Tinkercad.com and log in
  2. 2
    Click Circuits → Create New Circuit
  3. 3
    Add these components: Arduino UNO, LDR, 10kΩ Resistor, 220Ω Resistor, LED
  4. 4
    Wire the LDR voltage divider to A0, and the LED via 220Ω to Pin 7
  5. 5
    Click Code → Blocks or Text, paste the Arduino code above
  6. 6
    Click Start Simulation
  7. 7
    Click on the LDR in the simulation and drag the light slider to test dark vs bright conditions
FREE SIMULATION

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 Simulation

Real-World Applications

🛣️
Street Lighting Systems
🌿
Garden & Pathway Lights
🚗
Highway Lighting
🏙️
Smart City Projects
🏠
Home Energy Saving
📡
IoT Monitoring Add-on

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.

More Projects on MakeMindz

Comments