Curious Minds

Clear answers to science and history questions

Traffic Light Control System Using PLC: How It Works

· 7 min read · Science

A traffic light control system using a PLC (Programmable Logic Controller) is an automated intersection controller in which the red, amber, and green lamp sequencing is executed by ladder-logic software running on an industrial PLC, rather than by electromechanical timers, relays, or hard-wired electronics. The PLC reads inputs (pedestrian buttons, vehicle detectors, push buttons, or a simple clock) and switches outputs (lamp contactors) according to a programmed timing sequence, making it easy to change timings, add pedestrian phases, or link multiple intersections without rewiring.

Why PLCs Are Used for Traffic Signal Control

Older signal controllers relied on mechanical cam timers and later on fixed digital logic circuits. Both approaches share a serious drawback: changing the sequence means physically rebuilding the controller. A PLC separates the wiring from the logic. The physical layer consists only of input terminals and output relays driving the lamps; everything about the sequence — green durations, amber clearance times, pedestrian walk intervals, night-time flashing modes — lives in software. PLCs are also built for harsh environments, with wide temperature ratings, immunity to electrical noise, and mean time between failures far exceeding general-purpose computers, which matters for equipment mounted in roadside cabinets that must run continuously for years.

Another practical reason is training value: the traffic light is one of the most common beginner projects in PLC courses because it demonstrates timers, sequencers, and outputs in a way students can visualize immediately.

Basic Components of a PLC Traffic Light System

  • PLC unit — a small controller (for example a compact brick-style PLC or micro-PLC) with sufficient digital outputs for all lamp circuits.
  • Inputs — start/stop selector switch, pedestrian push buttons, and optionally vehicle loop detectors or proximity sensors.
  • Outputs — relay or triac outputs driving the red, amber, and green lamps for each road direction; in real installations, via contactors or solid-state switches sized for LED signal heads.
  • Power supply — the PLC's 24 V DC supply kept separate from the mains circuit feeding the lamps.
  • Lamps or signal heads — full-size LED signal heads in real cabinets, or low-voltage indicator lamps in training rigs.
  • Optional HMI — a small touch panel for adjusting green times or forcing a maintenance mode without reprogramming.

How the Control Logic Works

The core of the program is a time-driven state machine. For a simple two-way intersection (North–South and East–West), the controller steps through four states, and on each transition only one axis has green while the other has red. A typical sequence in a training implementation:

  1. North–South green, East–West red (e.g. 10 seconds).
  2. North–South amber, East–West red (3–4 seconds).
  3. Both red — an all-red clearance interval so the intersection empties before the cross traffic is released.
  4. East–West green, North–South red (10 seconds), then amber and another all-red interval before returning to step 1.

In ladder logic this is usually built with a chain of on-delay timers (TON) where each timer's done bit enables the next, plus latched internal coils representing the current step. Many programmers instead use the PLC's built-in sequencer instructions (SQO in Allen-Bradley terminology, or shift-register based step logic in others), which makes the timing table easy to edit. Pedestrian buttons are handled as an interrupt of sorts: when the button input latches during the opposing green, the program inserts a walk/don't-walk phase at the next safe point rather than cutting off traffic immediately.

Programming Languages and Common Platforms

Ladder diagram (LD) is by far the most common language for this application because it visually resembles the relay circuits it replaced and is easy for electricians to maintain. Function block diagram (FBD) and structured text (ST) — all part of the IEC 61131-3 standard — are also used, particularly when the sequence is written as a state machine. Popular entry-level hardware for learning and small projects includes Siemens LOGO! (technically a logic module programmed in its own function block language), Siemens S7-1200, Allen-Bradley Micro850 / CompactLogix, Mitsubishi FX series, Delta DVP, and Schneider Zelio. Each vendor provides free or low-cost programming software for these lines.

Choosing a PLC for a Traffic Light Project

  • Output count — a two-axis intersection needs six lamp outputs plus pedestrian outputs; add spares for expansion.
  • Output type — relay outputs suit indicator lamps and contactor coils; triac outputs suit frequent switching of AC loads with no moving parts.
  • Timer resolution and count — any modern PLC has ample timers, but confirm the scan time is fast enough for your shortest interval (it nearly always is).
  • Environment rating — for roadside cabinets, check the operating temperature range and surge protection.
  • Software ecosystem — pick a platform with accessible training material if the project is educational.

Common Problems and How They Are Solved

Conflicting greens are the most dangerous fault a signal controller can have. In professional traffic controllers, this is prevented by hardware conflict monitors (malfunction management units) that detect two conflicting green outputs and automatically switch the intersection to flashing red. A hobby PLC project should at minimum include a watchdog and software interlocks so the two opposing green outputs can never be energized simultaneously, even during a programming error.

Other frequent issues:

  • Flickering lamps — caused by outputs being toggled every scan; fix by latching outputs to the step coils rather than driving them from timer contacts directly.
  • Button inputs not registering — pedestrian buttons pressed briefly can be missed if only examined at one point in the scan; latch the input with a set coil and reset it after use.
  • Contact chatter and noise — use the PLC's built-in input filtering and keep signal wiring away from lamp power cables.
  • Power failure behavior — decide whether the sequence restarts from all-red (safest) or resumes its previous step, and use a retentive timer or startup routine accordingly.

PLC Systems Compared With Alternatives

A purpose-built traffic signal controller — a dedicated microprocessor unit designed to transportation standards — remains the norm for public-road intersections because it includes certified conflict monitoring, coordination with adjacent signals, and preemption for emergency vehicles. The PLC sits between such dedicated controllers and hobby solutions like Arduino or 555-timer circuits: far more rugged and maintainable than a microcontroller breadboard, more flexible than relays, but without the certification of a traffic-grade controller. PLCs are a legitimate choice for private sites — factory gates, car parks, mining haul roads, and temporary works signals — where a full controller is unnecessary but reliability still matters.

Safety Considerations

Traffic signals directly affect human safety, so any installation beyond a training bench deserves caution. Lamp wiring at mains voltage must be isolated from the PLC's low-voltage side, use appropriately rated contactors, and comply with local electrical codes. Amber and all-red clearance intervals must be long enough for vehicles to clear the intersection; real-world guidelines are set by national transportation standards, not chosen arbitrarily. For student projects, low-voltage LEDs are strongly preferable to mains lamps. A PLC system should never be used to control a public-road intersection unless it forms part of an approved, certified controller installation.

Frequently Asked Questions

Which PLC is best for a traffic light project?

For learning, almost any compact PLC works — the Siemens LOGO!, Allen-Bradley Micro850, and Mitsubishi FX series are all common choices with accessible free programming software. What matters is having enough outputs for all lamps and a platform your course or workplace already uses.

What programming language is used for PLC traffic light control?

Ladder diagram is the standard choice, using chained on-delay timers or sequencer instructions to step through green, amber, and red phases. Structured text and function block diagram are equally valid alternatives under the IEC 61131-3 standard.

Can a PLC handle pedestrian crossings too?

Yes. Pedestrian push buttons are simply digital inputs; when pressed, the program inserts a walk interval and flashing don't-walk phase at the next safe transition, then returns to the normal vehicle sequence.

How does the timing sequence actually work inside the program?

It is a state machine: each step is an internal memory bit, one step is active at a time, and a timer running during that step triggers the move to the next step. Lamp outputs are driven by combinations of the step bits, so each lamp state lasts exactly as long as its step.

Are real traffic lights controlled by PLCs?

Public-road intersections use dedicated traffic signal controllers that meet transportation-grade safety and conflict-monitoring standards rather than general-purpose PLCs. PLCs are common for private roads, parking facilities, industrial sites, and training systems, and the control principles are closely related.

Why is an all-red interval needed between phases?

The all-red clearance time lets vehicles that entered on amber leave the intersection before the cross street gets green, reducing right-angle collisions. Skipping it is a classic mistake in student programs.

In this article
  1. Why PLCs Are Used for Traffic Signal Control
  2. Basic Components of a PLC Traffic Light System
  3. How the Control Logic Works
  4. Programming Languages and Common Platforms
  5. Choosing a PLC for a Traffic Light Project
  6. Common Problems and How They Are Solved
  7. PLC Systems Compared With Alternatives
  8. Safety Considerations
  9. Frequently Asked Questions