I’ve always been curious about how a traffic light works.
Now, with just an Arduino, a breadboard, and a few simple LEDs,
I decided to recreate it myself.
It’s a small project, but a big reminder: with curiosity and simple tools, you can bring any idea to life.
I used 4 LED colors to make them just like a traffic light.
(outout)
I used 4 resistors, each with 220 Ω resistance, to limit the current and protect the LEDs from damage.
I used a breadboard to connect the components without soldering, making it easy to test and modify the circuit.
I used an Arduino Uno to control the circuit, allowing me to program and manage the LEDs easily.
piezo buzzer (output)
(push button(input)
4 LEDs
4 resistors , 220 Ω each
MALE-MALE jumper wires to connect components together .
(push button(input)
BREADBOARD
Arduino Uno
Arduino IDE to upload the code to the Arduino board
Buzzer
I connected Arduino GND to the breadboard ground.
Needed it as a reference for the circuit.
I connected the positive leg of the LEDs to Digital Pins 2, 3, 4, 5.
So I can control each LED separately with the code.
Then I connected all my resistors from the negative leg of each LED to the breadboard ground.
This protects the LEDs from too much current.
And I added the buzzer to the circuit. ( pin 6)
And added the push button to control the circuit (pin 8).
Then I uploaded my code and set all my pins as OUTPUT.
Reason: So Arduino knows these pins will send voltage to the LEDs and buzzer , not receive it.
after that I added the else loop so when I press the push button the the LEDs and buzzer turn on if else Turn them all off.
I connected Arduino GND to the breadboard ground.
I connected the positive leg of the LEDs to Digital Pins 2, 3, 4, 5.
And then I added press button on pin 8 to as an INPUT to control the circuit .
I connected the buzzer with pin 6 for the positive leg , for the negative it was connected to the Arduino GND
I connected resistors from the negative leg of each LED to the breadboard ground.
I set all my pins as OUTPUT in the code.
I uploaded the code via Arduino IDE to make the board run it.
Tinker CAD Simulation
I set up the breadboard, Arduino, LEDs, resistors, and wires
I connected Arduino GND to the breadboard ground.
I connected the positive leg of each LED to Digital Pins 2, 3, 4, 5.
I connected the buzzer to the pin 6
I connected resistors from the negative leg of each LED to the breadboard ground.
I connected the Arduino to my computer and uploaded the code via Arduino IDE.
Once everything worked, I took a clear photo of all the connections, showing the wires and components.
Title of Media
When I tried to run the Arduino, the buzzer didn’t make a sound
I realized the buzzer GND was connected in a wrong way
Because of that, no power reached the buzzer
I moved the wire to the correct ground, and everything worked fine.
Learning to control LEDs with Arduino pins → each color/button works independently.
Using resistors → protects LEDs from too much current.
Setting pins as OUTPUT in code → lets me control each LED programmatically.
Adding a press button on pin 8 as a n INPUT to control my circuit.
Uploading code and testing → ensures everything works before building the final box.
Title of Media
Title of Media