Smart Street Light Using Ir Sensor With Arduino
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
- arduino uno
- ir sensor (4)
- 10mm LEDs (6)
- connecting wire
- 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
DoUlat 4 years ago
Please Please Please 🙏
Help me
MohamedM463 5 years 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
SantuM4 4 years ago
Aung Yarza 4 years ago
rajkumar maddipati 4 years ago
SarikaM2 5 years ago
vishalsoniindia 4 years ago
YogeshY23 5 years ago
vishalsoniindia 4 years ago
AlexS739 5 years ago
SamuelP127 6 years ago
the correct code is scroll down see in comments (omtaphM) comment
SamuelP127 6 years 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::::
Komalb30 6 years ago
vermasoooraj 6 years ago
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.
Pratik Ghodake 6 years ago
The MobileG 6 years ago
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
OmtaphM 6 years 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);
}
}
The MobileG 6 years ago
OmtaphM 6 years 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);
}
}
OmtaphM 6 years 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);
}
}