PLC Sinking vs Sourcing: PNP and NPN Sensor Wiring

The Sensor That Didn’t Work: Sinking vs Sourcing, and Why It Matters

A proximity sensor (PNP, sourcing output) connected to a PLC input that was configured for NPN (sinking). The sensor worked on the bench but not on the machine. The PLC input never turned on. The sensor was fine. The wiring was wrong. This is the most common electrical mistake in sensor integration.

The difference

A PNP (sourcing) sensor switches the load to +24V. When the sensor activates, it connects the output to +24V. The PLC input sees +24V and registers ON.

An NPN (sinking) sensor switches the load to 0V (ground). When the sensor activates, it connects the output to 0V. The PLC input sees 0V and registers ON.

If you connect a PNP sensor to an NPN input, the sensor sends +24V to an input that expects 0V. The input doesn’t register. The sensor appears dead.

Sensor type Output switches to PLC input type needed
PNP (sourcing) +24V Sinking input (common to 0V)
NPN (sinking) 0V Sourcing input (common to +24V)

What we found

The PLC was configured for NPN inputs (common to +24V). The sensors were PNP. We had two options: reconfigure the PLC for PNP (common to 0V), or swap the sensors for NPN. We reconfigured the PLC. The sensor common wire was moved from +24V to 0V. The sensors worked immediately.

The wiring

A 3-wire sensor has: brown (+24V), blue (0V), black (signal). For PNP, the black wire goes to the PLC input, and the PLC input common is 0V. For NPN, the black wire goes to the PLC input, and the PLC input common is +24V. The sensor’s power wires (brown and blue) are the same either way. Only the common connection changes.

The mixed system

Most modern PLCs support both PNP and NPN (you set it in the software). But some older PLCs are fixed. If you’re mixing sensor types, use a sensor with a selectable output (some sensors have a switch). Or use a relay module that converts PNP to NPN (or vice versa) between the sensor and the PLC.

The sensor wiring rule: PNP sensors need sinking inputs (common to 0V). NPN sensors need sourcing inputs (common to +24V). If the sensor doesn’t work on the machine but works on the bench, check the PLC input configuration. The sensor isn’t dead — it’s wired to the wrong input type.