Introduction
Street lights play a crucial role in public safety and urban infrastructure, but traditional street lighting systems waste a large amount of energy by operating continuously, even when not required. A Smart Street Light System is an intelligent solution that automatically controls street lights based on ambient light and motion detection, and can be monitored remotely using IoT technology.
This system significantly reduces power consumption, maintenance cost, and energy wastage, making it an essential part of smart cities.
Objective of the Project
- To automatically control street lights
- To reduce energy consumption
- To detect vehicle or human movement
- To monitor street lights remotely using IoT
Working Principle
- LDR detects ambient light (day/night)
- During night, the system activates
- PIR or IR sensor detects motion on the road
- Street light turns ON only when movement is detected
- Status and data are sent to cloud using IoT
Components Required
- ESP32 / NodeMCU (ESP8266)
- LDR (Light Dependent Resistor)
- PIR Motion Sensor / IR Sensor
- LED / Street Light (via relay)
- Relay Module
- Resistors
- Power Supply
- IoT Platform (ThingSpeak / Blynk / Firebase)
Block Diagram
LDR + Motion Sensor
↓
ESP32 / NodeMCU
↓
Relay Module
↓
Street Light
↓
Wi-Fi
↓
Cloud Platform
Circuit Connections (ESP32 Example)
LDR Circuit
LDR → GPIO34 (via voltage divider)
PIR Sensor
OUT → GPIO27
VCC → 5V
GND → GND
Relay Module
IN → GPIO25
VCC → 5V
GND → GND
IoT Arduino Code (Smart Street Light System)
#include <WiFi.h>
#include "ThingSpeak.h"
#define ldrPin 34
#define pirPin 27
#define relayPin 25
WiFiClient client;
const char* ssid = "Your_WiFi";
const char* password = "Your_Password";
unsigned long channelID = 123456;
const char* writeAPIKey = "YOUR_API_KEY";
void setup() {
Serial.begin(9600);
pinMode(pirPin, INPUT);
pinMode(relayPin, OUTPUT);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
}
ThingSpeak.begin(client);
}
void loop() {
int ldrValue = analogRead(ldrPin);
int motion = digitalRead(pirPin);
Serial.print("LDR: ");
Serial.println(ldrValue);
Serial.print("Motion: ");
Serial.println(motion);
// Night condition
if (ldrValue < 1500 && motion == HIGH) {
digitalWrite(relayPin, HIGH); // Light ON
} else {
digitalWrite(relayPin, LOW); // Light OFF
}
ThingSpeak.setField(1, ldrValue);
ThingSpeak.setField(2, motion);
ThingSpeak.writeFields(channelID, writeAPIKey);
delay(15000);
}
Code Explanation
- LDR detects day or night conditions
- PIR sensor detects movement
- Relay controls street light ON/OFF
- Data is uploaded to IoT cloud
Advantages
- Saves electricity
- Automatic operation
- Low maintenance
- Environment-friendly
Applications
- Smart cities
- Highways and streets
- Parking areas
- Campuses and industrial areas
Future Enhancements
- Solar-powered street lights
- AI-based traffic density control
- Fault detection and maintenance alerts
- Centralized city-wide monitoring
Conclusion
The Smart Street Light System is an efficient and sustainable solution for modern urban infrastructure. By combining automation, sensors, and IoT, it reduces energy wastage and enhances public safety.
