PLC · Lesson 2 of 10

Wiring the PLC

Before any program, the PLC must be wired correctly: a 24V DC supply, buttons and sensors on the inputs, and contactors and lamps on the outputs. Half of the PLC faults on site come from wrong wiring, especially PNP and NPN and the common. Here you will wire it yourself on the bench.

1Power: 24V DC

Most industrial PLCs run on 24V DC: a power supply takes 230V AC and gives 24V. The positive terminal is called +24V or L+, and the negative 0V or M. Some CPU models take 230V AC directly (marked AC/DC/RLY, for example), but their inputs are still 24V DC.

Rule: the 0V of the supply is the same 0V as the cards and the sensors (one common reference). If you have more than one power supply, connect their 0V together unless the manual says otherwise.

2Input card: sinking and sourcing

Each input inside the card is a resistor and an LED (optocoupler) between the input terminal (I0.0) and the common (1M). For the input to be 1, current must flow through it, so there must be 24V between the two terminals:

Common on 0V (most common in Europe)
The input turns on when it receives +24V. One side of the button goes to +24V and the other to I0.0. The matching sensor is PNP (it outputs +24V).
Common on +24V
The input turns on when it is pulled to 0V. The button goes between I0.0 and 0V. The matching sensor is NPN (it pulls to 0V). Common on Japanese and Chinese machines.
The names are confusing: some brands call the first case a "sinking input" (the card sinks the current), and some describe a PNP sensor as "sourcing". Don't memorize the name: check where the common goes. That method works on every brand.
Wire colourWhere it goes
BN brown+24V
BU blue0V
BK blackOutput → PLC input (I0.0)

To learn more about the sensors themselves (inductive, photocell, 2-wire), see the digital sensors lesson in the Instrumentation course.

3Output card: relay or transistor?

RelayTransistor
VoltageAC or DC (up to 250V AC)24V DC only
Current per outputAbout 2AAbout 0.5A
SpeedSlow (milliseconds) and audibleVery fast; suitable for pulses (stepper, PWM)
LifeLimited by the number of switching operationsVery long
Common1L takes the voltage that will be switched out3L+ and 3M power the transistors
On site: a contactor with a 230V AC coil? It can go directly on a relay output. On a transistor output you need a 24V DC interface relay to switch the contactor. That also protects the card if the coil burns out.

4The bench: wire it yourself

4 exercises. Tap a terminal (it turns yellow), then tap the other terminal to add a wire. Tap a wire to remove it. When you finish, press "Test wiring"; if it is correct, you can try the sensor, the button and the outputs.

Wiring bench

5Common faults on site

Common faults on site:
  • A new sensor's LED lights but the PLC does not see it: an NPN sensor on a card with its common on 0V (or the opposite). Read the label and find where the common goes.
  • All inputs went off at once: the 24V supply dropped. Usually a short in a sensor wire (brown touching blue or the machine frame).
  • A transistor output burned out: the load current is higher than allowed, the coil wire is shorted, or a DC coil has no diode.
  • An output relay is welded: the contactor does not release even when the PLC turns the output off. Caused by a heavy load or frequent switching. The card or the relay must be replaced.
  • 230V on a 24V card: the most dangerous wiring mistake. Check the voltage with a multimeter before you connect any common.
Safety: isolate the power before you disconnect or connect any terminal. A relay output card can carry 230V even when the PLC itself is off, because its common comes from another source.

?Lesson questions

Answer at least 5 of 6 correctly to mark the lesson done.

Sensor wire colours follow IEC 60947-5-2. Terminal names (1M, 3L+ and 1L) are examples; every model has its own terminal drawing in the manual. The simulator here is a generic trainer with IEC / Siemens style addresses: the exact addresses and instructions differ from one brand to another, and the manual of your PLC is the reference. Your progress is saved on this device only.
© 2026 LearnElectricals. All rights reserved. This site is not affiliated with any of the companies mentioned (such as Siemens, Allen-Bradley, Delta, Schneider and others); names and trademarks belong to their owners and are used only to explain the devices.