A simulation of car traffic at a four-lane street intersection equipped with traffic lights is conducted using an 8x8 LED matrix to represent traffic flow, while an RGB LED module displays the traffic lights. All components are integrated with an ESP32 WROVER microcontroller, and cars are randomly generated across the four lanes. The red, yellow, and green lights are set to run for 5 seconds, 2 seconds, and 5 seconds, respectively. Implementation for bare metal and free rtos are provided.
Components and wiring:
- 1x ESP32 WROVER
- 2x 74HC595 IC to convert serial data into parallel data
- 8x Resistor 220Ω
- 1x Freenove 8 RGB LED Module
- 1x Breadboard
- Some jumper wires
Test results: