PLC · Traffic lights All PLC coursesPLC module ↗ 100%
PLC project · Intermediate · 4 chapters

Traffic lights with a pedestrian crossing

The classic first machine of every PLC course: a traffic light that runs a cycle of timed steps, gives pedestrians green only while the cars stop, waits for the request button, and switches to flashing yellow at night.

You learn the step chain (CASE with a step number and a timer), the way real machines are programmed. You need IF, the latch and timers: chapters 1–8 of PLC from zero teach them.

The goal: the crossing, running on your own step chain.

Chapters

How the course works

1 · The real machine firstHow it works in the real world, and the whole of it running, before you write a line.
2 · One piece per chapterA lesson with a live simulation, a prediction and a worked example, then the lab that builds it.
3 · Checked on the trainerAutomatic tests drive the inputs and check the outputs: any correct program passes.
4 · Then on your ownSwitch the guide off and rebuild it from memory: that is when it sticks.

Structured Text (IEC 61131-3), the language used by industrial engineering environments such as TwinCAT 3 and CODESYS. PLC Studio and the Trainer T8 are VisoTrain’s own training tools. TwinCAT is a registered trademark of Beckhoff Automation GmbH. CODESYS is a registered trademark of CODESYS GmbH. VisoTrain is not affiliated with or endorsed by them.

Syllabus

Level: Intermediate · Time: about 3 hours · You need: IF, latches and timers (chapters 1–8 of PLC from zero).

You learn: step chains with CASE, timers between steps, interlocking by design, remembering a short press, flashing signals, safe mode changes.

  1. Chapter 1: The car lights: a step chain

    • A traffic light in the real world: Say what a traffic light controller does, and what you will build.
    • One step at a time: the step chain: Program a sequence of timed steps with CASE and one timer.
    • Lab in PLC Studio: program this part and pass the automatic tests.
  2. Chapter 2: Lights for the pedestrians

    • Pedestrians: safety by design: Derive the pedestrian lights from the step, so a conflict is impossible.
    • Lab in PLC Studio: program this part and pass the automatic tests.
  3. Chapter 3: The request button

    • The request button: remember a short press: Keep the cars green until someone asks, and remember the request.
    • Lab in PLC Studio: program this part and pass the automatic tests.
  4. Chapter 4: Night mode: flashing yellow

    • Night mode: priorities in a program: Override the cycle with flashing yellow, and come back safely.
    • Lab in PLC Studio: program this part and pass the automatic tests.

Frequently asked questions

How is a traffic light programmed on a PLC?

As a step chain: a step number and a timer. CASE runs the outputs of the current step and moves on when its time is up. The course builds it one piece at a time.

Do I need hardware?

No. The crossing is simulated in the browser, and your program is checked automatically.

Traffic lights with a pedestrian crossing

5 short lessons: the traffic light in the real world, then one lesson for each piece of the program. Each one ends with its lab in PLC Studio.

How this module helps you learn
  • Small steps: one new idea at a time, from everyday examples to code.
  • Pictures and words together: every idea has a diagram or a timing chart.
  • Worked examples: code explained one step at a time. Explain each line to yourself before you reveal it.
  • Try it: simulators where you press the buttons and watch the PLC think, cycle by cycle.
  • Predict first: guess the result before you see it.
  • Code puzzles: put real code lines in the right order before writing your own.
  • Check yourself: short questions with instant feedback, and a quick review of older lessons at the start of each lesson.

🛠 PLC Studio

A real practice environment: an industrial-style engineering tool connected to the Trainer T8. Your Structured Text really runs here, cycle by cycle. Follow a lab with Guided mode, or switch it off and check your own solution at the end. Your work is saved in this browser.