Arduino Traffic Light Controller
Budget: $250 – $750 USD
I need a clean, well-commented Arduino sketch that drives a small traffic-light prototype using LEDs, push-buttons, and a couple of sensors (e.g., ultrasonic or IR) to regulate flow rather than just cycle through a fixed sequence. The idea is to simulate a real intersection where vehicle presence triggers state changes while manual override buttons allow testing of special conditions.
Here’s what I expect:
• The code must compile on the current Arduino IDE without extra libraries beyond the standard ones.
• Normal operation: red, yellow, and green LEDs follow proper timing, but a vehicle-detection sensor shortens or extends green time to keep traffic moving smoothly.
• A pedestrian button interrupts the flow safely, inserting a walk phase before resuming.
• Non-blocking programming style (no long delay() calls) so multiple inputs are polled seamlessly.
• Clear comments explaining each function and how to tweak timings, pin assignments, or sensor thresholds.
Once the sketch is ready, include a brief README that maps pins, lists the exact components you assumed, and outlines a quick hardware setup so I can replicate the test on a breadboard in minutes.
Here’s what I expect:
• The code must compile on the current Arduino IDE without extra libraries beyond the standard ones.
• Normal operation: red, yellow, and green LEDs follow proper timing, but a vehicle-detection sensor shortens or extends green time to keep traffic moving smoothly.
• A pedestrian button interrupts the flow safely, inserting a walk phase before resuming.
• Non-blocking programming style (no long delay() calls) so multiple inputs are polled seamlessly.
• Clear comments explaining each function and how to tweak timings, pin assignments, or sensor thresholds.
Once the sketch is ready, include a brief README that maps pins, lists the exact components you assumed, and outlines a quick hardware setup so I can replicate the test on a breadboard in minutes.
Related categories:
C Programming
Electronics
Microcontroller
C++ Programming
Arduino
Circuit Design
Embedded Systems
Prototyping