Stop Light Ardunio

by knmann914 in Circuits > Arduino

276 Views, 0 Favorites, 0 Comments

Stop Light Ardunio

20220515_181311.jpg

Build your own stoplight with push-buttons that you can turn each light on and off. Follow each step to build your circuit, download the attached code, to your Arduino and enjoy! Click on the link to view the stop-motion video of the construction of the stop light! https://www.wevideo.com/view/2691645994

Supplies

20220515_175125.jpg
20220515_175125.jpg

1 green LED, 1 red LED, 1 yellow LED, 3 push buttons, jumper wires of various sizes (at least 10), breadboard, Arduino UNO, jumper wires to connect to ground and 5v (preferably red and black in color), power cord for Arduino UNO, 6 resistors, Arduino online code editor

Gather Materials

20220515_175141.jpg

Make sure you have the following items and set them out:

  • 1 green LED,
  • 1 red LED,
  • 1 yellow LED,
  • 3 push buttons,
  • jumper wires of various sizes (at least 10),
  • breadboard,
  • Arduino UNO,
  • jumper wires to connect to ground and 5v (preferably red and black in color),
  • power cord for Arduino UNO,
  • 6 resistors,
  • Arduino online code editor

Connect Black Wire

20220515_175334.jpg

Connect one end of the black wire to the negative rail on your breadboard and the other end to GND on your Arduino UNO

Connect Red Wire

20220515_175407.jpg
20220515_175416.jpg

Connect one end of the Red wire to the positive rail on your breadboard and the other end to 5v on your Arduino UNO

Connect the Red LED

20220515_175726.jpg

Connect your red LED to the breadboard using column f, and rows 3 and 4. Make sure your LED's long leg (anode) is on the top and the short leg (cathode) is on the bottom on two different rows!

Add Resistor

20220515_175728.jpg

Use a resistor to connect to row 4 and the negative rail on your breadboard

Add Jumper Wire

20220515_175748.jpg
20220515_175805.jpg
20220515_175815.jpg

Add a jumper wire from row 3 on the breadboard to port 3 on the Arduino.

Connect Yellow LED

20220515_175855.jpg

Connect your yellow LED to the breadboard using column f, and rows 7 and 8. Make sure your LED's long leg (anode) is on the top and the short leg (cathode) is on the bottom on two different rows!

Add Resistor

20220515_175916.jpg
20220515_175935.jpg

Use a resistor to connect to row 8 and the negative rail on your breadboard

Add Jumper Wire

20220515_175941.jpg

Add a jumper wire from row 7 on the breadboard to port 4 on the Arduino.

Connect Green LED

20220515_180016.jpg

Connect your green LED to the breadboard using column f, and rows 11 and 12. Make sure your LED's long leg (anode) is on the top and the short leg (cathode) is on the bottom on two different rows!

Add Resistor

20220515_180039.jpg

Use a resistor to connect to row 12 and the negative rail on your breadboard

Add Jumper Wire

Add a jumper wire from row 11 on the breadboard to port 5 on the Arduino

Add Buttons

20220515_180147.jpg
20220515_180217.jpg
20220515_180225.jpg
20220515_180251.jpg
20220515_180304.jpg
20220515_180336.jpg

Attach the 3 buttons across the middle of the breadboard (see image) leaving 2 rows of space in between each one.

Add Jumper Wires

20220515_180358.jpg
20220515_180434.jpg
20220515_180439.jpg
20220515_180457.jpg
20220515_180508.jpg
20220515_180541.jpg

Attach 1 short jumper wire from the top row where each button is, respectively, to the positive rail on the breadboard. You should do this 3 times, once for each button.

Add Resistors

20220515_180645.jpg
20220515_180701.jpg
20220515_180703.jpg
20220515_180714.jpg
20220515_180715.jpg

Attach one end of a resistor to the bottom row of each button and the other end to the negative rail on the breadboard. You should do this 3 times, once for each button.

Add Jumper Wires

20220515_180807.jpg
20220515_180819.jpg
20220515_180825.jpg
20220515_180828.jpg
20220515_180848.jpg
20220515_180906.jpg

Attach one end of each jumper wire to the same row that you attached the button's resistor. Attach the other end into port 10 for the bottom button, port 11 for the middle button, and port 12 for the top button on the Arduino.

Download Code

Open your Arduino web editor and download this code (attached). You may have to copy and paste the link into a web browser.

Connect Arduino to Computer and Upload Sketch

Connect the USB cord to your computer and the other end into the Arduino to give it power and download the code.

Enjoy Your New Stop Light!

20220515_181308.jpg

Once the code is downloaded, enjoy pushing the buttons and turning on and off each light on your stop light!