PLC Sim Lab
PLC basics

PLC wiring basics

Most PLC wiring problems come down to the same few mistakes: no 0 V reference on the input common, the wrong output type for the load, or a missing fuse. This guide walks through the power, input and output circuits of a typical 24 V DC PLC.

3 min read · Updated 2026-10-02

1. Power supply

A DIN-rail power supply turns the mains (230 V or 415 V AC) into 24 V DC. Its terminals are usually labelled +V / -V or L+ / M. The PLC CPU gets its own supply terminals (L+ and M on Siemens, 24V and 0V on others). Protect each 24 V branch (PLC, inputs, outputs) with its own fuse or miniature breaker so one short does not stop the whole machine.

2. Inputs and the input COM

A PLC input is an opto-coupler: it turns on when current flows through it. Current needs a loop, so the input group has a common (COM, 1M, S/S) terminal that closes the circuit.

The most common beginner fault: the button is wired to +24 V but the input COM is not connected at all, so the input LED never lights.

3. Wiring push buttons and sensors

A push button is a plain contact: +24 V to one side, the PLC input to the other (with COM to 0 V). A 3-wire sensor needs power too: brown to +24 V, blue to 0 V, black (the output) to the PLC input. See inductive sensors and photoelectric sensors.

Stop buttons and E-stops are wired normally closed, so a broken wire stops the machine instead of preventing a stop. See E-stop circuits.

4. Output types

Output typeHow it switchesGood for
RelayA dry contact; AC or DC, up to about 2 AMixed voltages, contactor coils, slow switching
Transistor, sourcing (PNP)Switches +24 V to the load; load's other side to 0 VSolenoid valves, lamps, fast switching (Europe/Asia)
Transistor, sinking (NPN)Switches the load to 0 V; load's other side to +24 VSame loads, common in Japanese PLCs
TriacSwitches AC loads without contactsSmall AC loads

A PLC output cannot drive a large motor directly. It drives the coil of a contactor (magnetic switch), and the contactor switches the motor's 415 V power.

5. Inductive loads and flyback diodes

Coils (relays, contactors, solenoid valves) produce a voltage spike when switched off. On DC coils fit a flyback diode across the coil (cathode to +); on AC coils fit an RC snubber or varistor. This protects transistor outputs and reduces noise.

6. Wire colours

Plants follow local standards (IEC 60204-1, NFPA 79), but a common scheme is: black for power, dark blue for DC control, red for AC control, green/yellow for protective earth, and orange for circuits that stay live from an external source when the main switch is off. Sensor cables follow IEC 60947-5-2: brown +, blue −, black output.

Checklist before power-on

  1. Power supply output reads 24 V; L+ and M of the PLC connected.
  2. Every input group COM connected (to 0 V for PNP, +24 V for NPN).
  3. Every load returns to the correct side (0 V for sourcing outputs, +24 V for sinking).
  4. Fuses fitted; earth connected; no bare strands in terminals.

Practise all of this safely in the PLC Sim Lab Playground: a wrong connection trips the simulated supply instead of damaging hardware.

Watch it in the video tutorial

Starts at 2:52: wiring the PLC power supply, the inputs and the outputs. Open on YouTube →

Try it yourself. Wire sensors, contactors and a PLC, write ladder logic and press RUN in the free PLC Sim Lab Playground. Nothing to install.

Open the Playground →Guided lessons →