Traffic Light Control System

TOP

Nov 2022 - Dec 2022

Overview

This project involved restoring and converting decommissioned traffic lights into fully functional, programmable systems using embedded control. Each unit was rebuilt with updated electrical components and integrated with an Arduino-based controller to replicate real traffic light sequencing. A second build iteration refined wiring layout, control logic, and overall system reliability based on lessons learned from the initial design.

  • Restore and convert decommissioned traffic lights into fully functional, Arduino-controlled systems with standalone power and automated sequencing.

    • Arduino-based control system programmed in C++

    • 120V AC to 5V DC power conversion for embedded control

    • Relay-based switching for safe control of high-voltage lighting circuits

    • Multiple operating modes including standard traffic sequencing and custom illumination settings

    • Adjustable timing for red, yellow, and green light sequences

    • Integrated LCD interface for real-time display and tuning of timing parameters

    • Non-volatile memory storage to retain user-defined timing settings after power loss

    • GPIO interrupt-driven input for responsive mode switching

    • Software debouncing for reliable input capture

    • Hardware timer (Timer1) used for precise light sequencing

    • Iterative improvements to wiring layout, user interface, and control logic between builds

    • LCD timeout functionality to reduce power consumption and extend display lifespan

  • Challenges

    • Integrating low-voltage embedded control with high-voltage lighting required careful relay selection and safe wiring practices

    • Limited internal space made component layout and wire routing difficult, especially within the traffic light enclosure

    • Initial use of a full-size Arduino Uno created packaging constraints and reduced available space for clean wiring

    • Mounting and servicing embedded components (especially smaller boards like the Arduino Nano) required a maintainable and accessible solution

    Improvements:

    • Transitioned from Arduino Uno to Arduino Nano to reduce footprint and improve internal packaging

    • Implemented a socketed Nano mounting solution using header and terminal breakout boards, allowing easy replacement and reprogramming without rewiring

    • Improved internal wiring layout with better routing, labeling, and organization for serviceability and long-term reliability

    • Added LCD interface to eliminate manual timing estimation and provide real-time feedback during configuration

    • Implemented non-volatile memory storage to retain user-defined timing settings after power cycles

    • Refined control logic and code structure for more reliable operation and easier modification

Explore This Project

Software Design

The system was programmed in C++ using the Arduino framework with a state-based control structure to manage traffic light sequencing. Independent timing for each light phase is maintained using a hardware timer (Timer1) for consistent operation.

User inputs are handled through interrupt-driven signals with software debouncing to ensure reliable interaction. An LCD interface provides real-time feedback for adjusting timing parameters, which are stored in non-volatile memory to persist after power cycles. The software includes an LCD timeout feature that disables the display after a period of inactivity, reducing unnecessary power consumption and extending display lifespan.

The software was iteratively refined to improve structure, reliability, and ease of modification.

Electrical Design

The system is powered from a 120V AC wall source and stepped down to 5V DC using a voltage converter to supply the Arduino and control electronics.

High-voltage lighting circuits are controlled using relay modules, allowing low-voltage Arduino outputs to safely switch each traffic light independently. Electrical isolation between control and load circuits was maintained to ensure safe operation.

Internal wiring was designed and organized to support reliable operation within the enclosure, with attention to routing, labeling, and accessibility. A wiring schematic was developed to document system connections and support troubleshooting.

User input is handled through a rotary encoder, which interfaces with the control system for timing adjustments. In the second build iteration, a capacitor was added across the encoder signal to reduce noise and improve signal stability, supplementing software-based debouncing.

Results

The completed system successfully converted non-functional traffic signals into fully operational, programmable displays controlled by an embedded system. Both iterations achieved reliable signal sequencing with consistent state transitions.

The second iteration improved usability and system integration, including a reduced hardware footprint and the addition of an LCD interface for real-time timing configuration. Persistent memory allowed settings to be retained across power cycles, improving overall functionality.

The final result demonstrates a progression from a functional prototype to a more refined and user focused embedded system.

Previous
Previous

Three-Link Suspension Design

Next
Next

Engine Rebuild & Assembly