← Robotics & Automation Studio
Concept Explainer · Robotics & Automation

NPN vs. PNP Sensors

Two sensors that both turn a load on — by switching the opposite side of the exact same circuit. Confuse them in the field and the load either does nothing, or something worse.

A standard 3-wire DC proximity or photoelectric sensor has a V+ pin, a V-/0V pin, and a signal pin usually labeled OUT. The V+ and 0V pins just power the sensor's internal electronics and stay connected the entire time it's running. The OUT pin is where the difference lives: it's driven by an internal transistor that switches on trigger, and that transistor is either an NPN type or a PNP type. Both accomplish the same end result — energizing a load when the sensor detects a target — but they do it by closing the circuit on opposite sides of that load, and that single fact is the entire reason the two are not drop-in substitutes for each other.

The Setup

Same job, opposite side of the load

An NPN sensor — often called a "sinking" output — wires the load between the +V supply and the sensor's OUT terminal. When the sensor triggers, its internal NPN transistor connects OUT down to 0V/GND, completing the loop: +V flows through the load, into OUT, through the transistor, to ground. The load's far side stays connected to +V the entire time; only the ground-side connection ever switches. A PNP sensor— a "sourcing" output — wires the load between the sensor's OUT terminal and 0V/GND instead. When it triggers, its internal PNP transistor connects OUT up to +V, completing the loop the other way: +V flows through the transistor, out through OUT, through the load, to ground. Here the load's far side stays connected to GND the entire time; only the positive-side connection ever switches. Same result, opposite side of the circuit doing the switching.

NPN sensor — switches the ground side

Sinking output
NOT TRIGGERED+V RAIL (24VDC)OUTNPN SENSORinternal transistor0V / GND RAILOUT: floating (Hi-Z)no path to GND — load stays offTRIGGERED+V RAIL (24VDC)OUTNPN SENSORinternal transistor0V / GND RAILOUT: pulled to 0Vcircuit complete — load energizes
Load wired to
+V and OUT
The load's far side is hardwired to +V permanently; only the ground-side connection switches.
On trigger, OUT connects to
0V / GND
The sensor "sinks" current away to ground — it never touches the +V side of the load.

PNP sensor — switches the positive side

Sourcing output
NOT TRIGGERED+V RAIL (24VDC)PNP SENSORinternal transistorOUT0V / GND RAILOUT: floating (Hi-Z)no path from +V — load stays offTRIGGERED+V RAIL (24VDC)PNP SENSORinternal transistorOUT0V / GND RAILOUT: pulled to +Vcircuit complete — load energizes
Load wired to
OUT and GND
The load's far side is hardwired to 0V permanently; only the positive-side connection switches.
On trigger, OUT connects to
+V
The sensor "sources" current out to the load — it never touches the GND side of the load.
Why this works

Every switched circuit needs exactly one thing to close it — the question is which side

Turning a load on always requires a complete loop from +V, through the load, to 0V, with one point in that loop acting as the switch. An NPN sensor puts its transistor at the ground end of that loop: the load's other terminal is permanently wired to +V, and the sensor's only job is to occasionally connect the remaining terminal down to 0V. A PNP sensor puts its transistor at the positive endinstead: the load's other terminal is permanently wired to 0V, and the sensor's only job is to occasionally connect the remaining terminal up to +V.

That's why the two aren't interchangeable without also changing how the load is wired. If a field technician swaps an NPN sensor in for a PNP sensor without moving the load's fixed connection point, the load is now permanently tied to the wrong rail for that sensor's switching action — the circuit through the load never closes at all, so nothing happens. And if that OUT signal instead feeds a PLC input card built to expect one polarity, sending it the other polarity's active-high or active-low behavior can, on some unprotected input designs, drive current back into the card in a direction its input circuitry was never designed to handle.

Common misconception
"NPN vs. PNP is just a labeling convention — the sensor still turns the same load on, so it can't matter much which one you install."

It's an easy assumption because, from a pure logic standpoint, both sensor types do produce an "ON" and an "OFF" signal, and a datasheet's block diagram can make them look like interchangeable variants of the same part. But NPN and PNP don't just differ in name — they physically switch opposite terminals of the load circuit. An NPN sensor's transistor only ever connects to 0V; it has no path to +V at all. A PNP sensor's transistor only ever connects to +V; it has no path to 0V at all. Wire either one into a load circuit built for the other type, and the load's fixed connection point is now on the wrong rail for that sensor to ever complete the loop through — the load simply never turns on, no matter how many times the sensor triggers. Feed the wrong type into certain PLC input configurations instead of a load, and depending on the card's input design, the mismatch can go beyond "doesn't work" into damaging the input circuitry. NPN vs. PNP determines which physical side of the circuit the sensor is even capable of switching — and getting that backward is one of the most common field-wiring mistakes in industrial sensor installation.

Related Concept Explainers
Sink vs. Source PLC I/O
Read it →
Sensors for Automation: Proximity, Photoelectric, Encoders & Force/Torque
Read it →

NPN vs. PNP Sensors — Concept Explainer

Explains why NPN (sinking) sensors and PNP (sourcing) sensors are not interchangeable: an NPN sensor's output switches the ground side of the load circuit while the load's other terminal stays wired to +V, and a PNP sensor's output switches the positive side of the load circuit while the load's other terminal stays wired to 0V — the same end result, achieved by controlling opposite sides of the circuit.

Why This Is Commonly Misunderstood

NPN and PNP sensors both produce a clean ON/OFF signal when they detect a target, and datasheets often present them as two configuration options of the same part number rather than as electrically opposite devices. That framing hides the one detail that actually matters in the field: an NPN sensor's output transistor only ever has a path to 0V/GND, and a PNP sensor's output transistor only ever has a path to +V. Neither type can switch the rail it doesn't have a path to. So swapping one for the other without also moving the load's fixed wiring point doesn't produce a slightly different signal — it produces a circuit that never closes at all.

How Each Type Actually Works

A 3-wire DC sensor has three connections: V+ and V-/0V, which power the sensor's internal electronics and stay connected continuously, and OUT, which is driven by an internal transistor that switches when the sensor detects a target.

In an NPN (sinking) sensor, that internal transistor is an NPN type wired between the OUT terminal and the sensor's 0V connection. The load is wired externally between +V and OUT. When the sensor is not triggered, the transistor is open and OUT floats — no current flows and the load stays off. When triggered, the transistor closes, pulling OUT down to 0V and completing a loop: +V, through the load, into OUT, through the transistor, to ground. The load's far terminal never moves off +V; only the ground-side connection switches.

In a PNP (sourcing) sensor, the internal transistor is a PNP type wired between the sensor's +V connection and the OUT terminal. The load is wired externally between OUT and 0V instead. When not triggered, OUT floats and the load stays off. When triggered, the transistor closes, pushing OUT up to +V and completing the loop the other direction: +V, through the transistor, out through OUT, through the load, to ground. The load's far terminal never moves off 0V; only the positive-side connection switches.

Where This Matters in Practice

This distinction shows up constantly in industrial field wiring. If a technician replaces a failed PNP sensor with an NPN sensor of otherwise identical specs, and the load's far terminal is still wired to 0V (as it was for the PNP unit), the new NPN sensor has no way to complete that circuit — its transistor only connects to ground, and the load's far side is already at ground. The load simply never energizes, regardless of how reliably the new sensor detects targets. The reverse swap fails the same way in the other direction. Getting this right means the load's fixed wiring point always has to match the new sensor's switching type, not just its detection specs, range, or form factor. This exact same switching-side distinction, viewed from the PLC input/output module's side of the wiring rather than the sensor's side, is what determines whether a field device is compatible with a "sinking" or "sourcing" PLC I/O module — see the related Sink vs. Source PLC I/O concept explainer for that half of the picture.

Frequently asked questions

What is the actual difference between an NPN and a PNP sensor?

An NPN (sinking) sensor's output transistor connects to 0V/GND when triggered, switching the ground side of the load circuit while the load's other terminal stays wired to +V. A PNP (sourcing) sensor's output transistor connects to +V when triggered, switching the positive side of the load circuit while the load's other terminal stays wired to 0V. Both energize the load on trigger, but by controlling opposite sides of the circuit.

Can you substitute an NPN sensor for a PNP sensor without changing anything else?

No. The load has to be wired to the opposite fixed rail for each type — a load wired for a PNP sensor sits between OUT and 0V, while a load wired for an NPN sensor sits between +V and OUT. Installing the wrong sensor type without also rewiring the load's fixed connection point means the sensor's transistor has no path to the rail it needs to switch, so the load never energizes.

Why can mixing up NPN and PNP sensors damage a PLC input card?

Some PLC input modules are designed to expect one specific polarity of signal — sinking or sourcing — and route it through input circuitry built around that assumption. Feeding the opposite polarity into certain unprotected or non-isolated input designs can drive current into the card in a direction it was never built to handle, damaging the input circuitry, rather than simply producing no response.

Does NPN vs. PNP affect the sensor's detection performance?

No — NPN vs. PNP is purely about the sensor's output wiring and switching behavior, not its sensing technology, range, or accuracy. An inductive, capacitive, or photoelectric sensor can be built with either output type while using the identical detection method underneath.

Which is more common, NPN or PNP sensors?

Regional convention varies: PNP (sourcing) outputs are the more common default in much of Europe, while NPN (sinking) outputs have historically been more common in North America and parts of Asia, largely following the conventions of the PLC input hardware typically used in each region. Neither is universally standard, which is exactly why checking sensor output type against the receiving equipment's expected input type is a standard part of automation wiring practice.

Is NPN vs. PNP the same distinction as sinking vs. sourcing PLC I/O?

It's the same underlying electrical concept, viewed from opposite ends of the wiring. NPN/PNP describes which side of the load circuit a field sensor's output switches. Sinking/sourcing describes which side of the circuit a PLC input or output module provides internally. Matching them correctly — a sourcing module with a sinking (NPN) device, or a sinking module with a sourcing (PNP) device — is what makes the full loop actually close.

🎓

Try our Robotics & Automation Studio

More calculators, simulators, and guides for this discipline.

Related tools & guides

Sink vs. Source PLC I/O — Concept ExplainerSensors for Automation: Proximity, Photoelectric, Encoders & Force/Torque SensingAutomation Sensor Selection Reference