Smart Street Light Using Ir Sensor With Arduino

66K55148

Intro: Smart Street Light Using Ir Sensor With Arduino

Please SUBSCRIBEto my channel for more projects.

This project is about Smart street light, street light will turn on while vehicle is passing through it.
here we are using 4 IR sensors that senses the position of the vehicle,each IR sensor controls 3 LED's. When vehicle passes by a particular IR sensor it senses the position of vehicle and gives its signal to the arduino board and it will turn on the LED's.

ADVANTAGES:

If we uses this idea and implement to it in our society it will be helpful in saving enough amount of electricity and off-course money.

STEP 1: Components Required

  1. arduino uno
  2. ir sensor (4)
  3. 10mm LEDs (6)
  4. connecting wire
  5. foam board

STEP 2: Upload the Program

download and upload the program in arduino uno

STEP 3: Connect the Circuit

Connect all the components as given in the circuit diagram.

ir sensor 1 ---> 2

ir sensor 2 ---> 3

ir sensor 3 ---> 4

ir sensor 4 ---> 5

connect all ir sensor's to +5v and ground.

the positive pin of leds are connected to these pins of arduino.

led 1 ------> 6

led 2 ------> 7

led 3 ------> 8
led 4 ------> 9

led 5 ------> 10

led 6 ------> 11

and finally all ground pins of led connect to the ground of arduino.

STEP 4: Build Suitable Structure

To make these poles as given in above picture, use foam board and glue.

and you may also use black chart to make a road and wooden board for the base of pole.

102 Comments

Anyone Help Me If I use LDR than What will Be coding...!!
Please Please Please 🙏
Help me

Sir can i know how to add the LDR to this circuit a circuit diagram or a picture of the connection would be appriciated thx

bro i need home automation project using arduino controlling of lights and PIR sensor by using wireless communication bluetooth with programming please post
How will we join 4 ir sensors to gnd and 5v
I m making the same + LDR sensor to make it more reliable . So my question is that, where to connect the ports of LDR and what I have to add in program? Please help me about this. And also if I want to connect the system with IOT what I have to do??
remove IR and connect LDR at same pin or for IOT use ESP module
The sketch is asking for a token..what is the token...plz tell me

the correct code is scroll down see in comments (omtaphM) comment

hi

,I have finished my sisters project today finally I m from Andhra I used many youtubes videos but I cant do it and I came to these site I have done THANK YOU VERY MUCH (VISHALONINDIA)

YOU CAN ASK ANY QUESTION Samuelphilip2003@gmail.com

THE CORRECT CODE IS::::

Is there a need of interfacing between PIR sensor and arduino
Sir,

Can you please send me the circuit diagram and program for the same project using LDR

so that the LEDs doesnt glow in the morning.
Hello sir, I need a help, I need a code for the situation like at a time two vehicles are on the same Street on opposite sides...
I need some help sir.
You have given the pin configuration and conenctiom for only led and ir sensors! Can you please gove the circuit diagram from the input terminal and all other terminals used please! Like if there is a resistance or where is the input power given and so on! It would be of great help sir

int ir1=2;

int ir2=3;

int ir3=4;

int ir4=5;

int led1=6;

int led2=7;

int led3=8;

int led4=9;

int led5=10;

int led6=11;

int proxy1=0;

int proxy2=0;

int proxy3=0;

int proxy4=0;

void setup()

{

pinMode(ir1,INPUT);

pinMode(ir2,INPUT);

pinMode(ir3,INPUT);

pinMode(ir4,INPUT);

pinMode(led1,OUTPUT);

pinMode(led2,OUTPUT);

pinMode(led3,OUTPUT);

pinMode(led4,OUTPUT);

pinMode(led5,OUTPUT);

pinMode(led6,OUTPUT);

}

void loop(){

proxy1=digitalRead(ir1);

proxy2=digitalRead(ir2);

proxy3=digitalRead(ir3);

proxy4=digitalRead(ir4);

if(proxy1==HIGH)

{

digitalWrite(led1,LOW);

digitalWrite(led2,LOW);

digitalWrite(led3,LOW);

}

else

{

digitalWrite(led1,HIGH);

digitalWrite(led2,HIGH);

digitalWrite(led3,HIGH);

}

if(proxy2==HIGH)

{

digitalWrite(led2,LOW);

digitalWrite(led3,LOW);

digitalWrite(led4,LOW);

}

else

{

digitalWrite(led2,HIGH);

digitalWrite(led3,HIGH);

digitalWrite(led4,HIGH);

}

if(proxy3==HIGH)

{

digitalWrite(led3,LOW);

digitalWrite(led4,LOW);

digitalWrite(led5,LOW);

}

else

{

digitalWrite(led3,HIGH);

digitalWrite(led4,HIGH);

digitalWrite(led5,HIGH);

}

if(proxy4==HIGH)

{

digitalWrite(led4,LOW);

digitalWrite(led5,LOW);

digitalWrite(led6,LOW);

}

else

{

digitalWrite(led4,HIGH);

digitalWrite(led5,HIGH);

digitalWrite(led6,HIGH);

}

}

Sir im having a problem! The led is on all the time and when something is in fromt of the ir sensor the led switches off! What should i do

use this code

int ir1=2;

int ir2=3;

int ir3=4;

int ir4=5;

int led1=6;

int led2=7;

int led3=8;

int led4=9;

int led5=10;

int led6=11;

int proxy1=0;

int proxy2=0;

int proxy3=0;

int proxy4=0;

void setup()

{

pinMode(ir1,INPUT);

pinMode(ir2,INPUT);

pinMode(ir3,INPUT);

pinMode(ir4,INPUT);

pinMode(led1,OUTPUT);

pinMode(led2,OUTPUT);

pinMode(led3,OUTPUT);

pinMode(led4,OUTPUT);

pinMode(led5,OUTPUT);

pinMode(led6,OUTPUT);

}

void loop(){

proxy1=digitalRead(ir1);

proxy2=digitalRead(ir2);

proxy3=digitalRead(ir3);

proxy4=digitalRead(ir4);

if(proxy1==HIGH)

{

digitalWrite(led1,LOW);

digitalWrite(led2,LOW);

digitalWrite(led3,LOW);

}

else

{

digitalWrite(led1,HIGH);

digitalWrite(led2,HIGH);

digitalWrite(led3,HIGH);

}

if(proxy2==HIGH)

{

digitalWrite(led2,LOW);

digitalWrite(led3,LOW);

digitalWrite(led4,LOW);

}

else

{

digitalWrite(led2,HIGH);

digitalWrite(led3,HIGH);

digitalWrite(led4,HIGH);

}

if(proxy3==HIGH)

{

digitalWrite(led3,LOW);

digitalWrite(led4,LOW);

digitalWrite(led5,LOW);

}

else

{

digitalWrite(led3,HIGH);

digitalWrite(led4,HIGH);

digitalWrite(led5,HIGH);

}

if(proxy4==HIGH)

{

digitalWrite(led4,LOW);

digitalWrite(led5,LOW);

digitalWrite(led6,LOW);

}

else

{

digitalWrite(led4,HIGH);

digitalWrite(led5,HIGH);

digitalWrite(led6,HIGH);

}

}

Thanks for the project with detailed instructions, but I think your code is wrong, the leds are working opposite to what it should do, I made some changes to the codes and i am providing my code below for those who are facing the same issue.

USE IT , 100% WORKING

int ir1=2;

int ir2=3;

int ir3=4;

int ir4=5;

int led1=6;

int led2=7;

int led3=8;

int led4=9;

int led5=10;

int led6=11;

int proxy1=0;

int proxy2=0;

int proxy3=0;

int proxy4=0;

void setup()

{

pinMode(ir1,INPUT);

pinMode(ir2,INPUT);

pinMode(ir3,INPUT);

pinMode(ir4,INPUT);

pinMode(led1,OUTPUT);

pinMode(led2,OUTPUT);

pinMode(led3,OUTPUT);

pinMode(led4,OUTPUT);

pinMode(led5,OUTPUT);

pinMode(led6,OUTPUT);

}

void loop(){

proxy1=digitalRead(ir1);

proxy2=digitalRead(ir2);

proxy3=digitalRead(ir3);

proxy4=digitalRead(ir4);

if(proxy1==HIGH)

{

digitalWrite(led1,LOW);

digitalWrite(led2,LOW);

digitalWrite(led3,LOW);

}

else

{

digitalWrite(led1,HIGH);

digitalWrite(led2,HIGH);

digitalWrite(led3,HIGH);

}

if(proxy2==HIGH)

{

digitalWrite(led2,LOW);

digitalWrite(led3,LOW);

digitalWrite(led4,LOW);

}

else

{

digitalWrite(led2,HIGH);

digitalWrite(led3,HIGH);

digitalWrite(led4,HIGH);

}

if(proxy3==HIGH)

{

digitalWrite(led3,LOW);

digitalWrite(led4,LOW);

digitalWrite(led5,LOW);

}

else

{

digitalWrite(led3,HIGH);

digitalWrite(led4,HIGH);

digitalWrite(led5,HIGH);

}

if(proxy4==HIGH)

{

digitalWrite(led4,LOW);

digitalWrite(led5,LOW);

digitalWrite(led6,LOW);

}

else

{

digitalWrite(led4,HIGH);

digitalWrite(led5,HIGH);

digitalWrite(led6,HIGH);

}

}

More Comments