AN Automation Nodes, Reliability and Excellence Get a quote
Automation · 5 min read

Traffic light PLC with 3 timers: the complete ladder program (S7-1200, LAD)

A complete traffic-light program in seven ladder networks: start/stop seal-in, three TON timers (4 s, 3 s, 2 s), three lamp networks, the tag table and how the cycle repeats.

AutomationBy the Automation Nodes engineering team · 24 Nov 202605PLC Programming · part 2 of 5
3D render: traffic light showing green, wired to a PLC with CPU and I/O modules3D VIEW
Seven-network ladder program for a traffic light with three TON timers, tag table and timing chartHOW IT WORKS · LIVE
A PLC-controlled traffic light (top) and the seven-network ladder program with its timing (bottom).

Three timers = one traffic light. This is the classic first PLC timer project, written here in ladder (LAD) for a Siemens S7-1200.

Tag table

TagAddressMeaning
START%I0.0Start push-button (NO)
STOP_OK%I0.1Stop push-button, wired NC (1 = healthy)
RED · YELLOW · GREEN%Q0.0 · %Q0.1 · %Q0.2Lamps
RUN%M0.0Sequence running
T_RED · T_GREEN · T_YEL%DB1 · %DB2 · %DB3TON timers: 4 s, 3 s, 2 s

The seven networks

NetworkLogic
1 · Start / Stop (seal-in)(START OR RUN) AND STOP_OK → RUN
2 · Red time (TON 4 s)RUN AND NOT T_YEL.Q → T_RED, PT T#4s
3 · RED lampRUN AND NOT T_RED.Q → RED %Q0.0
4 · Green time (TON 3 s)T_RED.Q → T_GREEN, PT T#3s
5 · GREEN lampT_RED.Q AND NOT T_GREEN.Q → GREEN %Q0.2
6 · Yellow time (TON 2 s)T_GREEN.Q → T_YEL, PT T#2s
7 · YELLOW lampT_GREEN.Q AND NOT T_YEL.Q → YELLOW %Q0.1

How it runs

  1. START (%I0.0) pressed → RUN (%M0.0) latched through its seal-in contact.
  2. T_RED (TON 4 s) runs → RED %Q0.0 = 1.
  3. T_RED done → T_GREEN (3 s) starts → GREEN %Q0.2 = 1 (RED goes off because T_RED.Q is now 1).
  4. T_GREEN done → T_YEL (2 s) starts → YELLOW %Q0.1 = 1.
  5. T_YEL done → T_RED restarts: the cycle repeats. T_YEL.Q opens network 2, T_RED resets, which resets T_GREEN and T_YEL, and on the next scan T_RED times again from zero.
  6. STOP pressed → STOP_OK = 0 → its NO contact opens → RUN reset → all outputs OFF and all timers reset.

Result: RED 4 s → GREEN 3 s → YELLOW 2 s, a 9-second cycle.

Why STOP_OK uses a NO contact. The stop button is wired NC, so the input is 1 when healthy – see why every STOP button is normally closed.

Common mistakes

  • Driving a lamp straight from a timer Q bit without “AND NOT next timer” – two lamps light together.
  • Using the same timer DB twice in the program.
  • Expecting a TON to remember its time when the input drops – it resets; use a TONR if you need that.

A real road junction needs conflict monitoring, lamp-failure detection and certified controllers – this example teaches the timer logic.

Members edition · free

Members Edition reference card

A two-page A4 edition prepared in your name: a gold-framed cover with our verification seal, plus a reference sheet with the key points, the field checklist or key data, the standards and a QR code back to the full article.

Free account · takes 30 seconds · no password

Download PDF

Need help on site? Automation Nodes designs, builds, tests and commissions LT panels, automation and electrical installations across India.