TL;DR: NPN sensors pull the signal wire LOW (to 0V / current sinking) when active. PNP sensors drive the signal wire HIGH (to +24 V / current sourcing) when active. Match the current path shown in the exact PLC module manual: an NPN sensor normally needs an input circuit with its common at +24 V, while a PNP sensor normally needs an input circuit with its common at 0 V. Do not rely on the words “PNP input” or “NPN input” alone—manufacturers do not always use those aliases consistently.

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 circuit must provide a path from +24 V through the input and into the sensor—commonly described as a sourcing input, with the input common at +24 V. When the NPN sensor pulls the signal wire to 0 V, current flows and the module registers ON. Confirm the terminal diagram because naming conventions vary.
+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 circuit must provide a return path from the input to 0 V—commonly described as a sinking input, with the input common at 0 V. When the PNP sensor drives the signal wire to +24 V, current flows into the input and the module registers ON. Confirm the terminal diagram because naming conventions vary.
+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 an input bank whose common is at 0 V—the wrong current path?
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 an input bank whose common is at +24 V—has the same result: both sides of the input are near +24 V when the sensor activates, so no useful current flows and the input stays off.
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: Capability varies by catalog number. Some isolated ControlLogix input modules document both sink-input and source-input wiring, while many other modules have a fixed topology. Use the wiring diagram for the full catalog number; do not generalize from the 1769 or 1756 family name.
Siemens S7-1200/1500: Common 24 V DC digital-input configurations use M/0 V as the input reference and are paired with PNP field devices that supply +24 V when active. Exact CPUs, signal modules, failsafe modules and wiring modes differ, so verify the device manual before landing an NPN sensor.
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 is detected and turns OFF when the target is detected. This can help a control system notice some open-circuit faults, but the meaning depends on the application and program.
An ordinary NC proximity sensor is not automatically a safety device. Guarding and hazard-zone functions require the risk assessment, safety-rated sensor, monitored wiring, safety controller or relay, diagnostic coverage, and architecture specified for the required performance level. A single NC signal can still leave faults ambiguous.
Frequently Asked Questions
Q: Can I use an NPN sensor with an input bank wired for PNP sensors?
A: Not directly if the module topology is fixed. Use an approved interface relay or signal converter, choose a compatible input module, or rewire a genuinely dual-topology bank exactly as its manual allows. The simplest design-stage solution is to match the sensor output to the module's documented current path.
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.
Put the wiring into practice: work through the interactive PLC wiring lessons, then create a free account to save progress and continue into sensor-driven scenarios. No card is required.
Learn more about the discrete sensors that use NPN/PNP output:
