Summary
Street lighting is an essential part of urban infrastructure, but traditional systems often waste electricity by remaining ON even when sufficient daylight is available. In smart cities, automated street lighting systems help reduce power consumption by switching lights ON only when required, improving energy efficiency while reducing operational costs. A Smart Street Light System is an excellent Arduino project because it combines sensor interfacing, digital outputs, and embedded decision-making into a practical real-world application. The project uses an LDR (Light Dependent Resistor) to detect ambient light levels and automatically controls an LED or street lamp based on the surrounding brightness. In this tutorial, we'll build a simple Smart Street Light System using an Arduino Uno, an LDR sensor, and an LED. By the end of this project, you'll understand how light sensing works and how Arduino can automate lighting systems used in homes, campuses, highways, and smart city applications.

How Does a Smart Street Light System Work?
The project uses an LDR to continuously measure the surrounding light intensity.
During the daytime, the LDR receives plenty of light, causing its resistance to decrease. The Arduino interprets this as daylight and keeps the street light OFF.
As evening approaches, the ambient light level decreases. The resistance of the LDR increases, changing the voltage supplied to the Arduino's analog input.
Once the measured light intensity falls below a predefined threshold, the Arduino switches ON the street light.
The working sequence is simple:
-
Bright daylight → Street light OFF
-
Low ambient light → Street light ON
-
Sunrise → Street light OFF again
This automatic operation eliminates manual switching and helps conserve electricity.
Components and Supplies
Components Required
You'll need the following components.
Electronics
-
LDR Sensor (Photoresistor)
-
10kΩ Resistor
-
LED (or High-Power LED Module)
-
220Ω Resistor
-
USB Cable
Optional Components
-
Relay Module
-
AC Street Lamp
-
ESP32 Development Board
-
Solar Panel
-
Rechargeable Battery
Understanding the Components
Arduino Uno
The Arduino Uno acts as the controller of the project.
It continuously reads the light intensity from the LDR and decides whether the street light should remain ON or OFF.
LDR Sensor
An LDR (Light Dependent Resistor) changes its resistance depending on the amount of light falling on its surface.
-
Bright Light → Low Resistance
-
Darkness → High Resistance
Since Arduino measures voltage rather than resistance, the LDR is connected as a voltage divider using a 10kΩ resistor.
The Arduino reads this voltage through one of its analog input pins.
LED
The LED represents the street light.
When darkness is detected, the Arduino switches the LED ON.
For real-world applications, the LED can be replaced with a relay controlling an actual AC street lamp.
Circuit Connections
LDR Connections
| Connection | Arduino Pin |
|---|---|
| LDR Terminal 1 | 5V |
| LDR Terminal 2 | A0 |
| 10kΩ Resistor Terminal 1 | A0 |
| 10kΩ Resistor Terminal 2 | GND |
The LDR and the 10kΩ resistor together form a voltage divider.
LED Connections
| Component | Arduino Pin |
|---|---|
| LED Anode (via 220Ω Resistor) | Pin 8 |
| LED Cathode | GND |
Arduino Power Connections
| Connection | Arduino Pin |
|---|---|
| USB Cable | USB Port |
| DC Adapter (Optional) | DC Barrel Jack (7V–12V) |
| Breadboard Positive Rail | 5V |
| Breadboard Negative Rail | GND |
Breadboard Connections (Optional)
-
Connect the Arduino 5V pin to the positive power rail of the breadboard.
-
Connect the Arduino GND pin to the negative power rail of the breadboard.
-
Connect the LDR and 10kΩ resistor using these power rails.
-
Connect the LED cathode to the negative rail (GND).
-
Connect the 220Ω resistor between Arduino Pin 8 and the LED anode.
Building the Project
Step 1: Assemble the Circuit
-
Place the Arduino Uno near the breadboard.
-
Insert the LDR and 10kΩ resistor to form the voltage divider.
-
Connect the LED through a 220Ω resistor to Pin 8.
-
Double-check all wiring before powering the circuit.
Step 2: Position the LDR
Place the LDR where it can receive ambient light naturally.
Avoid placing it directly beneath the LED, as the LED's light may affect the sensor readings.
Step 3: Upload the Program
-
Connect the Arduino to your computer using a USB cable.
-
Upload the Arduino sketch using the Arduino IDE.
-
Once uploaded, the Arduino begins monitoring the ambient light continuously.
Step 4: Test Under Different Lighting Conditions
-
Cover the LDR with your hand or a dark object. The LED should turn ON.
-
Expose the LDR to room light or sunlight. The LED should switch OFF automatically.
Arduino Code
// Smart Street Light System Using Arduino
const int ldrPin = A0;
const int ledPin = 8;
// Adjust this threshold during calibration
const int threshold = 500;
void setup() {
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
int lightValue = analogRead(ldrPin);
Serial.print("LDR Value: ");
Serial.println(lightValue);
if(lightValue < threshold){
digitalWrite(ledPin, HIGH);
}
else{
digitalWrite(ledPin, LOW);
}
delay(200);
}
How the Code Works
The Arduino continuously reads the analog voltage from the LDR using the analogRead() function.
The measured value ranges from 0 to 1023.
If the light intensity falls below the predefined threshold, the Arduino considers it to be dark and switches ON the LED.
When the ambient light increases above the threshold, the LED is switched OFF.
The LDR values are also printed to the Serial Monitor, making it easy to observe sensor readings and fine-tune the threshold for different environments.
Calibrating the Sensor
Every LDR behaves slightly differently, so calibration is important.
Open the Serial Monitor and observe the sensor values under different lighting conditions.
Example
-
Bright Room: 780
-
Evening: 520
-
Dark Room: 240
Choose a threshold value somewhere between daylight and darkness.
For example:
Threshold = 500
You may need to adjust this value depending on your surroundings.

Testing the Project
After uploading the code, test the following conditions.
Bright Light
Expected Result:
The LED remains OFF.
Partial Shade
Expected Result:
The LED may remain OFF or begin switching depending on the selected threshold.
Darkness
Expected Result:
The LED turns ON automatically.
Moving Between Light and Dark
Expected Result:
The LED switches ON and OFF smoothly as the ambient light changes.
Project Improvements
Once the basic system is working, several enhancements can make it more practical.
Some useful upgrades include:
-
Relay Module to control an actual AC street lamp
-
ESP32 Development Board for IoT monitoring
-
Motion Sensor for adaptive brightness
-
Solar charging system
-
OLED Display for light intensity
-
RTC Module for time-based operation
-
Multiple street lights connected in a network
-
Automatic fault detection
These upgrades transform the project into a smart city lighting system capable of large-scale deployment.
Final Thoughts
A Smart Street Light System is one of the most practical beginner Arduino projects because it demonstrates how a microcontroller can sense changes in the environment and automate a real-world task. By combining an LDR with simple decision-making logic, the system automatically controls lighting based on ambient conditions, making it an excellent introduction to embedded systems and automation.
For anyone interested in building a smart street light project India, this tutorial provides a strong foundation in sensor interfacing and Arduino programming. Once you've mastered this build, you can extend it with motion detection, IoT connectivity, or solar power to create a more advanced smart city lighting solution.






