Sensors Edge Hub Logo
How to Wire NPN and PNP Proximity Sensors to a PLC
Industrial Sensors · 19 min read · Mar 26, 2026 · By Rihards Niparts

How to Wire NPN and PNP Proximity Sensors to a PLC

In Europe, 90% of proximity sensors shipped are PNP. In Asia, 90% are NPN. When a Japanese machine arrives at a German plant, someone has to rewire — and if they guess wrong, the PLC input reads permanently OFF with no error message, no fault code, just silence.

The jargon doesn't help. "Sinking," "sourcing," "NPN," "PNP" — four terms describing the same two-way choice, each from a different angle. Datasheets use them interchangeably. I/O card manuals assume you already know. This guide gives you the simple mental model first, then the exact wiring steps for every configuration you'll encounter.

TL;DR: NPN sensors sink current to ground (0V); PNP sensors source current from +24V. Wire brown to +24V, blue to 0V, and black (signal) to the PLC input. NPN needs PLC common at +24V (sourcing input); PNP needs PLC common at 0V (sinking input). Europe defaults to PNP (90% market share), Asia to NPN (90%). When mismatched, the input reads permanently OFF. Fix: match sensor type to PLC input type, or use a relay/converter.

What Is the Difference Between NPN and PNP Proximity Sensors?

NPN sensors sink current to ground (0V) when active; PNP sensors source current from the positive supply (+24V). The difference is which rail the output transistor connects to — and that single distinction drives every wiring decision downstream.

Think of it this way: NPN "drains" current downward toward ground. PNP "pushes" current from the top rail. In an NPN sensor, the output transistor completes a path from the load down to 0V when activated. In a PNP sensor, the transistor completes a path from +24V down through the load when activated.

The names come from transistor technology. An NPN transistor (Negative-Positive-Negative) conducts when its base is driven high relative to emitter — in a sensor circuit, that means the output pulls toward 0V. A PNP transistor (Positive-Negative-Positive) conducts when its base is pulled low — the output pushes toward +24V. Understanding the transistor behavior isn't strictly necessary for wiring, but it explains why you can't just flip the sensor orientation and expect it to work.

The global proximity sensor market reached $5.28 billion in 2024, growing at 8.2% CAGR. Regional preferences are sharply divided by geography, not by any technical superiority of one type:

<title>Regional Proximity Sensor Adoption by Type</title> Horizontal bar chart showing sensor type preferences by region. Europe: 90% PNP, 10% NPN. Asia: 90% NPN, 10% PNP. North America: 60% PNP, 40% NPN. Source: Industry market data 2024. Regional Proximity Sensor Adoption by Type Source: Industry market data, 2024 PNP (Sourcing) NPN (Sinking) Europe 90% PNP 10% Asia 10% 90% NPN N. America 60% PNP 40% NPN 0% 50% 100%
Regional proximity sensor type preferences — the divide explains why cross-regional machine installations often require rewiring. Source: Industry market data, 2024.

For broader context on how proximity sensors fit into the larger measurement ecosystem, see the complete guide to industrial sensors.

What Do the Wire Colors Mean? Brown, Blue, Black Explained

Brown is +V (positive supply), blue is 0V (ground/negative), and black is the signal output. This follows IEC 60947-5-2, the international standard governing proximity sensor electrical characteristics and wire color coding — consistent across manufacturers worldwide.

The memory trick that actually sticks: "brown is always power, blue is always ground, black is the business wire." Once that's locked in, you never need to look it up again.

3-Wire Sensors (Most Common)

The standard configuration has three wires:

Wire Color Connection Function
Brown +24V DC supply Power to sensor electronics
Blue 0V (DC common) Ground return
Black PLC input terminal Switched signal output

The black wire is the only one that changes behavior between NPN and PNP — it either sinks toward 0V (NPN) or sources from +24V (PNP) when the sensor detects a target. Brown and blue connect identically regardless of sensor type.

4-Wire Sensors

A 4-wire sensor adds a white wire as a second signal output. White provides the complementary output: if black is Normally Open (NO), white is Normally Closed (NC), and vice versa. This lets you connect both outputs simultaneously — useful in safety circuits where one output drives the load and the other monitors for fault conditions.

2-Wire Sensors

2-wire sensors have only brown and blue. They insert directly into the load circuit like a mechanical switch, with the sensor electronics powering themselves from the small voltage drop across the device. They're simple to install but introduce complications covered in detail below.

How to Wire a 3-Wire NPN Sensor to a PLC

Connect brown to +24V, blue to 0V, and black (signal) to a sourcing PLC input terminal that has its common (COM) tied to +24V. That's the complete wiring. The explanation of why follows.

Step-by-step:

  1. Brown wire → +24V DC supply terminal
  2. Blue wire → 0V (DC common/negative)
  3. Black wire → PLC input terminal (e.g., I0.0 on a Siemens S7)
  4. PLC input card COM → +24V (this makes it a sourcing input)

When the NPN output activates, the transistor inside the sensor closes a path from the PLC input terminal down through the sensor to 0V (blue wire). Current flows: +24V → input card COM → input circuit → black wire → sensor output transistor → 0V. The PLC detects a valid logic-high current and registers the input as ON.

When inactive, the NPN transistor is open. The signal wire floats near +24V (because the input circuit has a pull-up to COM). The input reads OFF.

Key electrical specs for NPN outputs:

  • Output voltage drop when active: ~1.0V (sensor saturates, black wire sits ≈1V above ground)
  • Leakage current when inactive: ≤0.5 mA
  • Operating supply range: 10–30V DC
  • Maximum load current: 200 mA (do not exceed — the output transistor will fail)

The 1.0V drop is why your multimeter reads slightly above 0V on an active NPN output rather than dead zero. It's normal.

Field verification: With the sensor powered and a target present, measure voltage between black (signal) and blue (0V). An active NPN output reads ≤1V. Inactive reads +24V. If you read the opposite, your sensor is PNP.

How to Wire a 3-Wire PNP Sensor to a PLC

Connect brown to +24V, blue to 0V, and black (signal) to a sinking PLC input terminal that has its common (COM) tied to 0V. The sensor wiring is physically identical to NPN — only the PLC input card common changes.

Step-by-step:

  1. Brown wire → +24V DC supply terminal
  2. Blue wire → 0V (DC common/negative)
  3. Black wire → PLC input terminal (e.g., I0.0)
  4. PLC input card COM → 0V (this makes it a sinking input)

When the PNP output activates, the transistor closes a path from +24V (brown wire) through the sensor output, out the black wire, through the PLC input circuit, and down to 0V at the COM terminal. Current flows from +24V to 0V — the PLC sees the current and registers ON.

Key electrical specs for PNP outputs:

  • Output voltage drop when active: ~0.5V (PNP saturates with slightly lower drop than NPN)
  • Leakage current when inactive: ≤0.5 mA
  • Operating supply range: 10–30V DC

Field verification: With target present, measure between black and blue. An active PNP output reads ≥23V (near +24V). Inactive reads near 0V. If you read the opposite, your sensor is NPN.

European context: Siemens S7-300/400/1200/1500 default I/O cards ship configured as sinking inputs (COM at 0V). They accept PNP sensors without any jumper changes. That's by design — PNP is the European default, and Siemens aligns with the regional standard. When you inherit a European machine, assume PNP unless the documentation says otherwise.

The physical sensor wiring (brown → +24V, blue → 0V, black → input) is identical for NPN and PNP. The only difference is COM terminal polarity on the PLC input card. This makes the mismatch especially dangerous — everything looks wired correctly until you check what the COM terminal is tied to.

2-Wire vs 3-Wire vs 4-Wire — Which Do You Have?

Count the wires. 2-wire is simplest but has leakage current issues that can cause false triggers. 3-wire is the standard NPN/PNP configuration used in 90%+ of industrial installations. 4-wire provides dual outputs (NO + NC) for safety-critical applications.

2-Wire Sensors

2-wire sensors insert in series with the load like a mechanical switch. No separate power wire — the sensor electronics power themselves from the voltage drop across the device.

The complications:

  • Voltage drop when active: 5–10V (compared to <2V for 3-wire). On a 24V supply, the load only sees 14–19V.
  • Leakage current when inactive: 0.8–2.0 mA. This current must flow to keep the sensor electronics alive — it flows through the PLC input even when the sensor is "OFF."
  • False trigger risk: 0.8 mA leakage × 6 kΩ typical PLC input impedance = 4.8V. Many PLCs have ON thresholds around 8V, so this won't trigger — but some sensitive inputs have lower thresholds, and parallel leakage from multiple sensors adds up.
  • Minimum load current: Typically 3 mA. The PLC input must draw at least 3 mA or the sensor electronics starve and malfunction.
  • Fix for false triggers: Wire a 10 kΩ bleeder resistor from the input terminal to 0V. This provides a shunt path for leakage current, keeping voltage below the ON threshold.

3-Wire Sensors

3-wire sensors have a dedicated supply wire (brown), ground wire (blue), and separate signal output (black). The sensor electronics power continuously from brown/blue. The black wire switches independently between near-0V (NPN active) or near-+24V (PNP active).

  • Operating voltage: 10–30V DC
  • Output voltage drop when active: <2V
  • No minimum load current requirement — the signal wire is a switched transistor output, not a series element
  • Explicitly NPN or PNP — no ambiguity about type

This is the configuration to specify for all new installations.

4-Wire Sensors

4-wire sensors add white as a second signal output. Black and white carry complementary outputs (typically NO on black, NC on white). Both activate simultaneously — one output energizes the load, the other provides fault monitoring or is wired to a safety relay.

<title>Proximity Sensor Wire Configuration Comparison: Voltage Drop and Leakage Current</title> Grouped bar chart showing voltage drop and leakage current for three sensor configurations. 2-wire: 5–10V drop, 0.8–2.0 mA leakage. 3-wire: less than 2V drop, less than 0.5 mA leakage. 4-wire: less than 2V drop, less than 0.5 mA leakage per output. Source: IEC 60947-5-2 and manufacturer specifications. Sensor Configuration: Voltage Drop vs Leakage Current Voltage Drop (V, active) Leakage Current (mA, inactive) Value (V or mA) 10 7.5 5 2.5 5–10V 0.8–2 mA 2-Wire <2V <0.5 mA 3-Wire <2V <0.5 mA 4-Wire Source: IEC 60947-5-2 and manufacturer specifications. 4-wire values per output.
2-wire sensors trade simplicity for higher voltage drop and leakage current — both create problems at PLC inputs. 3-wire and 4-wire sensors avoid both issues. Source: IEC 60947-5-2 and manufacturer specifications.

Sinking vs Sourcing PLC Inputs — How to Match Your Sensor

NPN sensors need sourcing PLC inputs (common tied to +24V). PNP sensors need sinking PLC inputs (common tied to 0V). Getting this wrong is the most common proximity sensor wiring mistake in the field — and it produces no obvious error, just an input that never activates.

The terms describe current direction through the PLC input circuit:

  • Sourcing input (common at +24V): supplies current from the positive rail. Pairs with NPN sensors, which sink that current to ground.
  • Sinking input (common at 0V): absorbs current into the ground rail. Pairs with PNP sensors, which source current from +24V.

Quick field check: measure voltage at the COM terminal of your input card. Reading +24V? You have a sourcing input — use NPN sensors. Reading 0V? You have a sinking input — use PNP sensors.

<title>Sensor-to-PLC Input Matching Decision Flowchart</title> Decision flowchart: Start by checking PLC input card COM terminal voltage. If COM is at +24V, use NPN sensor with sourcing input. If COM is at 0V, use PNP sensor with sinking input. If COM is configurable via jumper or software, select to match your sensor type. If sensor and input are mismatched, use relay, signal converter, or reconfigure the input card. Which Sensor Type Does Your PLC Input Need? Check PLC input card COM terminal COM voltage? Measure with multimeter +24V 0V Configurable Use NPN Sensor Sourcing input, COM=+24V Use PNP Sensor Sinking input, COM=0V Set jumper/software To match sensor type If wrong type Input always reads OFF Fix: relay, converter, or reconfigure card Source: IEC 60947-5-2 wiring practice guidelines
Match sensor type to PLC input common polarity. A mismatched sensor produces no fault — the input simply never activates.

Many modern I/O cards (Siemens S7-1200, Allen-Bradley 1769, Mitsubishi FX5U) allow jumper or software selection between sinking and sourcing. Check the card documentation before assuming the type is fixed. When the card is configurable, you can adapt to whatever sensor you have on hand.

Troubleshooting — Sensor Wired but No Signal

If your sensor powers up (LED on) but the PLC doesn't register the input, check three things first: NPN/PNP mismatch, 2-wire leakage current exceeding the OFF threshold, and output overload from excessive load current.

Diagnostic sequence:

  1. LED on when powered?

    • No: Check brown/blue polarity. Verify supply is 10–30V DC. Measure voltage across brown and blue with multimeter.
    • Yes: Sensor is powered. Proceed.
  2. LED flashes or changes when target is present?

    • No: Check sensing distance (target may be beyond rated range) and target material (some sensors can't detect aluminum or stainless without a correction factor).
    • Yes: Sensor is detecting. Issue is downstream wiring.
  3. NPN/PNP type matches PLC input?

    • Measure voltage at PLC input COM terminal. +24V = sourcing input (needs NPN). 0V = sinking input (needs PNP).
    • If mismatched: rewire PLC input COM, use a relay, or install a signal converter.
  4. Input still dead with correct match?

    • Measure voltage on black signal wire relative to blue (0V):
      • NPN active should read ≤1V. NPN inactive should read ~+24V.
      • PNP active should read ≥23V. PNP inactive should read ~0V.
    • If readings are backwards: sensor polarity is inverted — check for NC vs NO setting (some sensors have a teach button that toggles output logic).
  5. Input reads intermittently?

    • Check total load current on sensor output. Maximum is 200 mA. If driving multiple parallel loads, sum the currents.
    • For 2-wire sensors: add a 10 kΩ bleeder resistor from input terminal to 0V.

Common mistakes — reference table:

Mistake Symptom Fix
NPN sensor → sinking input (COM at 0V) Input always OFF Move COM to +24V, or swap sensor to PNP
PNP sensor → sourcing input (COM at +24V) Input always OFF Move COM to 0V, or swap sensor to NPN
Output overload >200 mA Sensor heats up, intermittent output Reduce load or buffer with relay
Series 2-wire sensors Last sensor starved, erratic Switch to 3-wire, or check minimum load current each
Parallel 2-wire sensors Leakage accumulates, false ON Add bleeder resistor per input, or switch to 3-wire
Wrong sensing face distance LED on but never flashes Check rated range, reduce gap

Failure context: Environmental stressors (vibration, contamination, excessive temperature) account for 30–40% of proximity sensor failures in service. Under rated conditions, inductive proximity sensors have calculated MTTF values of 1,488–3,900 years — meaning wiring and installation errors account for the vast majority of actual failures you'll encounter in the field. The sensor itself rarely fails; the wiring almost always does.

<title>Proximity Sensor Failure Cause Breakdown</title> Donut chart showing failure causes for proximity sensors in service. Environmental stressors: 35%. Wiring or type mismatch: 30%. Electrical overload: 20%. Mechanical damage: 15%. Source: Industry reliability studies and field service data. Proximity Sensor Failure Causes Failure Causes Environmental (35%) Wiring/mismatch (30%) Electrical overload (20%) Mechanical damage (15%) Source: Industry reliability studies and field service data
Wiring and mismatch errors account for approximately 30% of proximity sensor failures in service — making correct NPN/PNP matching your highest-leverage reliability action. Source: Industry reliability studies and field service data.

The signal troubleshooting techniques here parallel the diagnostic approach for analog signals — see troubleshooting 4-20mA loop noise for the analog equivalent.

Regional Standards and Best Practices

Europe standardized on PNP (90% market share). Asia standardized on NPN (90%). North America is mixed at roughly 60/40 PNP/NPN, trending toward PNP as European equipment imports increase.

Why did regions diverge? European safety directives and IEC standardization pushed toward PNP early — Siemens, Schneider Electric, and other dominant European PLC manufacturers configured their default I/O cards for PNP sensors, and the market followed. In Asia, Japanese automation giants (Mitsubishi, Omron, Keyence) historically built around NPN conventions rooted in early semiconductor manufacturing practice. Neither type is technically superior. The split is purely historical.

IEC 60947-5-2 is the universal reference regardless of region. It defines:

  • Wire color coding (brown/blue/black/white)
  • Electrical characteristics: supply voltage 10–30V DC, output voltage drop limits, leakage current maximums
  • EMC immunity: ±8 kV ESD per IEC 61000-4-2, which is why proximity sensors survive in electrically noisy environments near VFDs and contactors
  • Rated useful mission time: 20 years

For mixed-equipment facilities (European PNP machines alongside Asian NPN equipment): use universal I/O cards at the boundary. Most modern Siemens, Allen-Bradley, and Mitsubishi cards now support both logic types via jumper or software — configure sinking/sourcing per group of inputs matching each machine's sensor type. Never mix NPN and PNP sensors on the same input group without reconfiguring the COM terminal.

Best practices for new installations:

  1. Default to PNP — aligns with IEC standards, European equipment defaults, Siemens/Rockwell defaults, and the global trend
  2. Document sensor type on every wire diagram — list NPN or PNP explicitly, not just wire colors (brown/blue/black is the same for both)
  3. Standardize within a facility — pick one type and enforce it across all new sensors; the savings in troubleshooting time outweigh any cost difference
  4. Label COM terminal polarity on every I/O card in the cabinet — one label prevents the most common installation mistake

For how proximity sensors integrate into connected automation architectures, see IIoT protocols compared for the data transport layer perspective. And for comparing sensor technologies across measurement domains, the flow meter types compared article demonstrates the same exclusion-rules approach applied to flow measurement selection.

Frequently Asked Questions

What is the difference between NPN and PNP proximity sensors?

NPN sensors sink current to ground — the output transistor connects the load to 0V when active. PNP sensors source current from the positive supply — the output transistor connects the load to +24V when active.

The practical consequence: NPN needs a sourcing PLC input (common at +24V), while PNP needs a sinking PLC input (common at 0V). Electrically, both types use the same brown/blue/black wire colors with identical physical connections to the sensor. The difference only appears at the PLC input card common terminal.

How do you wire a 3-wire NPN sensor to a PLC?

Connect brown to +24V, blue to 0V, and black (signal) to a sinking PLC input terminal. Set the input card common (COM) to +24V — this makes it a sourcing input that pairs with NPN. When the NPN output activates, the transistor completes the current path from +24V through the input circuit down to 0V through the sensor. The PLC sees current flow and registers ON.

What does sinking and sourcing mean for PLC inputs?

A sinking PLC input provides a current path to 0V — its common (COM) terminal connects to 0V. It pairs with PNP sensors, which source current from +24V into the input. A sourcing PLC input provides current from +24V — its COM terminal connects to +24V. It pairs with NPN sensors, which sink that current to 0V through the sensor transistor.

The terms describe where current goes through the input circuit: sinking inputs absorb current into ground, sourcing inputs supply current from positive rail.

How do I know if my PLC input is NPN or PNP compatible?

Check the I/O card's common (COM) terminal connection. Measure voltage at COM with a multimeter:

  • COM reads +24V → sourcing input → use NPN sensors
  • COM reads 0V → sinking input → use PNP sensors
  • No voltage at COM → card may be configurable via jumper or software — check the I/O card datasheet

Many modern cards (Siemens S7-1200, Allen-Bradley Compact I/O, Mitsubishi FX5U) are configurable. If you're uncertain, the I/O card model number will tell you — look for "sinking," "sourcing," or "configurable" in the product description.

Can I use an NPN sensor with a PNP PLC input?

Not directly — the current paths are incompatible. Three solutions:

  1. Relay: NPN sensor output drives relay coil (wired correctly for NPN: coil between signal wire and 0V). Relay contact wires independently to the PNP input. Simple, field-repairable, about $5–15.
  2. Signal converter module: Dedicated NPN-to-PNP converter modules are available from Phoenix Contact, Wago, and others. DIN-rail mount, no moving parts, ~$25–50.
  3. Configurable I/O card: If your PLC input card supports both types via jumper, reconfigure the input group to match the NPN sensor. Zero additional hardware.

The relay approach is the fastest field fix. The configurable I/O card is the cleanest long-term solution.

Conclusion

Three things to take away from this guide:

  1. NPN = sinking = output pulls to ground; PNP = sourcing = output pushes from positive supply. That mental model applies everywhere — to the sensor, to the PLC input, to every datasheet you read.

  2. Match sensor type to PLC input common polarity. NPN needs sourcing input (COM at +24V). PNP needs sinking input (COM at 0V). A mismatch produces no fault — the input simply never activates. Check COM terminal voltage with a multimeter before assuming you have the wrong sensor.

  3. For new installations, default to PNP. It aligns with IEC 60947-5-2, European equipment defaults, Siemens/Rockwell factory configurations, and the global trend. It reduces the chance of a mismatch when mixed-origin equipment shares a panel.

For broader context on how proximity sensors fit into industrial measurement systems, see the complete guide to industrial sensors. For the analog signal counterpart — debugging current loop issues with the same systematic approach — see troubleshooting 4-20mA loop noise.

Frequently Asked Questions

What is the difference between NPN and PNP proximity sensors?
NPN sensors sink current to ground — the output transistor connects the load to 0V when active. PNP sensors source current from the positive supply — the output transistor connects the load to +24V when active. NPN needs a sourcing PLC input (common at +24V), PNP needs a sinking PLC input (common at 0V).
How do you wire a 3-wire NPN sensor to a PLC?
Connect brown to +24V, blue to 0V, and black (signal) to a sinking PLC input terminal. Set the input card common (COM) to +24V. When the NPN output activates, it completes the current path from +24V through the input circuit down to 0V.
What does sinking and sourcing mean for PLC inputs?
A sinking PLC input provides a current path to 0V and pairs with PNP sensors. A sourcing PLC input provides a current path from +24V and pairs with NPN sensors. The terms describe current direction through the input circuit.
How do I know if my PLC input is NPN or PNP compatible?
Check the I/O card common (COM) terminal. Common tied to +24V means sourcing input — use NPN sensors. Common tied to 0V means sinking input — use PNP sensors. Many modern cards are configurable via jumper or software.
Can I use an NPN sensor with a PNP PLC input?
Not directly. Use a relay (NPN drives coil, relay contact wires to PNP input), a dedicated signal converter module, or a universal I/O card that supports both logic types.