I/O Wiring and Signals

Sinking and sourcing, relay and transistor outputs, analog signals, noise, grounding and surge protection.

Discrete inputs

A discrete input reads whether a 24 V DC (or 120/230 V AC) signal is on or off. IEC 61131-2 defines input types by their on and off thresholds; for a 24 V DC type 1 input, a signal above about 15 V is on and below about 5 V is off, with an undefined region between them.

DeviceWiringNotes
Push button, switch, limit switchTwo wires: +24 V through the contact to the inputMechanical: debounce with the input filter (typically 1–10 ms)
Three-wire proximity or photo sensor+24 V, 0 V and a signal output (PNP or NPN)Match the type to the input card; see below
Two-wire sensorIn series with the input, leaks a small current when offLeakage (often 0.5–1.5 mA) can hold an input on: use a bleeder resistor if needed
Relay or contactor auxiliary contactA dry contact in the 24 V supply to the inputGood for feedback and status
AC inputs (120 or 230 V)Switch line voltage to the inputSlower (a half-cycle or more); beware induced voltage on long cables
  • Input filter. Most cards have an adjustable on-delay filter (for example 0.5 ms to 20 ms). A longer filter ignores contact bounce and noise, but adds to the response time and blocks short pulses.
  • Normally closed for safety-related devices. Wire stops, overloads, guards and e-stop status normally closed, so that a broken wire looks like a trip.
  • Fast signals (encoders, flow meters above a few hundred hertz) need a high-speed input; see Timers, Counters and Data.
  • Group common. Inputs share a common terminal in groups of 4, 8 or 16. Each group must be powered consistently.

Sinking and sourcing

Three-wire DC sensors come in two types, and the input card must match. A PNP sensor is sourcing: when it switches it connects +24 V to the input, and it needs a sinking input card, whose common is 0 V. An NPN sensor is sinking: it connects the input to 0 V, and it needs a sourcing input card, whose common is +24 V.

PNP sensor (sourcing) + sinking input card+24 V0 VPNP sensorBN +BU −BK outoutput switches+24 V to BKsinking inputINCOMNPN sensor (sinking) + sourcing input card+24 V0 VNPN sensorBN +BU −BK outoutput switches0 V to BKsourcing inputINCOMOrange arrows show where the current flows when the sensor switches on. Match the sensor to the card: PNP to sinking, NPN to sourcing.
A PNP sensor with a sinking input card, and an NPN sensor with a sourcing input card.
Sensor outputSwitchesNeeds input cardCommon use
PNP (sourcing)+24 V to the inputSinking (common to 0 V)Europe, most new installations, Siemens and Allen-Bradley cards usually support both
NPN (sinking)0 V to the inputSourcing (common to +24 V)Asian machines and some North American installations
  • Many cards accept both, depending on how the common is wired (Siemens S7-1200 DI cards, Allen-Bradley 1769 modules, IDEC and Mitsubishi inputs are “sink/source” selectable by the common). Check the datasheet.
  • Sensors that will not trigger are usually a type mismatch, a missing 0 V, or a missing common. Check with a meter: PNP output reads +24 V when on; NPN output reads near 0 V when on.
  • For more on sensors see Sensors and Sensor Wiring and Installation.

Discrete outputs

Relay outputsupplyloadrelay contactAC or DC, about 2 A per pointSlow (10 ms); wears outIsolated; suppressor on coilsTransistor output+24 Vcoiltransistor0 V24 V DC, about 0.5 A per pointFast, silent, no wearFlyback diode across coilsTriac outputAC lineloadtriacAC loads, about 0.5 to 2 AFast, silent; small leakage when offSnubber for coils; AC only
Relay, transistor and triac outputs, with the flyback diode on a DC coil.
Output typeSwitchesSpeed and lifeTypical ratingUse for
RelayAny voltage, AC or DC10 ms; 105–107 operations2 A per point, 8 A per commonMixed voltages, isolation, occasional switching
Transistor (sourcing or sinking)24 V DC onlyMicroseconds; no wear0.5 A per point, 4 A per commonSolenoids, interposing relays, lamps, PWM
TriacAC onlyFast; leakage when off0.5–2 AAC solenoids, small AC loads
  • Do not switch motors or contactor coils with large currents directly. Use an interposing relay or a contactor with a coil current within the rating, and a surge suppressor.
  • Respect the per-point and per-common current limits. Many failures are caused by driving a load that exceeds the point’s rating, or by inrush (an incandescent lamp can draw ten times its running current when cold).
  • Relay outputs wear out. Do not use them for fast or frequent switching (PWM, a flasher): use a transistor output and a solid-state relay.
  • Transistor outputs leak a little current when off, which can keep a sensitive load (a small relay or LED) glowing; add a bleeder resistor.
  • Fail-safe state. Decide what each output should do when the PLC stops or loses communications, and set it in the configuration.

Analog inputs and outputs

24 V DCsupply2-wire transmitterdraws 4 to 20 mAanalog input card250 Ω(shunt)ADCcounts+−IOne loop, one current: 4 mA × 250 Ω = 1 V (0 %) and 20 mA × 250 Ω = 5 V (100 %). A broken wire gives 0 mA, below the 4 mA live zero.Shield the cable and ground it at one end. A 0–10 V card has no shunt and reads the voltage directly.
A two-wire 4–20 mA loop. The 250 Ω resistor in the input card converts the current to a voltage.
SignalHow it worksStrengthsLimits
4–20 mAThe transmitter regulates the current: 4 mA = 0 %, 20 mA = 100 %Not affected by cable resistance; long runs; live zero detects a broken wire; can power a 2-wire transmitterOne receiver per loop (series); needs a loop supply
0–10 VA voltage proportional to the measurementSimple; common for drive speed references and panel metersVoltage drops and noise on long cables; no live zero (0 V looks the same as a broken wire)
1–5 V, ±10 V, ±5 VVariants of voltage signalsBipolar signals for position or loadCheck the card’s range
Thermocouple, RTDMillivolts or resistanceDirect temperature sensingNeed special modules or transmitters
  • 2-wire transmitters are powered from the loop: they take 4–20 mA from the supply and the current is the signal. 3-wire and 4-wire (active) transmitters have a separate power supply and give a 4–20 mA or voltage output; check whether the card supplies power (passive) or expects an active signal.
  • Live zero. A current below about 3.6 mA indicates a wire break and above 21 mA an overrange fault (NAMUR NE 43). Detect it in the program.
  • Resolution is set by the converter: a 12-bit card has 4 096 steps, a 16-bit card 65 536. Real accuracy is also limited by noise and the sensor.
  • Raw counts are card-specific (0–27 648 on Siemens, 0–32 767 or 0–65 535 on others); see the scaling on Timers, Counters and Data.
  • Analog outputs drive valves and drives: a 4–20 mA output into a valve positioner needs the loop’s compliance voltage (the maximum load) respected.

Worked example: how long can the 4–20 mA cable be?

  • The loop supply is 24 V and the transmitter needs at least 10 V across it to work. The most the rest of the loop may drop at 20 mA is 24 − 10 = 14 V.
  • Maximum loop resistance: 14 V ÷ 20 mA = 700 Ω.
  • The input card’s shunt takes 250 Ω, leaving 450 Ω for the cable.
  • A 500 m run of 0.75 mm² copper (two wires, so 1 000 m) has a resistance of 0.0172 × 1 000 ÷ 0.75 = 22.9 Ω: far below the limit. Cable length is almost never the problem; noise and grounding are.
  • Voltage at the transmitter at 20 mA: 24 − 20 mA × (250 + 22.9) = 18.5 V, above the 10 V minimum.

Temperature inputs: thermocouples and RTDs

SensorPrincipleOutputNotes
Thermocouple (types K, J, T, N)Two dissimilar metals generate a small voltageMillivolts (type K ≈ 41 µV/°C)Wide range (to over 1 000 °C), fast, rugged; needs cold-junction compensation and thermocouple-grade wire; low signal, so noise-prone
RTD (Pt100, Pt1000)Platinum resistance rises with temperatureOhms (Pt100: 100 Ω at 0 °C, 138.5 Ω at 100 °C)More accurate and stable (±0.1 °C), to about 600 °C; lead resistance matters in 2-wire connections
Thermistor (NTC)Resistance falls as temperature risesOhms, very non-linearCheap and sensitive over a narrow range
Temperature transmitterA converter in the head or on a DIN rail4–20 mAOften the easiest: linearized and scaled, no special PLC module needed

Worked example: Pt100 and type K values

  • Pt100 resistance: 0 °C → 100.00 Ω; 100 °C → 138.51 Ω; 200 °C → 175.86 Ω. About 0.385 Ω per °C.
  • Two-wire error: two 0.5 Ω leads add 1.0 Ω, which a Pt100 reads as about 1.0 ÷ 0.385 = 2.6 °C too high. Three-wire and four-wire connections cancel the lead resistance, so use them.
  • Type K at 100 °C with the reference junction at 0 °C generates 4.096 mV: a few millivolts, so the cable must be shielded, short and separated from drives, and the module must compensate for the cold junction.
  • Use thermocouple extension wire all the way to the module: copper joins create extra junctions and errors.

The 24 V supply

The 24 V DC supply powers the PLC, the sensors, the I/O, interposing relays and the HMI. An undersized or poor supply causes random faults, so size it and protect it.

LoadCurrent
PLC CPU and modules0.600 A
24 input points, card side (4 mA each)0.096 A
Sensors (24 × 15 mA)0.360 A
Solenoid valves (8 × 2.5 W)0.833 A
Interposing relays (8 × 40 mA)0.320 A
HMI panel0.500 A
Transmitters, 2 × 20 mA0.040 A
Total2.75 A
With 25 % margin3.44 A: choose a 5 A supply
  • Use a regulated switching supply sized with 25–30 % margin; keep supplies for noisy loads (solenoids, contactors) separate from the PLC and analog supply where practical.
  • Fuse each branch (sensors, outputs, valves) so that one short does not take down the controller. Use a DC fuse or a breaker rated for DC.
  • Power the PLC and the transmitters from the same supply or share a reference, to avoid a ground offset on analog signals.
  • Brown-outs. A momentary dip below about 18 V can reset the CPU or the I/O. A supply with hold-up time, or a UPS module, rides through short interruptions.
  • Check the supply voltage at the farthest device under load; a long, thin cable drops volts.

Noise, shielding and grounding

  • Separate power from signals. Run motor, drive and mains cables apart from analog and low-level signals, crossing at right angles where they must cross. 20–30 cm separation is a rule of thumb in ducts.
  • Use shielded twisted pair for analog signals, thermocouples, encoders and communication. Ground the shield at one end (usually the panel) for analog signals to avoid ground-loop currents, and at both ends for high-frequency noise if the cable is routed through a noisy area (the rules differ for drives: follow the manufacturer).
  • Ground properly. Connect the PLC, the supplies and the panel to a single protective earth point with short, thick connections. A star arrangement is better than a chain.
  • Variable frequency drives are the biggest noise source. Use shielded motor cable, grounded at both ends with a 360° clamp, keep it away from signal cables, and fit line or output reactors if advised.
  • Ferrite and RC filters on noisy inputs; the input filter setting on the card; and a longer filter time on slow signals.
  • Ground loops appear as an offset or a hum on an analog signal that changes with load. Isolators (galvanic isolation) break the loop.

Suppression for coils and inductive loads

LoadSuppressorNotes
DC relay coil, solenoid valve, DC contactorFlyback diode across the coil (cathode to +)Slows the release a little; use a diode with a Zener for faster release
AC relay coil, AC contactor, AC solenoidRC snubber or MOV across the coilA 100 Ω + 0.1 µF snubber is a common starting point; choose a MOV rated above the supply peak
Motors, brakesSnubber or varistor at the loadFollow the manufacturer
LampsInrush limiting or LED lampsA cold filament draws about 10 times its running current

Without suppression, switching a coil creates a voltage spike of hundreds of volts that wears relay contacts, damages transistor outputs, and injects noise into the I/O. See Inductors, Transformers and Relays for why.

Panel layout, labeling and colors

  • Plan the layout with the power devices (breakers, contactors, drives) and noisy parts on one side, and the PLC, I/O and signal terminals on the other, with ducts between.
  • Wire colors (NFPA 79 practice in the US): black for line and load power circuits, red for AC control, blue for DC control, yellow for external power from outside the panel, green or green/yellow for ground. IEC colors differ (blue for neutral, brown/black/gray for phases); follow your local standard.
  • Label every wire and terminal at both ends with the same number as on the drawing; use ferrules on stranded wire.
  • Leave room. 20–25 % spare space and spare I/O for later changes, and room for heat to dissipate.
  • Keep the drawings current. The wiring diagram and the I/O list (tag, address, device, terminal) are as important as the program.
  • Protect from the environment: dust, moisture, vibration and temperature rating (IP and NEMA enclosure ratings).

Wiring checklist

CheckWhy
Sensor type (PNP/NPN) matches the cardOtherwise the input never turns on
Stops and overloads are wired normally closedA broken wire must stop the machine
Output current within the point and the common ratingPrevents overload and burned outputs
Coils have flyback diodes or snubbersProtects outputs and avoids noise
Analog cable is shielded, grounded at one end, away from drivesClean signal
24 V supply sized with margin; branches fusedPrevents random resets and protects wiring
Grounding is to one point; shields connected correctlyAvoids ground loops
Every wire and terminal is labeled and matches the drawingFast fault-finding
Safety circuits are hardwired and independent of the PLCSee PLC Troubleshooting, Safety and Documentation

Related

FAQ

Why does my input stay on when the sensor is off?

A two-wire sensor leaks a small current that is enough to hold some inputs on. Add a bleeder resistor across the input, or use a three-wire sensor. Induced voltage on long AC wires can do the same.

What is the difference between sinking and sourcing?

It describes which way the current flows at the terminal. A sourcing device provides +24 V to the load; a sinking device connects the load to 0 V. A sensor and its input card must be opposite types: PNP with a sinking input, NPN with a sourcing input.

Can I connect a 4–20 mA transmitter directly to a 0–10 V input?

Not directly. Put a 500 Ω precision resistor across the input to convert 4–20 mA to 2–10 V, or use a signal converter. A current input has its own shunt.

Do I ground the shield at both ends?

For low-level analog signals ground it at one end (the panel) to avoid ground-loop currents. For high-frequency noise or shielded motor cables, both ends are usual. Follow the instrument and drive makers’ instructions.

Why does my relay output feel “sticky” or the contacts weld?

The load’s inrush or the inductive spike exceeded the contact rating. Add suppression, use a bigger contactor through an interposing relay, and check the load current against the point rating.

References

  • IEC 61131-2, Programmable controllers, Part 2: Equipment requirements and tests (input and output electrical characteristics).
  • NAMUR NE 43, Standardization of the signal level for the failure information of digital transmitters.
  • IEC 60751 (industrial platinum resistance thermometers); IEC 60584 (thermocouples).
  • NFPA 79, Electrical Standard for Industrial Machinery; IEC 60204-1 (safety of machinery: electrical equipment).
  • Manufacturer I/O module manuals: Siemens S7-1200 digital and analog modules, Allen-Bradley 1769 and 1756 I/O, Mitsubishi, Omron and IDEC I/O manuals.

Last reviewed: October 2026. Instruction names, addresses and data sizes differ by manufacturer: confirm against your controller’s manual, and keep safety functions independent of standard PLC logic. Do not work on live mains equipment unless you are qualified.