Parts Required:-
- 4*Red led
- 4*Green Led
- 4*Yellow led
- 12 * 100ohm resister
- 4 * small size vero board
- ARDUINO UNO
- wire and tools
- At first check that all led are properly working or not...
- Then take one each red,green,yellow led and insert them in the vero board..
- Now connect all ground pin of the leds to make a common ground connection..
- Now it time to add resister to each led...
- Connect +ve terminal of the leds to the register and connect some wire for fearure use as described in the video...
- Now repeat the above process 3 times more...
- So at the end you will have 4 panels of led each having one red led,one green led and one yellow led...
- Now connect ground pin of all the 4 panels to make a common ground connection for all the leads....
- And then connect that common ground wire to the GND of the arduino uno....
- Now connect as below
1.red led------------->a0
1.yellow led--------->a1
1green led------------>a2
2.red led------------->a3
2.yellow led--------->a4
2.green led------------>a5
3.red led------------->a6
3.yellow led--------->a7
3.green led------------>a8
4.red led------------->a9
4.yellow led--------->a10
4.green led------------>a11
Arduino Code:-
/////www.beginnertopro.in////
////Arduino Controlled Trafic Light Arduino Code///
//iontialising the 1st panel variables
int panel1_red=0;
int panel1_yellow=1;
int panel1_green=2;
//intialising the 2nd panel variables
int panel2_red=3;
int panel2_yellow=4;
int panel2_green=5;
//intialising the 3rd panel variables
int panel3_red=6;
int panel3_yellow=7;
int panel3_green=8;
//intialising the 4th panel variables
int panel4_red=9;
int panel4_yellow=10;
int panel4_green=11;
void setup() {
// put your setup code here, to run once:
//Intialy Turning all light Off
pinMode(panel1_red,LOW);
pinMode(panel1_yellow,LOW);
pinMode(panel1_green,LOW);
pinMode(panel2_red,LOW);
pinMode(panel2_yellow,LOW);
pinMode(panel2_green,LOW);
pinMode(panel3_red,LOW);
pinMode(panel3_yellow,LOW);
pinMode(panel3_green,LOW);
pinMode(panel4_red,LOW);
pinMode(panel4_yellow,LOW);
pinMode(panel4_green,LOW);
}
void loop() {
// put your main code here, to run repeatedly:
//Turning on the panel1 Green light on and all rest panel redlight on
digitalWrite(panel1_green,HIGH);
digitalWrite(panel2_red,HIGH);
digitalWrite(panel3_red,HIGH);
digitalWrite(panel4_red,HIGH);
delay(100);
digitalWrite(panel1_green,LOW);
digitalWrite(panel2_red,LOW);
digitalWrite(panel3_red,LOW);
digitalWrite(panel4_red,LOW);
//Turning on the panel2 Green light on and all rest panel redlight on
digitalWrite(panel1_green,HIGH);
digitalWrite(panel1_red,HIGH);
digitalWrite(panel3_red,HIGH);
digitalWrite(panel4_red,HIGH);
delay(100);
digitalWrite(panel2_green,LOW);
digitalWrite(panel1_red,LOW);
digitalWrite(panel3_red,LOW);
digitalWrite(panel4_red,LOW);
//Turning on the panel3 Green light on and all rest panel redlight on
digitalWrite(panel3_green,HIGH);
digitalWrite(panel1_red,HIGH);
digitalWrite(panel3_red,HIGH);
digitalWrite(panel4_red,HIGH);
delay(100);
digitalWrite(panel3_green,LOW);
digitalWrite(panel1_red,LOW);
digitalWrite(panel3_red,LOW);
digitalWrite(panel4_red,LOW);
//Turning on the panel4 Green light on and all rest panel redlight on
digitalWrite(panel4_green,HIGH);
digitalWrite(panel1_red,HIGH);
digitalWrite(panel3_red,HIGH);
digitalWrite(panel2_red,HIGH);
delay(100);
digitalWrite(panel4_green,LOW);
digitalWrite(panel1_red,LOW);
digitalWrite(panel3_red,LOW);
digitalWrite(panel2_red,LOW);
}
Now install the arduino code in your arduino and have a test....
For Making Watch This Video:-
Thanks for your support...
Please like share and comment....
Leave Your Comments here !!!