NPN vs PNP Sensors: Wiring, Output Type, and PLC Input Connection
NPN vs PNP Sensors: Wiring, Output Type, and PLC Input Connection
TL;DR: NPN sensors pull the signal wire LOW (to 0V / current sinking) when active. PNP sensors pull the signal wire HIGH (to +24 V / current sourcing) when active. Your PLC input module must match the sensor output type: a sourcing (PNP) input module works with PNP sensors; a sinking (NPN) input module works with NPN sensors. Mismatching them is the most common cause of "the sensor works on the meter but the PLC input never turns on."

Almost every discrete sensor on a factory floor — proximity sensors, photoelectric sensors, capacitive sensors, laser sensors — outputs either NPN or PNP. The sensor works perfectly when you test it with a multimeter. The PLC input refuses to change state. Nine times out of ten, the cause is an NPN/PNP mismatch. This is the single most common discrete wiring mistake in industrial electrical work.
The 3-Wire Sensor Cable
Almost all industrial proximity sensors and photoelectric sensors use a 3-wire connection:
| Wire colour | Function | |---|---| | Brown | +24 V DC supply (+VCC) | | Blue | 0 V / common (GND) | | Black | Signal output |
The signal output wire is the one that changes state when the sensor detects a target. Whether it goes high (+24V) or low (0V) when active depends on the output type: NPN or PNP.
(Some sensors add a white 4th wire for a complementary output — if the black wire is NO, the white wire is NC. Same NPN/PNP rules apply.)
NPN Output: Current Sinking (Pull to 0V)
An NPN sensor contains an NPN transistor in the output stage. When the sensor detects a target, the transistor turns ON and connects the signal (black) wire to the 0V (blue) wire internally. The signal wire is pulled LOW — it reads approximately 0V.
When the sensor is NOT detecting: the transistor is OFF, the signal wire floats high (or is pulled high by the PLC input circuit). This is the OFF state.
Who uses NPN sensors: Japanese and Korean manufacturers (Panasonic, Keyence, Omron, Sick in some product families, Chinese manufacturers generally). NPN sensors dominate Asian-manufactured equipment and Asian OEM machine builds.
How to wire an NPN sensor to a PLC input:
The PLC input module must be sourcing type (also called "PNP input" or "positive common input"). The input module provides +24V on the common terminal. When the NPN sensor pulls the signal wire to 0V, current flows from the module's +24V through the sensor's transistor to 0V — the current sinks through the sensor into the module's common. The module registers the input as ON.
+24V ──── [Brown wire] ──── NPN Sensor (brown)
│
+24V ──── PLC COM ──┐ │ (PLC sources current)
│ │
PLC Input ──── [Black wire] ──── NPN Sensor (black signal)
│
0V ────── [Blue wire] ──── NPN Sensor (blue) ──┘ (transistor pulls to 0V)
PNP Output: Current Sourcing (Pull to +24V)
A PNP sensor contains a PNP transistor in the output stage. When the sensor detects a target, the transistor turns ON and connects the signal (black) wire to the +24V (brown) wire internally. The signal wire is pulled HIGH — it reads approximately +24V.
When the sensor is NOT detecting: the transistor is OFF, the signal wire floats low (or is pulled low by the PLC input circuit). This is the OFF state.
Who uses PNP sensors: European and North American manufacturers (Siemens, Balluff, ifm, Turck, Rockwell, Banner in standard configurations). PNP sensors are the default in Western European and North American industrial practice.
How to wire a PNP sensor to a PLC input:
The PLC input module must be sinking type (also called "NPN input" or "negative common input"). The input module's common terminal connects to 0V. When the PNP sensor pulls the signal wire to +24V, current flows from the sensor's transistor into the PLC input, then out through the module's 0V common — the current sources from the sensor into the module. The module registers the input as ON.
+24V ──── [Brown wire] ──── PNP Sensor (brown) ──┐ (transistor switches)
│
+24V ──── [Black wire] ──── PLC Input ──── PLC COM ──── 0V
PNP Sensor (black signal) (PLC sinks current)
0V ────── [Blue wire] ──── PNP Sensor (blue)
The Mismatch Trap
What happens when you wire an NPN sensor to a sinking (NPN) input module — the wrong combination?
The NPN sensor pulls the black wire to 0V when it detects. The PLC input module is also connected to 0V on its common. When the sensor activates, both the signal wire and the common are at 0V. There is no voltage difference across the input — the PLC sees nothing. The input stays permanently OFF regardless of what the sensor detects.
The reverse mistake — PNP sensor into a sourcing (PNP) input module — has the same result: both the signal wire and the module common are at +24V when the sensor activates; no current flows; the input never turns on.
How to Identify Your Sensor Output Type
From the datasheet: look for "output type" or "switching output." You will see one of: NPN, NPN/NO, NPN-NO, DC NPN, sinking, open collector to 0V, PNP, PNP/NO, PNP-NO, DC PNP, sourcing, solid-state, high-side.
From the part number: most manufacturers encode the output type in the part number. "-1" suffix often means PNP; "-2" means NPN (Balluff, ifm). "P" in the part number usually means PNP. Check the catalogue coding key.
With a meter: connect brown to +24V and blue to 0V. Point the sensor at a target. Measure voltage on the black wire:
- Black goes to ~0V → NPN
- Black goes to ~+24V → PNP
How to Identify Your PLC Input Module Type
From the module datasheet: look for "input type," "wiring diagram," or "COM terminal." If the common terminal (COM) connects to +24V in the wiring diagram → sourcing input (use with NPN sensors). If COM connects to 0V → sinking input (use with PNP sensors).
Allen-Bradley: Most 1769 and 1756 DC input modules are dual-type — they accept both NPN and PNP sensors by configuring the COM wiring. Read the module installation manual carefully.
Siemens S7-1200/1500: Inputs are sourcing by default (accepts NPN sensors). The module supplies the current; the sensor sinks it.
From the module label: look for "Type 1 IEC" or "Type 3 IEC" — these describe the input circuit topology but you still need the wiring diagram to confirm NPN/PNP compatibility.
Sensors with Selectable NPN/PNP
Many modern sensors offer a selectable output mode via a DIP switch or configuration tool. On Keyence sensors and some Sick models, a small switch on the body selects NPN or PNP. Check the datasheet — this feature eliminates the sourcing/sinking mismatch problem and is worth specifying when buying sensors for a new machine.
NO vs NC Output
Both NPN and PNP sensors come in Normally Open (NO) and Normally Closed (NC) variants — and some sensors switch between NO and NC via a DIP switch. This is separate from NPN/PNP:
- NO (Normally Open): signal wire is OFF (not active) when no target detected; turns ON when target detected. The most common configuration.
- NC (Normally Closed): signal wire is ON when no target detected; turns OFF when target detected. Used for failure-safe detection — a broken cable looks like "target present" rather than "target absent."
For safety-critical detection (confirming a guard is closed, confirming a hazard zone is clear), prefer NC sensors — a sensor failure opens the circuit and the PLC sees a fault condition.
Frequently Asked Questions
Q: Can I use an NPN sensor with a PNP PLC input module?
A: Not directly. You need a signal converter (also called an interface relay or signal conditioner) between the sensor and the PLC. Alternatively, many PLC modules accept both types when you configure the COM terminal correctly — check your specific module's wiring diagram. The simplest solution is to match sensor type to module type at the design stage.
Q: Is NPN or PNP better?
A: Neither is universally better. PNP (sourcing) is the European/North American standard and matches most Western PLC modules in their default wiring. NPN (sinking) is the Asian standard and is common in equipment from Japan, Korea, and China. The only correct answer is: match the sensor output type to the PLC input type for your specific module.
Q: Why does my sensor light up but the PLC input stays off?
A: The LED indicator on a sensor lights when the sensor's output transistor activates — it is driven from the sensor supply, not from the PLC. So the LED can be on while the PLC input is off. The most likely cause is NPN/PNP mismatch. Verify with a multimeter: measure the voltage on the signal (black) wire relative to 0V when the sensor LED is on. If it reads 0V on an NPN sensor and your module expects PNP, you have a mismatch.
Q: I have a 2-wire sensor. Does NPN/PNP apply?
A: 2-wire sensors (load-powered sensors, no separate supply wire) are wired in series with the PLC input circuit like a switch. The concept of NPN/PNP does not directly apply, but 2-wire sensors still have a polarity — connect them per the wiring diagram. 2-wire sensors have a voltage drop when on (typically 2–8V) and a leakage current when off — check that the PLC input module's leakage tolerance and minimum on-voltage are compatible.
Practice connecting sensors to a PLC input with the interactive motor start-stop scenario — it models the sensor as a 3-wire input and shows the PLC program responding correctly.
Learn more about the discrete sensors that use NPN/PNP output: