Smart Street Light System
This article contains information about the system me and my group members had built for our mini project “Smart Street Light System” which switches the street light on and off as the car pass near the sensor.
The project comprises of
This article will show how to develop the hardware for the project.
The role of the hardware is to sense the car existence. The led then turns the light on and off depending on the existence of car.
The hardware code is written in Arduino.
Architecture of Smart Street Light System:

Details on every part of the architecture:
1. Output of the LDR pin is connected to A0 (analog) port of Arduino Uno board.
2. Connect all output of the IR sensors to port numbers A1, A2, A3, A4 and A5 respectively (analog) which is the input signal to the Arduino board.
3. Connect the ground of all the IR sensors to GND port.
4. The output signals from LED are connected to port number 5, 6, 9, 10 and 11 respectively.
5. Again connect all the negative terminals of LED’s to GND port.
6. Power is passed to the Arduino (7–12V)
Block Diagram

1. Arduino is connected to the power supply using USB cable.
2. The Sensor senses the vehicle passing though it.
3. The LDR detects the light and switch the street lights ON/OFF accordingly.
4. The LED gets ON at high intensity as the IR Sensor detects the vehicle near it.
CODE
int ir1 = A1;
int ir2 = A2;
int ir3 = A3;
int led1 = 3;
int led2 = 4;
int led3 = 5;
int ldr = A0;
int proxy1=0;
int proxy2=0;
int proxy3=0;
void setup()
{
Serial.begin (9600);
pinMode(ir1,INPUT);
pinMode(ir2,INPUT);
pinMode(ir3,INPUT);
pinMode (ldr,INPUT);
pinMode(led1,OUTPUT);
pinMode(led2,OUTPUT);
pinMode(led3,OUTPUT);
}
void loop(){
Serial.println(analogRead(A0));
int ldrStatus = analogRead (ldr);
if (ldrStatus <=500)
{
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
proxy1=digitalRead(ir1);
proxy2=digitalRead(ir2);
proxy3=digitalRead(ir3);
if(proxy1==LOW)
{
digitalWrite(led1,HIGH);
}
else
{
digitalWrite(led1,LOW);
}
if(proxy2==LOW)
{
digitalWrite(led2,HIGH);
}
else
{
digitalWrite(led2,LOW);
}
if(proxy3==LOW)
{
digitalWrite(led3,HIGH);
}
else
{
digitalWrite(led3,LOW);
}
}
else
{
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
}
}
Connect the IR and LDR sensor to the board and then upload this code on to the board from the Arduino IDE.
Result:
● As soon as the car passes by the IR Sensor the Street Light gets On at a high intensity.
● And as the car moves ahead the Street Light gets On and Off accordingly
● When the Sun rises the Street Light get Off automatically.
● When the Sunsets the Street Light gets On automatically.
