PLC Sim Lab
Industrial sensors

PNP vs NPN sensors

Industrial DC sensors come in two output types, PNP and NPN. They do the same job, but they switch the opposite side of the circuit. Get it wrong and the PLC input never turns on, even though the sensor LED does.

2 min read · Updated 2026-10-02

Three wires

A 3-wire DC sensor has a standard colour code (IEC 60947-5-2):

PNP = sourcing

When a PNP sensor detects a target, its output transistor connects the black wire to +24 V. It "sources" current into the load. The PLC input must therefore be sinking: the input COM goes to 0 V.

Current path: +24 V → sensor → black wire → PLC input → COM → 0 V.

PNP is the standard in Europe, India and most of Asia.

NPN = sinking

When an NPN sensor detects, its output connects the black wire to 0 V. It "sinks" current from the load. The PLC input must be sourcing: the input COM goes to +24 V.

Current path: +24 V → COM → PLC input → black wire → sensor → 0 V.

NPN is common in Japan and on older machines.

Quick comparison

PNP (sourcing)NPN (sinking)
Black wire when ON+24 V0 V
Load / PLC input other side0 V+24 V
PLC input COM0 V (sinking input)+24 V (sourcing input)
Typical regionEurope, India, AsiaJapan, US (older)

How to tell which one you have

  1. Read the label: "PNP", "NPN", or a wiring diagram with the load to 0 V (PNP) or to +V (NPN).
  2. Measure: power the sensor, trigger it, and measure between black and blue. About 24 V = PNP. Between black and brown about 24 V = NPN.

Mixing types

Many PLCs let each input group be sinking or sourcing, set by where you connect COM, but all sensors in one group must be the same type. If you have to use an NPN sensor on a PNP-only input, use an interface relay or a signal converter.

NO and NC outputs

PNP/NPN is about which side is switched. NO/NC is about when: an NO output turns on when a target is present; an NC output turns off. Some sensors have both (black NO, white NC).

The Sensor Lab on the PLC Sim Lab home page shows the current path for both types live, and the Playground lets you wire them to a real PLC model.

Try it yourself. Wire sensors, contactors and a PLC, write ladder logic and press RUN in the free PLC Sim Lab Playground. Nothing to install.

Open the Playground →Guided lessons →