PNP vs NPN Sensor Outputs: Wiring & PLC Inputs
A PNP sensor output sources current from the positive supply into the receiving input when its output transistor is on. An NPN sensor output sinks current from the receiving input toward 0 V when its output transistor is on.
The PLC or controller input must complete the current path for the selected PNP or NPN output. PNP/NPN identifies the transistor output stage; normally open/normally closed identifies the switching logic.
Before wiring a PNP or NPN sensor, identify the output type, the PLC input circuit and its common terminal. Do not rely on the words “PNP input” or “NPN input” alone—verify the actual current path in both manufacturers’ wiring diagrams.
What PNP and NPN sensor outputs actually do
PNP and NPN describe the transistor switching stage used by a DC sensor output. In the ON state, a PNP output connects the output conductor toward the sensor’s positive supply. An NPN output connects the output conductor toward the sensor’s 0 V or negative supply.
The distinction is therefore about where the switched current comes from and where it returns. It does not describe what the sensor detects, whether the switching function is normally open or normally closed, or the physical sensing principle.
Sourcing vs sinking: follow the current, not the label
For a PNP sensor, conventional current flows from the positive supply through the sensor output transistor, then through the PLC input or load, and back to 0 V. For an NPN sensor, current flows from the positive supply through the PLC input or load, then through the sensor output transistor to 0 V.
PNP sensor ON
The output terminal is driven toward +V and sources current to the receiving circuit. The input side needs a return path toward 0 V.
NPN sensor ON
The output terminal is driven toward 0 V and sinks current from the receiving circuit. The input side needs a feed path from +V.
PLC manufacturers do not always use “sourcing” and “sinking” terminology from the same point of view. Some manuals describe an input by what the input circuit itself does; others describe it by the sensor type it accepts. The wiring diagram and input common connection are more reliable than the label alone.
Three-wire PNP and NPN sensor wiring
Many DC proximity, photoelectric and position sensors use a three-wire connection: two conductors power the sensor and a third conductor carries the switching output. A common industrial colour convention is brown for positive supply, blue for 0 V and black for the switching output, but the actual pinout and wire colours must always be checked against the device documentation.
Matching PNP and NPN sensors to PLC digital inputs
A PNP sensor needs a receiving input that provides a return path toward 0 V; electrically this is a sinking input. An NPN sensor needs a receiving input that provides current from the positive supply; electrically this is a sourcing input. The decisive check is the PLC input circuit and common-terminal wiring.
| Sensor output | ON-state action | Receiving input must provide |
|---|---|---|
| PNP | Sources current from +V | Return path toward 0 V |
| NPN | Sinks current toward 0 V | Feed path from +V |
A universal or configurable input may accept either polarity. An interface relay can also be used to adapt an otherwise incompatible sensor and input circuit, provided its coil circuit is suitable for the sensor output. Never assume that a PLC input is polarity-flexible because its software logic can be inverted.
PNP/NPN is not the same as normally open/normally closed
PNP or NPN defines the electrical direction of the transistor output. Normally open (NO) or normally closed (NC) defines the switching function—whether that transistor output is ON or OFF in the sensor’s normal or non-actuated condition. These are independent properties.
For photoelectric sensors and configurable devices, manufacturers may use terms such as light-on, dark-on, active-high, active-low, Q, /Q or complemented output. Confirm the actual switching truth table rather than inferring it from PNP/NPN.
Output current, voltage drop and leakage current
A transistor sensor output is not an ideal mechanical contact. The ON state has a finite voltage drop, the OFF state can have leakage current, and the output has a maximum permitted load current. Those values matter when the load is a PLC input, relay coil, counter or another electronic interface.
| Specification | Why it matters |
|---|---|
| Supply-voltage range | The sensor must operate within its rated DC supply range under load and supply variation. |
| Maximum output current | The connected load must not demand more current than the transistor output is rated to switch. |
| ON-state / residual voltage | The output does not necessarily reach the exact supply rail; the remaining voltage must still satisfy the PLC input threshold. |
| OFF-state leakage current | A sensitive electronic input may still see a small current when the sensor output is nominally OFF. |
| Protection functions | Short-circuit, overload and reverse-polarity protection are common on industrial sensors but are not a substitute for checking the exact device rating. |
Inductive loads can also require suppression, and capacitive loads can create high switching current. If the sensor drives anything other than a normal PLC input, check the permitted load type and any required protective circuit in the manufacturer documentation.
Troubleshooting PNP and NPN sensor inputs
Separate three questions: is the sensor powered, is its transistor output switching electrically, and does the PLC input provide the correct current path?
- Verify the sensor supply. Measure the supply at the sensor terminals and confirm polarity and voltage under operating conditions.
- Identify the exact output type. Confirm PNP, NPN or push-pull from the part number and wiring diagram, not from wire colour alone.
- Check the sensor output with the correct reference. For a PNP output, measure Q relative to 0 V and look for the expected rise when ON. For an NPN output, measure Q relative to 0 V and look for the expected pull-down when ON; the OFF voltage can depend on the receiving pull-up or load.
- Check the PLC input common. Make sure the input group is wired so current can actually flow through the sensor and the input circuit.
- Compare sensor LED and PLC state. A sensor LED that changes while the PLC never changes usually points to output compatibility, wiring, threshold or channel configuration rather than the sensing element itself.
- Check logic configuration. If the PLC state changes but is inverted, verify NO/NC, light-on/dark-on or Q versus /Q configuration before changing program logic.
| Symptom | Likely checks |
|---|---|
| Sensor LED switches, PLC input stays OFF | PNP/NPN compatibility, DI common, output conductor, input threshold, damaged channel. |
| PLC input always ON | Wrong common wiring, short to supply/0 V, NC logic, leakage current versus input threshold. |
| PLC logic is reversed | NO/NC selection, Q versus /Q, light-on/dark-on configuration. |
| Output voltage changes but DI does not | Input current below the DI ON threshold, incompatible input circuit, shared common, incorrect voltage reference. |
| Intermittent switching | Loose terminals, supply drop, noise, marginal sensing distance, excessive load or cable fault. |
Choosing between PNP and NPN outputs
Choose PNP when
- The PLC or controller input is designed to receive sourced current.
- The installed machine standard already uses PNP field devices.
- Replacement sensors must match an existing PNP wiring architecture.
Choose NPN when
- The PLC or controller input is designed to supply current to an NPN switching output.
- The existing equipment and spare-parts standard is built around NPN devices.
- A replacement must preserve an established NPN current path and logic.
Neither polarity is inherently more accurate; these are discrete switching interfaces, not analogue measurement ranges. Compatibility, fault behaviour, wiring standard and maintainability are the main selection criteria. Some modern sensors provide configurable push-pull outputs that can source and sink, but their configuration and input compatibility still need to be verified.
