Engineers Gallery

TRAFFIC SIGNAL CONTROL PROJECT USING ARDUINO

INTRODUCTION:

Traffic Signal Control is quite a usual thing. We see traffic signals daily on our roads and usually engineers are asked to design such projects in their initial semesters. If we look at the traffic signals then we can see they are simply turning ON and OFF lights at some fixed regular intervals. and the pattern is quite simple as well. so I have simply followed that pattern and design the code. So let’s start with designing this project.

Traffic-Signal-Control-Project-using-Arduino

ARDUINO CODE:

#define GreenLed 4
 #define YellowLed 3
 #define RedLed 2
void setup()
 {
 pinMode(GreenLed, OUTPUT);
 pinMode(YellowLed, OUTPUT);
 pinMode(RedLed, OUTPUT);
 }
void loop()
 {
digitalWrite(GreenLed, HIGH);
digitalWrite(YellowLed, LOW);
digitalWrite(RedLed, LOW);
delay(5000);delay(5000);
 digitalWrite(GreenLed, LOW);
digitalWrite(YellowLed, LOW);
digitalWrite(RedLed, HIGH);
 delay(5000);delay(5000);
 digitalWrite(GreenLed, LOW);
digitalWrite(YellowLed, HIGH);
digitalWrite(RedLed, LOW);
 delay(3000);
 }

 

Exit mobile version