Stoplight Simulator
This is an Arduino stoplight controller simulation for a crossing intersection where one of the roads has left turn lanes.
The stoplight intersection hardware (lights, pedestrian buttons, etc) is modeled as a 38x35cm working model with miniature cars that can trigger in-pavement sensors.
Alternatively a software-only graphical simulator is available that runs on Processing.
Features:
Technology
The software is Arduino on ATmega328PB using a coroutine task architecture.
Coroutines provide a convenient framework for implementing sequential logic such as stop light timing.
Hardware Model
The actual hardware uses HT16K33's and WS2812 LEDs, plus a bunch of 3D printed parts and some custom PCBs.
The in-pavement sensors are reed switches and there's in-pavement LEDs to indicate when a car is over a sensor.
Several different stop light models are shown in the schematic for various sizes of through hole and SMT LEDs; I ended up using 5050 size WS2811 with 60° lens.
Little "pull back" toy cars were modified to add a 1x10mm magnet in the bottom to trigger the in-pavement sensors.
Processing
The second serial port can be connected to Processing, which runs a graphical stoplight simulator user interface
so you don't need any of the actual hardware (except for the Arduino).
Design Documents
Schematic Diagram | stoplight_O424_schematic.pdf |
PCB Gerbers | stoplight_O424_gerbers.zip |
3D Print Files | stoplight_O424_mechanical.zip |
Artwork | stoplight_O424_artwork.png |
Arduino Code | Arduino.zip |
Processing Code | Processing.zip |
Build Pictures