SIGNALSDISCRETE DC / TRANSISTOR OUTPUT

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.

QUICK CHECK

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.

01 · PRINCIPLE

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.

PNP · SOURCINGHIGH-SIDE SWITCH
+V SENSORQ OUTPUTINPUT / LOAD → 0 V
When ON, the sensor provides current from its positive supply into the receiving circuit.
NPN · SINKINGLOW-SIDE SWITCH
+V → INPUT / LOADQ OUTPUT0 V SENSOR
When ON, the sensor provides a path for current from the receiving circuit down to 0 V.
Key point: the receiving input must complete the opposite side of the circuit. A correctly powered sensor can switch its LED normally yet never operate the PLC input if the input common and output polarity are incompatible.
02 · CURRENT PATH

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.

03 · WIRING

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.

TYPICAL PNP CONNECTIONCurrent is sourced into the PLC input
BROWN / +V+24 VDCSensor supply positive; use the rated supply voltage.
BLACK / QPLC DIGITAL INPUTThe PNP output supplies current to the input when the output transistor is ON.
BLUE / 0 V0 VThe PLC input group normally requires a compatible return/common toward 0 V.
Typical current path when ON: +24 V → sensor PNP output → PLC input → input common / 0 V.
TYPICAL NPN CONNECTIONCurrent is sunk from the PLC input
BROWN / +V+24 VDCSensor supply positive.
BLACK / QPLC DIGITAL INPUTThe NPN output pulls the input current path toward 0 V when the output transistor is ON.
BLUE / 0 V0 VThe receiving input group normally needs a compatible positive feed/common arrangement.
Typical current path when ON: +24 V / input common → PLC input → sensor NPN output → 0 V.
Do not copy wire colours blindly: connector pin assignments, dual outputs, teach inputs and four-wire NO/NC versions can use different conductors. Use the wiring diagram for the exact sensor part number.
04 · PLC INPUTS

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.

PNP and NPN sensor output actions and compatible receiving-input current paths
Sensor outputON-state actionReceiving input must provide
PNPSources current from +VReturn path toward 0 V
NPNSinks current toward 0 VFeed path from +V
CHECK THE COMMONThe DI group common often reveals whether the input circuit expects sourced or sunk current.
CHECK THE THRESHOLDSThe sensor ON-state voltage and available current must satisfy the input’s specified ON/OFF thresholds.
CHECK ISOLATIONIndividually isolated inputs may be wired differently from fixed-common input groups.

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.

05 · OUTPUT LOGIC

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.

PNP + NOWhen the switching condition becomes active, the output transistor sources current.
PNP + NCThe PNP output sources current while the switching condition is inactive and turns OFF when the condition becomes active.
NPN + NOWhen the switching condition becomes active, the output transistor sinks current.
NPN + NCThe NPN output sinks current while the switching condition is inactive and turns OFF when the condition becomes active.

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.

06 · ELECTRICAL LIMITS

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.

PNP and NPN output electrical specifications and their practical effects
SpecificationWhy it matters
Supply-voltage rangeThe sensor must operate within its rated DC supply range under load and supply variation.
Maximum output currentThe connected load must not demand more current than the transistor output is rated to switch.
ON-state / residual voltageThe output does not necessarily reach the exact supply rail; the remaining voltage must still satisfy the PLC input threshold.
OFF-state leakage currentA sensitive electronic input may still see a small current when the sensor output is nominally OFF.
Protection functionsShort-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.

07 · TROUBLESHOOTING

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?

  1. Verify the sensor supply. Measure the supply at the sensor terminals and confirm polarity and voltage under operating conditions.
  2. Identify the exact output type. Confirm PNP, NPN or push-pull from the part number and wiring diagram, not from wire colour alone.
  3. 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.
  4. Check the PLC input common. Make sure the input group is wired so current can actually flow through the sensor and the input circuit.
  5. 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.
  6. 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.
Troubleshooting checks for common PNP and NPN sensor input symptoms
SymptomLikely checks
Sensor LED switches, PLC input stays OFFPNP/NPN compatibility, DI common, output conductor, input threshold, damaged channel.
PLC input always ONWrong common wiring, short to supply/0 V, NC logic, leakage current versus input threshold.
PLC logic is reversedNO/NC selection, Q versus /Q, light-on/dark-on configuration.
Output voltage changes but DI does notInput current below the DI ON threshold, incompatible input circuit, shared common, incorrect voltage reference.
Intermittent switchingLoose terminals, supply drop, noise, marginal sensing distance, excessive load or cable fault.
08 · SELECTION

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.

Replacement rule: match the output polarity and the switching logic. A PNP normally-open sensor is not a direct electrical replacement for an NPN normally-open sensor, and a PNP normally-closed sensor does not behave like a PNP normally-open sensor.