Smart Street Light Using Ir Sensor With Arduino

18,199

46

64

Published

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

  • Make it Move Contest

    Make it Move Contest
  • Microcontroller Contest

    Microcontroller Contest
  • Woodworking Contest

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

64 Comments

Is there a need of interfacing between PIR sensor and arduino

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

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

}

}

Hi
We are also make ir sensor project...
It is nice project and electricity saver project that is help in future,but one problem the led port was not connected properly so please send wireing of the project..Fast..

1 reply

Please Give me the details of IR sensor (model no, etc) and where to buy it ??

1 reply

Ir sensor is same everywhere......
Just buy it sensor as shown in picture or search it on online website

Sir jab din me vehicle movement hogi to kia tab b lights on ho jayen gi kia?

1 reply

Han..... Ho jayegi...
Din m band krne k liye ldr lagana padega

Hi. please i have code about ir sensor interrupt which use for know traffic state and control with light signal .Excuse Compulsively

7 replies

If you have have code then what can I do for you

nothing .also i face problem in write interrupt ir sensor interrupt code..can you help me in my proect??expline its

excuse me for bothering but I want interrupt code and don't know how write it ...because my program contain alot of commends....could you write interrupt?and in your code not contain ir library is not it? ?

i dont know how write interrupt and this is i want from you and ir library ...i want interrupt for ir sensor to know density state and deal it...can you help me ?.