Traffic Light System using Arduino
ARDUINO:
Arduino is Basic system which is used for the controlling various system that does lots of work.The arduino develope in 2003,the arduino is basically a microcontroling unit the code return in the form 8 bit ,32 bit which is return in the language of C and C++`The RAM in arduino is SRAM.
Traffic Light System:
The traffic light system is which is commonly known System that is used in controlling traffic and accidents in Junction roads.Thus we are going to make this in the arduino system which is the easiest way of making the Automatic Traffic light system.
Components Required:
1)Arduino
2)LEDS=Green,Yellow,Red
3)Breadboard
4)Connecting wires
Wiring Diagram:
Procedure:
Connect the green,red,yellow to the Breadboard and connect the three led Gnd to the Gnd pin of the Arduino.At first connect the Green Led to the 2 pin and next connect the Yellow Led to the 3 pin and atlast connect the Red Led to the 4 pin of the Arduino.And copy the code from from the below given and upload the code to the Arduino.Now the circuit works.
SOURCE CODE:
int redled = 3;//NBSL Commercial
int yellowled = 4;
int greenled = 5;
void setup() {
pinMode (3, OUTPUT);
pinMode (4, OUTPUT);
pinMode (5, OUTPUT);
}
void loop() {
Serial.begin(9600);
Serial.println("STOP");
digitalWrite (redled, 1);
delay(9000);
digitalWrite (redled, 0);
Serial.println("READY TO MOVE");
digitalWrite (yellowled, 1);
delay (3000);
digitalWrite (yellowled, 0);
Serial.println("GO AHEAD");
digitalWrite (greenled, 1);
delay (9000);
digitalWrite (greenled, 0);
delay (500);
digitalWrite (greenled, 1);
delay (500);
digitalWrite (greenled, 0);
delay (500);
digitalWrite (greenled, 1);
delay (500);
digitalWrite (greenled, 0);
delay (500);
digitalWrite (greenled, 1);
delay (500);
digitalWrite (greenled, 0);
delay (500);
digitalWrite (greenled, 1);
delay (500);
digitalWrite (greenled, 0);
}
CHECK HOW IS IT WORK:
POWERED BY
NBSL
This comment has been removed by a blog administrator.
ReplyDelete