DIY Inventor
Published

Arduino Traffic Light/ Signal with LCD Counter Display

In this Project you will able to make Arduino Based Traffic Light or Traffic Signal with LCD in which Time left for Signal will be Shown.

BeginnerFull instructions provided12 minutes5,604
Arduino Traffic Light/ Signal with LCD Counter Display

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Alphanumeric LCD, 16 x 2
Alphanumeric LCD, 16 x 2
×1
5 mm LED: Red
5 mm LED: Red
×1
5 mm LED: Yellow
5 mm LED: Yellow
×1
3 mm LED: Green
3 mm LED: Green
×1
Resistor 1k ohm
Resistor 1k ohm
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

LiquidCrystal.h Library

Story

Read more

Custom parts and enclosures

Systematic

Connection of LED

Hook the GND pin (Negative Pin) of all led to Pin GND of Arduino.
Connect Red LED VCC Pin (Positive Pin) to Pin 9 of Arduino.
Connect Yellow LED VCC Pin (Positive Pin) to Pin 8 of Arduino.
Connect Green LED VCC Pin (Positive Pin) to Pin 7 of Arduino.
Connection of LCD

Connect the First pin from the left of LCD (GND pin) with GNDpin of Arduino.
Connect the Second pin from the left of LCD (VCC pin) with VCCpin of Arduino.
Connect the Third pin from the left of LCD (V0 pin) with GNDpin of Arduino.
Connect the Fourth pin from the left of LCD (RS pin) with 11pin of Arduino.
Connect the Fifth pin from the left of LCD (R/W pin) with GNDpin of Arduino.
Connect the Sixth pin from the left of LCD (E pin) with 10pin of Arduino.
Connect the Eleventh pin from the left of LCD (D4 pin) with 5pin of Arduino.
Connect the Twelveth pin from the left of LCD (D5 pin) with 4pin of Arduino.
Connect the Thirteen pin from the left of LCD (D6 pin) with 3pin of Arduino.
Connect the Fourteenth pin from the left of LCD (D7 pin) with 2pin of Arduino.
Connect the Fifteenth pin from the left of LCD (5V pin) with 1 K Resistor with 2pin of Arduino.
Connect the Last pin from the left of LCD (GND pin) with GND pin of Arduino.

Schematics

Circuit Diagram

Connection of LED

Hook the GND pin (Negative Pin) of all led to Pin GND of Arduino.
Connect Red LED VCC Pin (Positive Pin) to Pin 9 of Arduino.
Connect Yellow LED VCC Pin (Positive Pin) to Pin 8 of Arduino.
Connect Green LED VCC Pin (Positive Pin) to Pin 7 of Arduino.
Connection of LCD

Connect the First pin from the left of LCD (GND pin) with GNDpin of Arduino.
Connect the Second pin from the left of LCD (VCC pin) with VCCpin of Arduino.
Connect the Third pin from the left of LCD (V0 pin) with GNDpin of Arduino.
Connect the Fourth pin from the left of LCD (RS pin) with 11pin of Arduino.
Connect the Fifth pin from the left of LCD (R/W pin) with GNDpin of Arduino.
Connect the Sixth pin from the left of LCD (E pin) with 10pin of Arduino.
Connect the Eleventh pin from the left of LCD (D4 pin) with 5pin of Arduino.
Connect the Twelveth pin from the left of LCD (D5 pin) with 4pin of Arduino.
Connect the Thirteen pin from the left of LCD (D6 pin) with 3pin of Arduino.
Connect the Fourteenth pin from the left of LCD (D7 pin) with 2pin of Arduino.
Connect the Fifteenth pin from the left of LCD (5V pin) with 1 K Resistor with 2pin of Arduino.
Connect the Last pin from the left of LCD (GND pin) with GND pin of Arduino.

Code

Code

C/C++
#include <LiquidCrystal.h>
int red = 9;
int yellow = 8;
int green = 7;
//Designer Krishna Agarwal (DIY Inventor)
//Devloper Krishna Agarwal (DIY Inventor)
//Code by Krishna Agarwal (DIY Inventor)
LiquidCrystal lcd(11, 10, 5, 4, 3, 2); 

void setup(){
  
  pinMode(red, OUTPUT);
  pinMode(yellow, OUTPUT);
  pinMode(green, OUTPUT);
    lcd.begin(16, 2);
    lcd.setCursor(0, 0);
    lcd.print("   Turning On   ");
    lcd.setCursor(0, 1);
    lcd.print(" Traffic  Light ");
    delay(2000);
  lcd.clear();
lcd.setCursor(0, 0);
    lcd.print("     SYSTEM");
    lcd.setCursor(0, 1);
    lcd.print("       ON");
    delay(1500);
  lcd.clear();

    
}
void loop(){
 lcd.begin(16, 2);
  lcd.setCursor(0, 0);
    lcd.print("Stop Red Light ");
    lcd.setCursor(0, 1);
    lcd.print("15 Second");
  digitalWrite(red, HIGH);
    delay(1000);
 
lcd.setCursor(0, 1);
    lcd.print("14 Second");
  digitalWrite(red, HIGH);
    delay(1000); 
  lcd.setCursor(0, 1);
    lcd.print("13 Second");
  digitalWrite(red, HIGH);
    delay(1000);
lcd.setCursor(0, 1);
    lcd.print("12 Second");
  digitalWrite(red, HIGH);
    delay(1000);
    lcd.setCursor(0, 1);
    lcd.print("11 Sec");
  digitalWrite(red, HIGH);
    delay(1000);
     lcd.setCursor(0, 1);
    lcd.print("10 Sec");
  digitalWrite(red, HIGH);
    delay(1000);
     lcd.setCursor(0, 1);
    lcd.print("09 Sec");
  digitalWrite(red, HIGH);
    delay(1000);
    

lcd.setCursor(0, 1);
    lcd.print("08 Second");
  digitalWrite(red, HIGH);
    delay(1000);
lcd.setCursor(0, 1);
    lcd.print("07 Second");
  digitalWrite(red, HIGH);
    delay(1000);
lcd.setCursor(0, 1);
    lcd.print("06 Second");
  digitalWrite(red, HIGH);
    delay(1000);

lcd.setCursor(0, 1);
    lcd.print("05 Second");
  digitalWrite(red, HIGH);
    delay(1000);
lcd.setCursor(0, 1);
    lcd.print("04 Second");
  digitalWrite(red, HIGH);
    delay(1000);
lcd.setCursor(0, 1);
    lcd.print("03 Second");
  digitalWrite(red, HIGH);
    delay(1000);
    lcd.setCursor(0, 1);
    lcd.print("02 Second");
  digitalWrite(red, HIGH);
    delay(1000);
lcd.setCursor(0, 1);
    lcd.print("01 Second");
  digitalWrite(red, HIGH);
    delay(1000);
lcd.clear();
digitalWrite(red, LOW);




lcd.setCursor(0, 0);
lcd.print("On Yellow Light");
    lcd.setCursor(0, 1);
    lcd.print("05 Second");
  digitalWrite(yellow, HIGH);
delay(1000);
  digitalWrite(yellow, LOW);
delay(500);
lcd.setCursor(0, 1);
    lcd.print("04 Second");
  
  digitalWrite(yellow, HIGH);
delay(1000);
  digitalWrite(yellow, LOW);
delay(500);
lcd.setCursor(0, 1);
    lcd.print("03 Second");
  
  digitalWrite(yellow, HIGH);
delay(1000);
  digitalWrite(yellow, LOW);
delay(500);
  lcd.setCursor(0, 1);
    lcd.print("02 Second");
  
  digitalWrite(yellow, HIGH);
delay(1000);
  digitalWrite(yellow, LOW);
delay(500);
  lcd.setCursor(0, 1);
    lcd.print("01 Second");
  
  digitalWrite(yellow, HIGH);
delay(1000);
  digitalWrite(yellow, LOW);
delay(500);
  lcd.setCursor(0, 1);
    lcd.print("01 Second");
  
lcd.setCursor(0, 0);
    lcd.print("GoGo Green Light");
lcd.setCursor(0, 1);
    lcd.print("20 Second");
  digitalWrite(green, HIGH);
    delay(1000);

lcd.setCursor(0, 1);
    lcd.print("19 Second");
  digitalWrite(green, HIGH);
    delay(1000);

lcd.setCursor(0, 1);
    lcd.print("18 Second");
  digitalWrite(green, HIGH);
    delay(1000);

lcd.setCursor(0, 1);
    lcd.print("17 Second");
  digitalWrite(green, HIGH);
    delay(1000);

lcd.setCursor(0, 1);
    lcd.print("16 Second");
  digitalWrite(green, HIGH);
    delay(1000);
 
   lcd.setCursor(0, 1);
    lcd.print("15 Second");
  digitalWrite(green, HIGH);
    delay(1000);
 
lcd.setCursor(0, 1);
    lcd.print("14 Second");
  digitalWrite(green, HIGH);
    delay(1000); 
  lcd.setCursor(0, 1);
    lcd.print("13 Second");
  digitalWrite(green, HIGH);
    delay(1000);
lcd.setCursor(0, 1);
    lcd.print("12 Second");
  digitalWrite(green, HIGH);
    delay(1000);
    lcd.setCursor(0, 1);
    lcd.print("11 Sec");
  digitalWrite(green, HIGH);
    delay(1000);
     lcd.setCursor(0, 1);
    lcd.print("10 Sec");
  digitalWrite(green, HIGH);
    delay(1000);
     lcd.setCursor(0, 1);
    lcd.print("09 Sec");
  digitalWrite(green, HIGH);
    delay(1000);
    

lcd.setCursor(0, 1);
    lcd.print("08 Second");
  digitalWrite(green, HIGH);
    delay(1000);
lcd.setCursor(0, 1);
    lcd.print("07 Second");
  digitalWrite(green, HIGH);
    delay(1000);
lcd.setCursor(0, 1);
    lcd.print("06 Second");
  digitalWrite(green, HIGH);
    delay(1000);

lcd.setCursor(0, 1);
    lcd.print("05 Second");
  digitalWrite(green, HIGH);
    delay(1000);
lcd.setCursor(0, 1);
    lcd.print("04 Second");
  digitalWrite(green, HIGH);
    delay(1000);
lcd.setCursor(0, 1);
    lcd.print("03 Second");
  digitalWrite(green, HIGH);
    delay(1000);
    lcd.setCursor(0, 1);
    lcd.print("02 Second");
  digitalWrite(green, HIGH);
    delay(1000);
lcd.setCursor(0, 1);
    lcd.print("01 Second");
  digitalWrite(green, HIGH);
    delay(1000);
lcd.clear();
digitalWrite(green, LOW);


  lcd.setCursor(0, 0);
lcd.print("Of Yellow Light");
    lcd.setCursor(0, 1);
    lcd.print("05 Second");
  digitalWrite(yellow, HIGH);
delay(1000);
  digitalWrite(yellow, LOW);
delay(500);
lcd.setCursor(0, 1);
    lcd.print("04 Second");
  
  digitalWrite(yellow, HIGH);
delay(1000);
  digitalWrite(yellow, LOW);
delay(500);
lcd.setCursor(0, 1);
    lcd.print("03 Second");
  
  digitalWrite(yellow, HIGH);
delay(1000);
  digitalWrite(yellow, LOW);
delay(500);
  lcd.setCursor(0, 1);
    lcd.print("02 Second");
  
  digitalWrite(yellow, HIGH);
delay(1000);
  digitalWrite(yellow, LOW);
delay(500);
  lcd.setCursor(0, 1);
    lcd.print("01 Second");
  
  digitalWrite(yellow, HIGH);
delay(1000);
  digitalWrite(yellow, LOW);
delay(500);
  
}

Credits

DIY Inventor
0 projects • 19 followers
Hello Guys, My name is Krishna Agarwal , and I'm passionate about Making DIY Projects. Here I make Arduino and Robotics related projects.
Contact

Comments

Please log in or sign up to comment.