Software Design

Four-Way Traffic Light Controller

State Diagrams · made in Skemio

State diagram showing traffic light phases: NS Green to NS Yellow, NS Yellow to All Red clearance, All Red to EW Green, EW Green to EW Yellow, and EW Yellow back to All Red.
State diagram showing traffic light phases: NS Green to NS Yellow, NS Yellow to All Red clearance, All Red to EW Green, EW Green to EW Yellow, and EW Yellow back to All Red.

What it shows

  • Strict directional phases prevent conflicting simultaneous green lights.
  • Yellow states introduce predictable deceleration clearance intervals.
  • All-Red intervals purge intersection boxes before crossing traffic moves.

The takeaway

Dedicated clearance intervals and interlocks prevent collisions during phase handoffs.

More state diagrams