NPN vs PNP Sensor Wiring: Sinking and Sourcing Explained

NPN and PNP refer to the output transistor type inside a 3-wire DC sensor. NPN sinks current to 0 V when active; PNP sources current from +24 V. Matching the wrong sensor to the wrong PLC input is one of the most common wiring mistakes in control panel work — here is exactly how to get it right.

Contents

Overview

Three-wire DC sensors (proximity switches, photoelectric sensors, capacitive sensors) have three connections:

  • Brown — +24 V DC supply
  • Blue — 0 V (common negative)
  • Black — signal output

The output (black wire) is connected internally to either an NPN transistor or a PNP transistor. This determines what voltage appears on the output when the sensor is active:

  • NPN — output switches to 0 V (LOW) when active. Current flows from the load into the transistor (sinking).
  • PNP — output switches to +24 V (HIGH) when active. Current flows from the transistor to the load (sourcing).

Neither type is universally better. PNP is dominant in European and North American machine building. NPN is common in Japan and with Asian-manufactured sensors and PLCs. Many modern sensors are available in both types or as push-pull (both simultaneously).

NPN (Sinking) Output

Inside an NPN output sensor, the output transistor has its collector connected to the output terminal (black wire) and its emitter connected to the 0 V rail (blue wire).

When the sensor detects its target (active state):

  • The NPN transistor turns ON
  • Output terminal (black) is connected to 0 V through the transistor
  • Signal voltage on black wire = ~0 V (LOW)

When the sensor does not detect its target (inactive state):

  • The NPN transistor turns OFF
  • Output terminal (black) is left floating (open circuit to 0 V)
  • An external pull-up resistor (or the PLC input's internal pull-up) pulls the black wire toward +24 V
  • Signal voltage = ~24 V (HIGH)

To wire an NPN sensor to a load or PLC input, connect the black wire to the input, and connect the input's common terminal to +24 V. The load current flows: +24 V → PLC input → black wire → transistor → 0 V.

PNP (Sourcing) Output

Inside a PNP output sensor, the output transistor has its emitter connected to the +24 V rail (brown wire) and its collector connected to the output terminal (black wire).

When the sensor detects its target (active state):

  • The PNP transistor turns ON
  • Output terminal (black) is connected to +24 V through the transistor
  • Signal voltage on black wire = ~24 V (HIGH)

When the sensor does not detect its target (inactive state):

  • The PNP transistor turns OFF
  • Output terminal (black) is left floating (open circuit to +24 V)
  • An external pull-down resistor (or the PLC input's internal pull-down) pulls the black wire toward 0 V
  • Signal voltage = ~0 V (LOW)

To wire a PNP sensor to a load or PLC input, connect the black wire to the input, and connect the input's common terminal to 0 V. The load current flows: +24 V → transistor → black wire → PLC input → 0 V.

PLC Input Types

PLC digital input modules are described as either sinking or sourcing, referring to the common terminal polarity:

  • Sinking input (Type 1 / IEC Type 1) — the common terminal is connected to 0 V. The input activates when +24 V is applied to the input terminal. This accepts PNP sensors (output goes HIGH to +24 V). Common on Allen-Bradley PLCs (1734-IB8, 1769-IQ series) and many Siemens S7-300/400 sourcing input variants.
  • Sourcing input (Type 2 / IEC Type 3) — the common terminal is connected to +24 V. The input activates when 0 V is applied (pulled LOW). This accepts NPN sensors (output goes LOW to 0 V). Common on some Siemens S7-200/S7-1200 default configurations.
Memory aid: "Sinking input = PNP sensor" and "Sourcing input = NPN sensor" — the input and sensor types are opposite. A sinking input sinks current away from the input terminal (so the sensor must source +24 V to it). A sourcing input sources current into the input terminal (so the sensor must sink it to 0 V).

Wiring Combinations Table

Sensor Output vs PLC Input Compatibility
Sensor Output TypeActive Output StateCompatible PLC InputCommon Terminal of PLC
PNP (sourcing)HIGH (+24 V)Sinking input0 V (negative common)
NPN (sinking)LOW (0 V)Sourcing input+24 V (positive common)
Push-pullHIGH or LOWEither sinking or sourcingMatch to output polarity used

Examples by PLC platform:

PLC Platform Input Types
PLC PlatformDefault Input TypeSensor Type
Allen-Bradley 1734-IB8 (Point I/O)Sinking (0 V common)PNP
Allen-Bradley 1769-IQ series (CompactLogix)Sinking (0 V common)PNP
Siemens S7-1200 DI module (standard)Sinking (0 V common)PNP
Siemens ET 200SP DI (with sourcing option)ConfigurablePNP or NPN
Mitsubishi FX3U (European version)Sinking (0 V common)PNP
Mitsubishi FX3U (Japanese version)Sourcing (+24 V common)NPN
Omron CJ1M (standard)Sinking (0 V common)PNP

Wire Colours

IEC 60947-5-2 standardises sensor wire colours for 3-wire DC sensors:

IEC 60947-5-2 Sensor Wire Colours
Wire ColourFunction
Brown+24 V DC supply (L+)
Blue0 V / common negative (M)
BlackOutput signal (NO or NC, NPN or PNP)
WhiteSecond output (complementary or second setpoint)

Both NPN and PNP sensors use the same wire colours — you cannot tell the output type from the wire colour alone. The output type (NPN/PNP) and logic (NO/NC) are printed on the sensor body or specified in the part number. Always verify the sensor datasheet before wiring.

NO vs NC Output Logic

Independent of NPN/PNP, sensors are available in Normally Open (NO) or Normally Closed (NC) output logic:

  • NO (Normally Open) — output is inactive (OFF) when no target is detected. Activates (ON) when target is present.
  • NC (Normally Closed) — output is active (ON) when no target is detected. Deactivates (OFF) when target is present.

For a PNP NO sensor:

  • No target: output LOW (0 V)
  • Target detected: output HIGH (+24 V)

For a PNP NC sensor:

  • No target: output HIGH (+24 V)
  • Target detected: output LOW (0 V)

Many sensors offer both NO and NC simultaneously on separate output wires (black and white). Some sensors allow the output logic to be reversed via a configuration button or IO-Link parameter.

For safety-critical detection (presence verification, machine guarding), use NC logic where possible — a broken wire or power loss deactivates the output, which the PLC can detect as a fault rather than a false "all clear".

Push-Pull Outputs

A push-pull output contains both an NPN and PNP transistor. The active state drives the output HIGH (to +24 V via the PNP transistor) and the inactive state drives it LOW (to 0 V via the NPN transistor). There is no floating state.

Benefits:

  • Compatible with both sinking and sourcing PLC inputs — one sensor can be used universally
  • No pull-up/pull-down resistor needed (output is actively driven in both states)
  • Faster switching and lower susceptibility to noise

Push-pull outputs are increasingly common on modern sensors. They are marked "PNP/NPN" or "push-pull" on the datasheet. IO-Link sensors also support push-pull SIO mode.

Common Wiring Mistakes

1. Mismatching NPN sensor to sinking PLC input

NPN sensor wired to a sinking (0 V common) input: when the sensor activates, its output goes to 0 V. With the input common also at 0 V, there is no voltage differential — the input does not activate. The input appears to never see the sensor trigger.

Fix: Use a PNP sensor, or use a sourcing input card, or use a signal converter.

2. Shorting a PNP output to 0 V

Connecting a PNP sensor output directly to 0 V through any path shorts the +24 V supply through the transistor, damaging it. Check that the input common is 0 V for a sinking input — this is correct and does not create a short because the PNP output is not simultaneously connected to 0 V at the output terminal.

3. Confusing sinking/sourcing terminology between sensors and PLC inputs

Remember: a sinking PLC input needs a sourcing (PNP) sensor. The terms describe what the device does with current — a sinking input sinks current (so the sensor must source it), and vice versa.

4. Mixing NPN and PNP sensors on the same common terminal

If a DI module has a single common terminal and you wire NPN sensors to it alongside PNP sensors, the common terminal can't be both +24 V and 0 V. Use separate modules with separate commons, or use a universal input module that handles both polarities per channel.

5. Ignoring the maximum sensor load current

Sensor output transistors have a maximum continuous output current, typically 100–200 mA. If the load (relay coil, PLC input current) exceeds this, the transistor overheats and fails. Most modern PLC inputs draw only 5–10 mA — well within limits — but driving a relay coil directly from a sensor output requires checking the sensor's current rating against the relay's coil current.

Converting NPN ↔ PNP

When you have a sensor of the wrong polarity for your PLC, options include:

  1. Replace the sensor with the correct output type — easiest for new installations
  2. Use a signal converter — dedicated NPN-to-PNP or PNP-to-NPN solid-state converter modules (e.g., Turck MSI signal conditioners, Phoenix Contact MCR series). One module per channel.
  3. Use an interposing relay — wire the sensor output to a small 24 V DC relay coil; use the relay's contacts to create the correct polarity signal. Adds latency (~5–10 ms) and relay wear, but is universally applicable.
  4. Configure a universal input module — some PLC I/O modules (e.g., Siemens ET 200SP with configurable DI) allow per-channel selection of positive or negative switching.

Frequently Asked Questions

What is a sinking input on a PLC?
A sinking PLC input connects the input circuit to 0 V (negative) when active. To activate a sinking input, the sensor or switch must provide a current path to 0 V — meaning the sensor output goes LOW (0 V) when active. This is the NPN (open-collector to 0 V) configuration. Sinking inputs are common on Siemens PLCs and many Asian-market PLCs.
What is a sourcing input on a PLC?
A sourcing PLC input connects the input circuit to +24 V when active. To activate a sourcing input, the sensor or switch must provide a current path to +24 V — meaning the sensor output goes HIGH (24 V) when active. This matches PNP (open-emitter to +24 V) sensors. Sourcing inputs are common on Allen-Bradley PLCs.
Can I use an NPN sensor with a PLC that needs PNP?
Yes, with a signal converter or relay. An NPN-to-PNP converter (also called a signal conditioner or discrete signal converter) takes an NPN input and outputs a PNP signal. Alternatively, a 24 V relay with the NPN sensor driving the relay coil, and the relay's NO contact providing the PNP-style switching, achieves the same result. Some PLCs have configurable input polarity.
What wire colours are used for NPN and PNP sensors?
Standard IEC 60947-5-2 colours: Brown = +24 V supply; Blue = 0 V (common/negative); Black = output signal (NPN or PNP); White = second output (if present, e.g., complementary output). The output wire colour (black) is the same for both NPN and PNP — the distinction is in the circuit topology, not the wire colour.