Arduino Traffic Light Tutorial

Introduction: Arduino Traffic Light Tutorial

About: Im a student from Iran. I enjoy life by learning , teaching and creating electronic ,robot and etc related

in this tutorial u will be shown how to make a simple traffic light with arduino uno and led's

please do visit our site its new made. fountainoftoughts.net

Step 1: Things You Need

one green LED

one yellow LED

one red LED

three 220 ohm resistors

wires

bread board

Arduino uno

Step 2: Connect Components

connect the components like shown in the picture. connect the cathode pin of LED to one of the resistors and connect the resistor to ground. and connect the anode’s to the arduino ports .

Step 3: Arduino IDE Code

void setup() {

pinMode(13, OUTPUT);

pinMode(12, OUTPUT);

pinMode(11, OUTPUT);

}

void loop() {

digitalWrite(13, HIGH);

delay(3000);

digitalWrite(13, LOW);

digitalWrite(12, HIGH);

delay(1000);

digitalWrite(12, LOW);

digitalWrite(11, HIGH);

delay(3000);

digitalWrite(11, LOW);

}

Be the First to Share

    Recommendations

    • Pocket-Sized Speed Challenge

      Pocket-Sized Speed Challenge
    • Super-Size Speed Challenge

      Super-Size Speed Challenge
    • Audio Challenge 2020

      Audio Challenge 2020

    2 Discussions

    0
    KarloHorcicka
    KarloHorcicka

    3 years ago

    Code is ok but resistors aren't. They need to be connected in series with arduino pins and (+) of the LED not ground

    0
    Swansong
    Swansong

    3 years ago

    This would be fun playing red light green light with :)