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 on | Pulled to 0 V | Pulled to +24 V |
| Other side of the load (input) | +24 V | 0 V |
| PLC input common (COM) | To +24 V | To 0 V |
| Current path | Input → 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
| Colour | Usual 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.
- Off: the sensor's leakage current must be below the PLC input's «OFF current» (the current below which the input reads off). If it is higher, the input stays on or flickers when the sensor is off.
- On: 24 V minus the sensor's residual voltage must exceed the input's «ON voltage». Add the drop on a long cable and it may fall short.
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
| Symptom | Look at |
|---|---|
| Sensor LED lights but the PLC input does not | NPN/PNP does not match the COM direction, COM not connected |
| Input stays on or flickers with the sensor off | 2-wire leakage above the input OFF current, induced voltage (long run beside power cables) |
| Only distant sensors sometimes fail to register | Voltage drop below the ON voltage, loose terminals |
| After replacing one sensor, a whole group acts up | Different sensor types mixed on one common |
| Supply trips or a fuse blows when the sensor is connected | Output wired straight to the supply (no load) — recheck the wiring |
Checking with a multimeter
- Across the sensor's brown and blue: close to 24 V (if not, voltage drop or supply).
- Input terminal to COM, before and after the sensor detects: at least the input's ON voltage when on, falling towards the OFF side when off.
- On an NPN sensor the output-to-0 V voltage goes near 0 when on; on a PNP sensor it goes near 24 V.
In PortDock
- «Wiring Diagram Maker» web tool: draws NPN/PNP sensor to PLC input wiring with a checklist, as SVG or PNG.
- «Voltage Drop & Wire Size Calculator» web tool: the voltage left at a distant sensor for a given cable length and size.
- Modbus Master: if the PLC exposes its inputs over Modbus, a «02 Read discrete inputs» table shows on the PC whether the input changes as you trigger the sensor.
Published 2026-10-31