Mini-lesson · 3 min read

NPN vs PNP in 3 minutes

The one electrical difference between sinking and sourcing sensor outputs, and the meter reading that settles it.

Both sensor types detect the same things; they differ only in what the black signal wire does at the moment of detection. A PNP ("sourcing") output switches +24 V onto the black wire: it sources current toward the PLC input. An NPN ("sinking") output pulls the black wire down to 0 V: it sinks current out of the input. Same job, opposite polarity at the pin.

PNP (sourcing) sensor wiring animation A carton passes a photo-eye. On detect, the PNP output closes between the +24 volt supply and the black signal wire; current flows from +24 volts through the sensor, out the black wire, through the PLC input channel, and returns to 0 volts through the COM terminal. The black wire reads +24 volts and the input turns on.+24 V0 VPNP · sourcingampBNBUBK (signal)INCOMIN0PLC input cardBK ≈ 0 V · input OFFBK = +24 V · input ON

PNP (sourcing). When the carton enters the beam, the output closes between +24 V and the black wire: current flows out of the sensor, through the PLC input channel, and back to 0 V via COM. The black wire sits at +24 V while detecting.

switched signal current (conventional, +24 V → 0 V) sensor supply current (BN → BU)

NPN (sinking) sensor wiring animation A carton passes a photo-eye. On detect, the NPN output closes between the black signal wire and 0 volts; current flows from +24 volts into the PLC COM terminal, through the input channel, out the IN terminal along the black wire, into the sensor, and returns to 0 volts. The black wire reads 0 volts and the input turns on.+24 V0 VNPN · sinkingampBNBUBK (signal)INCOMIN0PLC input cardBK ≈ +24 V · input OFFBK = 0 V · input ON

NPN (sinking). Same detection, opposite flow: the output closes between the black wire and 0 V, so current comes from +24 V through the PLC COM terminal and input channel, out the IN terminal, and into the sensor. The black wire sits at 0 V while detecting.

switched signal current (conventional, +24 V → 0 V) sensor supply current (BN → BU)

Why the mismatch bites

A PLC input card is built for one convention. Fit an NPN sensor where a PNP belongs and every part still "works" (the sensor powers up, its LED fires on every carton), but the input channel waits for +24 V while the sensor switches toward 0 V, so the PLC never hears it. The tell: this fault appears immediately after a sensor replacement. The meter check: target present, black referenced to 0 V. A healthy PNP reads about +24 V; an NPN reads near 0 V.

NPN sensor on a PNP-configured PLC input, mismatch animation A carton passes a photo-eye. On detect, the NPN output closes between the black signal wire and 0 volts, and the sensor LED lights. The PLC input card is wired for PNP sensors: its COM terminal ties to 0 volts, so the channel turns on only when +24 volts arrives at IN. Both ends of the input channel sit at 0 volts. No current flows, the input LED stays dark, and the PLC never sees the carton.+24 V0 VNPN · sinkingampBNBUBK (signal)INCOMIN0waits for +24 V at INPLC input cardwired for PNP sensorsBK ≈ 0 V · input OFFBK = 0 V · input still OFF

The mismatch. The NPN sensor from the second drawing is wired to the input card from the first, which expects a PNP. The card ties COM to 0 V, so its channel turns on when +24 V arrives at IN. On detect the NPN output closes toward 0 V instead. Both ends of the input channel sit at 0 V, no current flows, and IN0 never lights. The sensor LED still fires on every carton.

sensor supply current (BN → BU)no switched signal current flows

Check yourself

Pick an answer to see why it’s right or wrong.

1. A PNP photo-eye detects product. Referenced to 0 V, its black signal wire reads about:
2. An NPN sensor was fitted where a PNP belongs. The sensor LED blinks on every carton, but the PLC input never turns on. Why?