I made the code in, like, a day. And the electronics in even less time. I was out of ideas, so I went with the simple route and used this idea. It isn't unique, I know.
Am I proud of this?
Yes.
Yes, this is my first project. Yes, that's my excuse for acting stupid.
Yes, the video was filmed in my room, with an open door, while my siblings were playing fortnite.
And then?
I put the Arduino in a box.
And that's how it be. It do be like that, truly. Oh yeah, and the button doesn't work, I just superglued the wires to it to make it look like it does.
Project Perspective
This Mini Traffic Light is a fundamental and innovative road-safety simulation. By focusing on the essential building blocks—three colored LEDs and a push button—you'll learn how to monitor traffic flow using specialized software logic and a robust hardware setup.
Technical Implementation: Timing and Logic
The project reveals the hidden layers of simple light-to-digital interaction:
- Identification layer: Three 5mm LEDs (Red, Yellow, Green) act as the colorful eyes of the traffic light, arranged in a vertical stack.
- Conversion layer: The Arduino uses its digital output pins (e.g., 11, 12, 13) to cycle through the standard traffic sequence: Green (GO), Yellow (CAUTION), and Red (STOP).
- Processing Logic layer: A Push Button acts as a digital input for a "Pedestrian Crossing" request.
- Timing Logic layer: The Arduino code follows a specialized "sequential decoding" strategy: it requests and performs a "Standard Cycle" or "Pedestrian Priority" sequence based on each button press check.
- Execution layer: Using the
delay()anddigitalWrite()functions, the Arduino acts as a high-performance controller for each point of its "Light Status" check.
Hardware Infrastructure
- Arduino Uno: The "brain" of the project, managing the high-speed timing loops and coordinating the output signals.
- 5mm Colored LEDs: Providing clear and playful visual feedback each time the light status changes.
- Push Button: Providing the digital input for each "Crossing" request.
- Resistors (220 ohm): Essential for limiting current through the LEDs and protecting the digital pins.
- Breadboard: A convenient way to prototype the traffic light circuit and connect all components without permanent soldering.
- Micro-USB Cable: Used to program the Arduino and provide power for the simulation.
Simulation and Interaction Step-by-Step
The traffic light process is designed to be very efficient:
- Initialize Hardware: Correctly seat the Red, Yellow, and Green LEDs and the push button on your breadboard.
- Setup High-Power Sync: In the
setup()function, define the LED pins asOUTPUTand the button pin asINPUT_PULLUP. - Execution Loop: The Arduino constantly performs several high-performance loops and updates the light sequence in real-time.
- Visual Feedback Integration: Watch the custom LEDs automatically become a rhythmic visual signal, pulsing and following the traffic settings on the breadboard.
Future Expansion
- OLED Identity Dashboard Integration: Add a small OLED display to the traffic post to show a "Countdown Timer" and "Pedestrian Status."
- Multi-sensor Climate Sync Synchronization: Connect a Sound Sensor (Microphone) to have the lights "Rush" to Red if it detects an "Emergency Siren" or "Claps."
- Cloud Interface Registration Support Synchronization: Add a specialized cloud dashboard to precisely control and track traffic history from a smartphone over WiFi.
- Advanced Velocity Profile Customization Support: Add a small slider or potentiometer to manually adjust the "Green Time" or "Yellow Duration" (seconds) for each light cycle.
Mini Traffic Light is a perfect project for any science enthusiast looking for a more interactive and engaging road-tracking tool!