Smart Street Light

A Smart Streetlight is an automatic lighting system that turns ON when it gets dark and OFF when there is sufficient ambient light. This reduces energy consumption and adds automation to street lighting infrastructure. Using an Arduino Uno and a simple Light Dependent Resistor (LDR), we can simulate this behavior with a basic circuit on a breadboard.
Supplies
- Breadboard
- LDR
- LED
- 10K Ohm Resistor
- Jumper Wires
- Arduino Uno
Understand the Working Principle
- LDR (Light Dependent Resistor) decreases its resistance when light increases.
- Arduino reads the voltage across the LDR.
- When light level drops below a threshold, it turns ON the LED (representing a streetlight).
- When light level increases above the threshold, it turns OFF the LED.
Circuit Diagram Overview

- LDR Voltage Divider: LDR and 10K resistor will form a voltage divider to feed analog input to Arduino.
- LED Control: Arduino controls the LED through digital output pin 13.
Build the Circuit
- Place the LDR on Breadboard.
- Connect one end of the LDR to 5V on the Arduino.
- Connect the other end of the LDR to Analog Pin A2 and to one end of 10K Ohm resistor.
- Connect the other end of the resistor to GND.
- Connect the anode (long leg) of the LED to Digital Pin 13 of the Arduino.
- Connect the cathode (short leg) to GND (you can use a 220-ohm resistor in series to limit current).
- Use jumper wires to make all necessary connections on the breadboard.
Arduino Code
Open the Arduino IDE and upload the following code:
/*
* Project Name: Smart Street Light
* Designed For: Arduino UNO
*
*
* License: GPL3+
* This project is licensed under the GNU General Public License v3.0 or later.
* You are free to use, modify, and distribute this software under the terms
* of the GPL, as long as you preserve the original license and credit the original
* author. For more details, see <https://www.gnu.org/licenses/gpl-3.0.en.html>.
*
* Copyright (C) 2025 Ameya Angadi
*
* Code Created And Maintained By: Ameya Angadi
* Last Modified On: July 18, 2025
* Version: 1.2.0
*
*/
const int ledpin = 13; // LED Pin
const int lightpin = A2; // Analog Input Pin For LDR
const int thresholdVal = 10; // Light threshold (tune based on actual use)
void setup() {
Serial.begin(9600);
pinMode(ledpin, OUTPUT);
pinMode(lightpin, INPUT);
}
void loop() {
int lightsens = analogRead(lightpin); // Reads analog data from light sensor
Serial.println(lightsens); //Prints the value read by the sensor
if (lightsens < thresholdVal) {
digitalWrite(ledpin, HIGH); //Turns LED on
} else {
digitalWrite(ledpin, LOW); //Turns LED off
}
delay(200);
}
Downloads
Upload and Test
- Connect your Arduino Uno to your computer using the USB cable.
- Open the Arduino IDE.
- Select the correct board and port from the Tools menu.
- Upload the code.
- Open the Serial Monitor to see real-time light values.
- Cover the LDR with your hand – the LED should turn ON.
- Uncover it – the LED should turn OFF.
Tuning & Tips
- You may need to adjust the threshold value depending on your room lighting.
- To simulate streetlight at scale, replace the LED with a relay module to control a real bulb (use proper safety precautions).
- Add more sensors like motion detectors for advanced features.
Watch the YouTube Video for Step-by-step Tutorial

Conclusion
You've successfully built a Smart Streetlight using Arduino Uno! This simple project is a great introduction to light sensors, analog inputs, and automation using microcontrollers.
If you want to explore more, check out my profile for related projects, and don’t forget to follow me for updates on new tutorials and advanced projects!