PNP vs NPN Sensors Explained What Is the Difference
Choosing a proximity sensor or photoelectric sensor is not only about sensing distance, body shape, or whether it detects metal, plastic, or a passing box. One small line in the data sheet can decide whether the sensor works cleanly with the rest of the control system: PNP or NPN output.
Both sensor types send an ON or OFF signal to a PLC input, counter, relay module, or other control device. The difference is how the sensor handles current when it switches. A PNP sensor sources current. An NPN sensor sinks current.
That sounds simple, but it affects wiring, fault-finding, spare parts, and controller compatibility. Pick the wrong output type and the sensor may never turn the input on, even if the sensor itself is detecting the target correctly.

What PNP and NPN mean in sensor wiring
In industrial sensor wiring, `PNP` and `NPN` describe the sensor output transistor. The sensor uses that transistor as an electronic switch.
A mechanical switch simply opens or closes a contact. A transistor output does something similar, but it does it electronically. When the sensor detects a target and its output condition is met, the transistor switches ON. Depending on the output type, it either provides positive voltage to the load or provides a path back to `0 V`.
The key terms are:
Sourcing output
A sourcing output supplies current to the load. In most DC automation systems, this means the output switches toward the positive supply, often `+24 V DC`.
Sinking output
A sinking output provides a path for current to return to `0 V`. The load receives positive voltage from the supply, then the sensor output completes the circuit to ground or common.
A helpful way to remember it:
PNP supplies positive power to the input.
NPN connects the input down to 0 V.
The sensor may look the same either way. Many three-wire DC proximity sensors have a brown wire for positive supply, a blue wire for `0 V`, and a black wire for the switching output. The difference is what the black output wire does when it turns ON.
What is a PNP sensor?
A PNP sensor has a sourcing output. When the sensor output switches ON, it supplies current from the positive supply to the connected load.
In a typical DC control circuit, the load connects between the sensor output and `0 V`. That load may be a PLC input, a counter input, a small relay input module, or another compatible device.
The current path when a PNP output is ON is:
`Positive supply → sensor output → load → 0 V`
For example, imagine a three-wire PNP proximity sensor connected to a PLC input card. The sensor has power on its brown wire and `0 V` on its blue wire. When the sensor detects metal, the black output wire goes high, near the positive supply voltage. That voltage feeds the PLC input. If the PLC input common is wired correctly to `0 V`, the input turns ON.
A PNP sensor is often described as switching the positive side of the circuit.
PNP wiring in plain terms
For a typical three-wire PNP DC sensor:
Brown wire connects to `+24 V DC`
Blue wire connects to `0 V`
Black output wire connects to the PLC input
PLC input common connects to `0 V`
When the sensor is ON, the PLC input sees positive voltage from the sensor output. The input circuit now has a complete path back to `0 V`, so the PLC reads the signal as active.
This is why PNP sensors are usually paired with sinking PLC inputs. The sensor sources current, and the PLC input accepts that current and returns it to common.
What is an NPN sensor?
An NPN sensor has a sinking output. When the sensor output switches ON, it allows current to flow from the connected load toward `0 V`.
In this arrangement, the load connects between the positive supply and the sensor output. The sensor does not send positive voltage out to the load. Instead, it completes the return path to `0 V`.
The current path when an NPN output is ON is:
`Positive supply → load → sensor output → 0 V`
For example, imagine an NPN photoelectric sensor connected to a PLC input. The PLC input side must be supplied with positive voltage through the input circuit. When the sensor detects the target, its output transistor turns ON and pulls the PLC input down toward `0 V`. The input circuit sees current flow and registers the signal.
An NPN sensor is often described as switching the negative side of the circuit.
NPN wiring in plain terms
For a typical three-wire NPN DC sensor:
Brown wire connects to `+24 V DC`
Blue wire connects to `0 V`
Black output wire connects to the PLC input
PLC input common connects to the positive supply side, depending on the input module design
When the sensor is ON, the output wire provides a path to `0 V`. The controller input must be designed and wired so that this sinking action creates a valid input signal.
This is why NPN sensors are usually paired with sourcing PLC inputs. The input supplies current, and the sensor sinks it.
PNP and NPN sensors compared
The main difference is the direction of current flow through the load when the sensor output is ON.
Feature | PNP sensor | NPN sensor |
Output action | Sources current | Sinks current |
Load connection | Between output and `0 V` | Between positive supply and output |
Output voltage when ON | Toward positive supply | Toward `0 V` |
Common PLC pairing | Sinking input | Sourcing input |
Typical current path | Positive supply → sensor output → load → `0 V` | Positive supply → load → sensor output → `0 V` |
Simple memory aid | Switches positive | Switches negative |
The table shows why a sensor and controller must match. A PNP sensor expects the connected input to accept current that comes from the sensor output. An NPN sensor expects the connected input circuit to provide current that the sensor can pull down to `0 V`.
The voltage reading on the output wire also differs.
With a PNP sensor, the output wire usually rises toward the positive supply when ON. With an NPN sensor, the output wire is pulled toward `0 V` when ON. This reading can be useful when checking a sensor with a multimeter, as long as the circuit has a proper load and common reference.
Why PLC input compatibility matters
A sensor output does not work alone. It must match the input circuit of the device it connects to.
A PLC input module may be designed as sinking, sourcing, or configurable. The terms can be confusing because they describe the input, not the sensor. A sourcing sensor usually connects to a sinking input. A sinking sensor usually connects to a sourcing input.
Think of it as a pair:
Sensor output | Controller input needed |
PNP sourcing output | Sinking input |
NPN sinking output | Sourcing input |
If the pair does not match, the input may stay OFF all the time. In other cases, it may behave unpredictably, especially if there are leakage currents, shared commons, or mixed voltage references.
Before ordering a sensor, check the controller manual or input module label. Look for wording such as:
`Sinking input`
`Sourcing input`
`PNP compatible`
`NPN compatible`
`DC input common`
`COM`, `0 V`, or `+24 V` terminal wiring
Some modern PLC input cards accept either type, but not all do. Many input cards require a specific common wiring arrangement. The safest approach is to confirm the input circuit before selecting the sensor output.

How normally open and normally closed outputs fit in
PNP and NPN describe how the sensor switches current. They do not describe whether the output is normally open or normally closed.
That is a separate choice.
A `NO` sensor output is normally open. The output turns ON when the sensor detects the target.
A `NC` sensor output is normally closed. The output is ON when the target is not present, then turns OFF when the target is detected.
You can have:
PNP normally open
PNP normally closed
NPN normally open
NPN normally closed
Some sensors provide both `NO` and `NC` outputs, often using four wires. In that case, the wiring diagram matters even more. The output type still decides whether each signal sources or sinks current.
For example, a PNP normally open sensor will send positive voltage to the input only when it detects the target. A PNP normally closed sensor will send positive voltage until the target appears. Both are PNP because both source current when their output is ON.
Common mistakes when choosing between PNP and NPN
Many sensor problems come from small assumptions during replacement or design. These are the most common ones.
Matching the sensor body but not the output
A replacement sensor may have the same diameter, sensing distance, and connector type, but a different output. A PNP M12 proximity sensor and an NPN M12 proximity sensor can look nearly identical.
Always check the full part number and output type before fitting the replacement.
Assuming wire colors tell the whole story
Standard DC sensor wire colors are useful, but they do not prove the output type. Brown, blue, and black may appear on both PNP and NPN sensors.
The data sheet or part number must confirm whether the black output wire sources or sinks current.
Confusing sensor logic with PLC logic
A PLC program may show an input as ON or OFF, but that does not tell you whether the sensor is PNP or NPN. The program logic could invert the signal. The sensor could also be normally closed.
Check the physical wiring and input module type before changing the program.
Mixing PNP and NPN sensors on the same input common
Some panels can handle mixed sensor types if input modules are separated and wired correctly. Others cannot. Mixing sourcing and sinking signals on the same common without checking the input design can cause faults or dead inputs.
If a panel uses grouped commons, keep the whole group consistent unless the PLC manual clearly allows mixed wiring.
How to identify which type you need
The best starting point is not the sensor. It is the device receiving the signal.
Check these items before choosing:
The PLC or controller input type
Look for sourcing or sinking input information. This is the most important check.
The input common wiring
See whether the common terminal connects to `0 V` or `+24 V DC`.
The existing sensor part number
If replacing a failed sensor, match the output type as well as the shape and sensing range.
The machine standard
Many sites standardize on one output type to keep spare parts and troubleshooting simpler.
The sensor connection diagram
The diagram normally shows whether the load connects between output and `0 V`, or between positive supply and output.
If the diagram shows the load connected from the output to `0 V`, it is a PNP sourcing arrangement. If it shows the load connected from positive supply to the output, it is an NPN sinking arrangement.
A simple way to remember the difference
Use the direction of current as the memory aid.
PNP pushes current out to the load.
The output goes high when ON. The load sits between the output and `0 V`.
NPN pulls current down from the load.
The output goes low when ON. The load sits between positive supply and the output.
Another simple phrase is:
PNP means positive switching
NPN means negative switching
This is not a complete electronics definition, but it is a practical way to remember the wiring behavior in common DC sensor circuits.
Can you convert PNP to NPN or NPN to PNP?
Sometimes, yes, but it is usually better to buy the correct sensor.
Relay interfaces, optocoupler modules, and signal converters can translate between sourcing and sinking signals. These parts are useful when a machine has an existing PLC input type and the only available sensor has the opposite output.
Still, conversion adds parts, wiring, panel space, and possible failure points. It can also affect response time or diagnostics in some applications. For a new installation, choosing the correct output type from the start is cleaner.
If conversion is needed, check:
Supply voltage
Input current
Output current rating
Switching speed
Common wiring
Electrical isolation
Fail-safe behavior
For simple detection tasks, a compatible sensor is almost always the easier choice.
Practical examples
A conveyor has a photoelectric sensor that detects boxes. The PLC input card common is wired to `0 V`, and the input turns ON when it receives `+24 V DC`. This setup needs a PNP sensor because the sensor must source positive voltage to the input.
A counting device has an input that supplies internal positive voltage and expects the sensor to pull the signal down to `0 V`. This setup needs an NPN sensor because the sensor must sink current.
A maintenance technician replaces a failed proximity sensor with one that has the same connector and sensing distance. The LED on the sensor turns on near metal, but the PLC input never changes. The likely issue is output compatibility. The sensor may be detecting correctly, but its output type does not match the input module.
These examples show the main point: the sensor can be healthy and still produce the wrong kind of signal for the controller.
The takeaway when choosing PNP or NPN
PNP and NPN sensors do the same basic job. They switch a signal when a target is detected. The difference is the direction of current flow.
A PNP sensor sources current. Its output sends positive voltage to the load when ON. The load connects between the output and `0 V`.
An NPN sensor sinks current. Its output provides a path to `0 V` when ON. The load connects between the positive supply and the output.
Before selecting a proximity sensor or photoelectric sensor, check the controller input type, common wiring, and the machine standard. Matching those details prevents wiring problems and makes the signal behave the way the control system expects.




Comments