Traffic Light Simulation System🚦🚗🚶🏻‍♂️

by jacqueline wang in Circuits > Arduino

269 Views, 0 Favorites, 0 Comments

Traffic Light Simulation System🚦🚗🚶🏻‍♂️

3.jpeg

About this project:

This project is making a traffic light simulation system with an LED blinking technique. This project's main goal is to teach young children how to recognize when they can pass the street by looking at the traffic light.

There are two sets of traffic lights on the breadboard, the left side is the traffic light of cars, the right side is the pedestrian traffic lights. When the light of cars turns red, the light of pedestrians will turn green. When the light of cars turns green, the light of pedestrians will turn red.

Idea From: https://www.instructables.com/Multiple-Blinking-LE...

The original design from the link above is a simple LED multiple blinking system. However, I add some changes and made it into a traffic light simulation system that can teach young children how to pass the street by looking at the traffic light.

Changes:

Add 2 more LED lights

Change the color to red, yellow, green

Change the time LED lights blinks

Add additional coding for the other two LED lights

Parts & Materials Needed 🧩

unnamed.jpeg

- Five LEDs (green x2 yellow x1 red x2)

- Jumper wires x11

- Breadboard x1

- Arduino x1

Program the Arduino (coding)

螢幕快照 2021-04-09 下午8.04.30.png
螢幕快照 2021-04-09 下午8.04.51.png

Code link: https://create.arduino.cc/editor/jacqueline_wang/...

Paste the following code into the Arduino software and upload it to the Arduino

int led = 13;
int led2 = 12;

int led3 = 11;

int led4 = 10;

int led5 = 9;

// the setup routine runs once when you press reset:

void setup() {

// initialize the digital pin as an output.

pinMode(led, OUTPUT);

pinMode(led2, OUTPUT);

pinMode(led3, OUTPUT);

pinMode(led4, OUTPUT);

pinMode(led5, OUTPUT);

}

// the loop routine runs over and over again forever:

void loop() {

digitalWrite(led, HIGH);// turn the LED on (HIGH is the voltage level)

digitalWrite(led5, HIGH);

delay(10000); // wait for 10 seconds

digitalWrite(led, LOW); // turn the LED off by making the voltage LOW

digitalWrite(led5, LOW);

delay(100);

{digitalWrite(led2, HIGH);

delay(10000);

digitalWrite(led2, LOW);

delay(100);}

{digitalWrite(led3, HIGH);

digitalWrite(led4, HIGH);

delay(10000);

digitalWrite(led3, LOW);

digitalWrite(led4, LOW);

delay(100);}// wait for a second

}

Connecting GND

unnamed.jpeg

First, connect a jumper wire from GND to the negative rail on the breadboard.

Connecting the LEDs

i.jpeg
q.jpeg

Then plug in the other jumper wires like this:

1. plug a wire from 13 on the Arduino to the left side of the RED LED

2. plug a wire from the negative rail to the right side of the RED LED

3. plug a wire from 12 on the Arduino to the left side of the YELLOW LED

4. plug a wire from the negative rail to the right side of the YELLOW LED

5. plug a wire from 11 on the Arduino to the left side of the GREEN LED

6. plug a wire from the negative rail to the right side of the GREEN LED

7. plug a wire from 10 on the Arduino to the left side of the RED LED (pedestrian light)

8. plug a wire from the negative rail to the right side of the RED LED (pedestrian light)

9. plug a wire from 9 on the Arduino to the left side of the GREEN LED (pedestrian light)

10. plug a wire from the negative rail to the right side of the GREEN LED (pedestrian light)

Make Any Needed Decorations

1.jpeg
3.jpeg

FINISH!!!

Traffic Light Simulation System