PortDock

Wiring NPN and PNP sensors to PLC inputs — sink/source, common (COM), 2-wire leakage current

How NPN and PNP sensors connect to PLC inputs, whether COM goes to +24 V or 0 V, 2-wire sensors whose leakage keeps an input on, and the usual wire colours.

Tools for this guideModbus Master Windows program · freeWiring Diagram Maker web · no installVoltage Drop & Wire Size Calculator web · no install

When fitting proximity or photoelectric sensors to PLC inputs, the usual questions are «NPN or PNP?» and «where does COM go?». The answer is to match whether the sensor output «pulls to 0 V (NPN)» or «drives +24 V (PNP)» with the direction the PLC input circuit expects current to flow.

NPN and PNP outputs

NPN output (sinks current)PNP output (sources current)
Output wire when onPulled to 0 VPulled to +24 V
Other side of the load (input)+24 V0 V
PLC input common (COM)To +24 VTo 0 V
Current pathInput → sensor output → 0 V+24 V → sensor output → input → COM (0 V)

So with the input common on +24 V you use NPN sensors, and with it on 0 V you use PNP sensors. Many input modules accept either through the common terminal, but all inputs sharing one common must use the same type. To mix types, use groups with separate commons.

Be careful with «sink» and «source»

«Sink input» and «source input» are used in opposite senses by different manufacturers, depending on whether they describe the input or the sensor. The same word «sink» can mean the NPN-sensor input in one manual and the PNP-sensor input in another. Go by the wiring diagram instead — where COM connects (+24 V or 0 V) and how the sensor is drawn.

Wire colour conventions

ColourUsual meaning (3-wire DC)
Brown (BN)+24 V (supply +)
Blue (BU)0 V (supply −)
Black (BK)Output (usually NO, normally open)
White (WH)Second output on 4-wire types (NC, etc.) or other use

These colours are a widespread convention for proximity switches in the IEC 60947-5-2 family, but they vary by maker and product, and connector types are documented by pin number. Always check that sensor's datasheet or label. 2-wire DC sensors usually have only brown and blue, and which one is + is defined per product.

2-wire sensors and leakage current

A 2-wire sensor shares its supply and signal wires, so even while off it passes a small current (leakage or residual current) to keep its own circuit alive. While on, it drops a little voltage inside itself (residual voltage). Two things must therefore line up.

IEC 61131-2 sorts digital inputs into Types 1, 2 and 3, with Type 2 intended to accept 2-wire proximity switches. Put the input module's specification (ON voltage, OFF current, input type) beside the sensor's (leakage current, residual voltage) and compare. If they do not fit, use a 3-wire sensor or the method the manual recommends (such as a bleeder resistor in parallel with the input — value and wattage from the manual).

Reading the symptoms

SymptomLook at
Sensor LED lights but the PLC input does notNPN/PNP does not match the COM direction, COM not connected
Input stays on or flickers with the sensor off2-wire leakage above the input OFF current, induced voltage (long run beside power cables)
Only distant sensors sometimes fail to registerVoltage drop below the ON voltage, loose terminals
After replacing one sensor, a whole group acts upDifferent sensor types mixed on one common
Supply trips or a fuse blows when the sensor is connectedOutput wired straight to the supply (no load) — recheck the wiring

Checking with a multimeter

In PortDock

Published 2026-10-31