Smart Street Light Using Ir Sensor With Arduino

30,356

47

98

About: i am 20 year old electrical engineer from india.

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.

Share

Recommendations

  • First Time Author

    First Time Author
  • Make it Glow Contest 2018

    Make it Glow Contest 2018
  • PCB Contest

    PCB Contest

98 Discussions

0
None
YogeshY23

Question 19 days ago

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??

0
None
AlexS739

3 months ago

The sketch is asking for a token..what is the token...plz tell me

0
None
SarikaM2

Question 3 months ago on Introduction

How will we join 4 ir sensors to gnd and 5v

1
None
MohamedM463

6 months ago

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

0
None
SamuelP127

Tip 8 months ago

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

0
None
SamuelP127

Tip 8 months ago

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::::

0
None
Komalb30

8 months ago on Introduction

Is there a need of interfacing between PIR sensor and arduino

0
None
vermasoooraj

Question 8 months ago on Step 2

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.

0
None
Pratik Ghodake

Question 8 months ago on Step 3

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...

0
None
The MobileG

9 months ago

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

1 reply
0
None
OmtaphMThe MobileG

Reply 8 months ago

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);

}

}

0
None
The MobileG

Question 9 months ago

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

1 answer
0
None
OmtaphMThe MobileG

Answer 8 months ago

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);

}

}

0
None
OmtaphM

8 months ago

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);

}

}

1
None
OmtaphM

Tip 8 months ago

Anyone,s whose project is working opposite(i.e. led's are turning off when an object is coming close to the IR sensor), Please use my codes it will work perfectly ,

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);

}

}

0
None
RudraO

Question 9 months ago

The circuit not working
Pls send me the detail for connecting ir transmitter and receiver connection and the amnt of resistance is to be connect and any separate circuit for IR trsmtr and IR photo diode

1 answer
0
None
soumyaavanti

Question 9 months ago

Sir,

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

so that the led doesnt glow in the morning

1 answer