TRAFFIC SIGNAL CONTROL PROJECT USING ARDUINO

0
6732

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.
  • First of all, design a circuit in Proteus as shown in the below figure:

Traffic-Signal-Control-Project-using-Arduino

  • Its quite a simple project so the circuit is quite simple as well. You can see I have just placed an Arduino board and plugged three LEDs with it and obviously they are Green, Yellow and Red in color.
  • These LEDs are attached to pins 2,3 and 4 of Arduino UNO.
  • Now next step is to write the Arduino Code, so I have written and it is shown below:

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

  • That’s the complete code for this project and I think its quite self explanatory plus I have also changed the color accordingly.
  • First of all Green LED is ON and the rest are OFF which is shown in green color.
  • Next Red LED is ON and the rest are OFF after around 10 seconds which you can change by changing these delays.
  • Finally the Yellow LED will be ON and you can see it goes OFF just after 3 sec because it has short delay, you can change these delays quite easily.
  • Below is the flow chart of above programming which will clear the theme properly.Traffic-Signal-Control-Project-using-Arduino1
  • Now compile your Arduino code and get the hex file.
  • Now when you upload the hex file into your Arduino, it will give output as shown below:

Traffic-Signal-Control-Project-using-Arduino2