Smart Street Light Using Ir Sensor With Arduino

17,409

46

2

Posted in TechnologyElectronics

Introduction: Smart Street Light Using Ir Sensor With Arduino

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

  • Spotless Contest

    Spotless Contest
  • Science of Cooking

    Science of Cooking
  • Microcontroller Contest

    Microcontroller Contest
user

We have a be nice policy.
Please be positive and constructive.

5 Tips

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

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

}

}

5v to 5v and gnd to gnd?????

15 Questions

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

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

0

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

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

I have bought ready made ir circuit

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

You have to do your self... I am no longer working on this

Both negative of ir's is to be Ground right? And positive of ir transmitter is connect to 5v and positive trmnl of IR receiver is connect to Port 2,3,4 &5 right
And for led negative is connect to the grnd and positive is to be cannect to port,6,7,8,9,10 &11 right?

Where to connect the Gnd n +5v of sensor to arduino????

Arduino has 5v and ground pin

hello can you make the circuit more clear please .

Sorry for asking.But why did you used only 6 leds when 1 IR can control 3 leds?why did't u used 12 leds for all the IR's?And what should i change if i want to use 12 leds for all 4 IR's?Tanx in advance.

Yes Connect at as circuit...... And remain open that you not require

HI! I AM MAKING THIS PROJECT BUT I AM GETTING SOME TROUBLE WHILE UPLODING CODES. WHILE UPLODING CODES THIS MESSAGE IS SHOWING SOME MESSAGE AND I HAVE ADDED ONE IMAGE KINDLY CHECK THIS UP. FOR CONTACT ME KINDLY INFORM ME AT kakadiapramey12@gmail.com

Screenshot (12).png

One curly breaches are missing...... Again download the program

This codes aren't working??? Please help me with it

The program is in which language?

2 Comments

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 reply

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

}

}