NPN vs PNP Sensors: Sinking vs Sourcing Output, PLC Wiring & Selection Guide
NPN sensors are sinking outputs that pull the signal wire to 0 V when active and pair with sourcing PLC digital inputs, whereas PNP sensors are sourcing outputs that switch +24 V onto the signal wire and pair with sinking PLC inputs. Both use identical IEC 60947-5-2 power wiring (brown +V, blue 0 V, black output), so choosing between NPN and PNP depends strictly on your PLC input common rail and regional panel standard.
This engineering guide applies to 3-wire and 4-wire DC semiconductor industrial sensors—including inductive, capacitive, photoelectric, and magnetic proximity switches—governed by IEC 60947-5-2 and connected to 24 V DC PLC digital input cards specified under IEC 61131-2. Exact residual voltage drop, maximum load current, switching frequency, and short-circuit protection limits always depend on the specific sensor model datasheet.
NPN vs PNP Sensor Comparison Matrix for 24 V DC Industrial Panels
NPN and PNP sensors perform identical object-detection tasks across inductive, capacitive, and photoelectric families, differing only in how the internal bipolar junction transistor (BJT) switches load current relative to the 24 V DC power rails. Matching transistor polarity to the PLC digital input common terminal ensures clean logic transitions without signal inversion or hardware damage.
| Engineering Criterion | NPN Sensor (Sinking Output) | PNP Sensor (Sourcing Output) | Automation & Panel Consequence |
|---|---|---|---|
| Output transistor action | Pulls output (BK) low to 0 V (BU) when active | Drives output (BK) high to +V (BN) when active | Determines whether PLC input channel sees active-low or active-high voltage |
| Conventional current direction | Flows from PLC input into sensor output to 0 V | Flows from sensor output into PLC input to 0 V | Must match single-polarity PLC optocoupler direction; reversed polarity reads permanently OFF |
| Required PLC digital input type | Sourcing PLC input (PLC COM wired to +24 V DC) | Sinking PLC input (PLC COM wired to 0 V DC) | Bidirectional PLC cards accept either polarity by switching the COM jumper |
| Load connection path | Load wired between +V (BN) and OUT (BK) | Load wired between OUT (BK) and 0 V (BU) | Miswiring the load across the wrong rail prevents actuation or shorts the transistor |
| Ground-fault behavior on cable pinch | Signal wire shorted to 0 V chassis mimics an ON signal | Signal wire shorted to 0 V chassis blows fuse or trips short-circuit protection without false ON | PNP provides safer fault behavior on grounded metal machine frames |
| Regional automation prevalence | Common in Japanese, Korean, and legacy Asian OEM machinery | Dominant in European IEC panels and modern North American installations | Always check existing cabinet schematics before ordering spare sensors |
Choose PNP sourcing sensors for new 24 V DC control cabinets and European or North American panels where grounded-frame fault safety is preferred; choose NPN sinking sensors whenever retrofitting or expanding machinery built around fixed sourcing PLC input modules whose common rail is tied to +24 V DC.
Sinking vs Sourcing Logic in NPN and PNP PLC Digital Input Wiring
Sinking and sourcing describe conventional current flow direction (positive to negative) at a specific device terminal, which means a sinking sensor always pairs with a sourcing PLC input and a sourcing sensor always pairs with a sinking PLC input. Confusing sensor-side terminology with PLC-card terminology is the most common cause of non-responsive digital inputs during machine commissioning.
Inside a 3-wire DC NPN sensor, the output transistor sits between the black signal wire (collector) and the blue 0 V rail (emitter). When a target enters the sensing zone, the transistor saturates and completes a current path to 0 V, sinking current out of the PLC input terminal. Because current must enter the PLC input circuit from the +24 V rail, the PLC digital input common terminal (COM) must be wired to +24 V DC.
Inside a 3-wire DC PNP sensor, the output transistor sits between the brown +24 V rail (emitter) and the black signal wire (collector). When triggered, the transistor switches +24 V onto the black lead, sourcing current into the PLC input optocoupler. The PLC input common terminal (COM) is wired to 0 V DC so current returns cleanly to the power supply negative rail.

When wiring either output type to inductive loads such as miniature control relays or solenoid pilot coils, verify that the load current stays below the sensor’s rated maximum output current (commonly 200 mA on M18 barrels) and install a freewheeling diode across DC relay coils to suppress inductive kickback spikes.
IEC 60947-5-2 Wire Colors and M12 Pinouts for 3-Wire and 4-Wire Sensors
IEC 60947-5-2 standardizes conductor insulation colors and A-coded M12 connector pin assignments across DC proximity and photoelectric sensors so technicians wire power and signal leads identically regardless of whether the output transistor is NPN or PNP. Only the load termination at the PLC or relay changes between sinking and sourcing circuits.
| M12 Pin | IEC 60947-5-2 Color (Code) | 3-Wire DC Function | 4-Wire DC Complementary Function | Wiring Verification Check |
|---|---|---|---|---|
| Pin 1 | Brown (BN) | +10–30 V DC supply (+V) | +10–30 V DC supply (+V) | Confirm regulated DC supply polarity before energization |
| Pin 2 | White (WH) | Not used on standard 3-wire | Normally closed (NC) or teach/control input | Isolate unused white lead to prevent stray contact with chassis |
| Pin 3 | Blue (BU) | 0 V DC common (-V) | 0 V DC common (-V) | Tie to the same 0 V reference shared by the PLC I/O power supply |
| Pin 4 | Black (BK) | Switched output (NO or NC per SKU) | Normally open (NO) primary output | Route directly to PLC digital input channel or relay coil |
Follow the IEC 60947-5-2 brown (+V), blue (0 V), and black (OUT) convention on all standard 3-wire installations, and verify the specific sensor wiring label before connecting Pin 2 (white) on 4-wire models because some photoelectric sensors assign Pin 2 to a Light-ON/Dark-ON mode select or teach input rather than a complementary NC output.

Normally Open (NO) vs Normally Closed (NC) Logic Across NPN and PNP Outputs
NPN versus PNP defines electrical output polarity (sinking to 0 V versus sourcing +24 V), whereas normally open (NO) versus normally closed (NC) defines switching state behavior when a target is absent or present. Because polarity and switching logic are completely independent attributes, industrial sensors are manufactured in four distinct output combinations.
| Output Configuration | Target Absent (Idle State) | Target Present (Triggered State) | Typical Automation Use Case |
|---|---|---|---|
| NPN NO | Output floating (high impedance) | Output conducts to 0 V (sinks current) | Part counting and presence detection on sourcing PLC inputs |
| NPN NC | Output conducts to 0 V (sinks current) | Output floating (opens circuit) | Wire-break monitoring and end-of-travel overtravel limits on sourcing inputs |
| PNP NO | Output floating (0 V through PLC load) | Output conducts +24 V (sources current) | Standard part detection on European/North American sinking PLC inputs |
| PNP NC | Output conducts +24 V (sources current) | Output floating (drops to 0 V) | Fail-safe wire-break detection for non-safety process interlocks and bin-empty alarms |
Select an NO output when the PLC expects a true signal only upon target arrival; select an NC output (or a 4-wire NO+NC complementary sensor) whenever detecting a broken sensor cable or lost 24 V supply as an immediate fault condition improves machine uptime.
IEC 61131-2 PLC Input Compatibility and 2-Wire Leakage Boundaries
IEC 61131-2 defines three 24 V DC digital input categories—Type 1, Type 2, and Type 3—with guaranteed OFF-state and ON-state voltage and current thresholds that determine whether a PLC card reliably reads a 3-wire NPN/PNP transistor output or a 2-wire DC sensor. Checking these thresholds prevents sluggish switching, stuck-ON inputs, and erratic counts on long cable runs.
| IEC 61131-2 Input Type | Guaranteed OFF Voltage | Guaranteed ON Voltage | Max OFF Current (Leakage Limit) | Min ON Current | Primary Field Device Match |
|---|---|---|---|---|---|
| Type 1 | -3 V to +5 V (transition up to +15 V) | +15 V to +30 V | ≤ 1.5 mA | ≥ 2.0 mA | Mechanical contacts, pushbuttons, relay outputs, 3-wire NPN/PNP |
| Type 2 | -3 V to +5 V (transition up to +11 V) | +11 V to +30 V | ≤ 1.5 mA | ≥ 6.0 mA | Legacy high-current 2-wire proximity switches and 3-wire NPN/PNP |
| Type 3 | -3 V to +5 V (transition up to +11 V) | +11 V to +30 V | ≤ 1.5 mA | ≥ 2.0 mA | Modern high-density PLC modules with 3-wire NPN/PNP and low-leakage 2-wire sensors |
Use 3-wire NPN or PNP sensors with any IEC 61131-2 Type 1, Type 2, or Type 3 PLC input card of matching polarity because 3-wire outputs exhibit minimal off-state leakage and low saturation voltage drop; switch away from 2-wire DC sensors (or add a parallel bleeder resistor) whenever a 2-wire sensor’s off-state leakage approaches 1.5 mA or its 3–6 V ON-state voltage drop pushes a Type 1 input below +15 V.
Machine Safety Boundary: Standard NPN and PNP inductive, capacitive, photoelectric, magnetic, and ultrasonic sensors are process-automation detection devices—not safety-rated personnel-protection devices. They lack the redundant, self-checking OSSD (Output Signal Switching Device) architecture required by ISO 13849-1 or IEC 61496 for machine guarding, light curtains, or emergency-stop safety circuits.
How to Test an Unlabeled NPN or PNP Sensor With a Multimeter
An unlabeled 3-wire DC proximity or photoelectric sensor can be identified safely on a 24 V DC test bench in under two minutes using a digital multimeter set to DC volts without connecting a PLC card or risking a short circuit. Power the sensor cleanly across its brown (+24 V) and blue (0 V) leads first, then measure the black output wire against both power rails with a target present and absent.
- Verify supply wiring: Connect brown (Pin 1) to +24 V DC and blue (Pin 3) to 0 V DC from a current-limited bench power supply, leaving the black output wire disconnected and insulated.
- Confirm sensor power: Present a valid target (mild steel for inductive, hand or white card for diffuse photoelectric) and confirm the sensor’s built-in LED indicator toggles cleanly.
- Measure OUT to 0 V (PNP check): Set the multimeter to DC volts (V DC), place the red probe on black (OUT) and the black probe on blue (0 V), and record readings with the target absent and present.
- Measure +24 V to OUT (NPN check): Move the red probe to brown (+24 V) and the black probe to black (OUT), and record readings with the target absent and present.
| Measured Test Pair | Reading When Triggered (NO Sensor) | Reading When Idle (NO Sensor) | Confirmed Sensor Output Type |
|---|---|---|---|
| Black (OUT) to Blue (0 V) | ~22–24 V DC (supply minus Vce drop) | ~0 V DC (or floating low) | PNP sourcing output |
| Brown (+24 V) to Black (OUT) | ~22–24 V DC (supply minus Vce drop) | ~0 V DC (or floating low) | NPN sinking output |
| Both pairs read < 2 V in both states | No voltage swing despite LED toggling | No voltage swing | Damaged output transistor (open circuit) or wrong power rail |
Confirm a PNP output when OUT-to-0 V jumps near +24 V upon activation, and confirm an NPN output when +24 V-to-OUT jumps near +24 V upon activation; if the voltage behaves oppositely (high when idle and ~0 V when triggered), the sensor is a normally closed (NC) version of that same polarity.

Note that some high-impedance digital multimeters can display floating ghost voltages (2–10 V) when an open-collector output is OFF. Adding a temporary 2.2 kΩ to 10 kΩ pull-down resistor (OUT to 0 V for PNP) or pull-up resistor (+24 V to OUT for NPN) eliminates floating readings during bench verification.
Converting or Mixing NPN and PNP Sensors on an Existing PLC
Mixing NPN and PNP sensors on a single fixed-polarity PLC input group is electrically impossible because every channel sharing that common terminal requires the same current direction, yet three reliable engineering workarounds let you integrate a mismatched sensor without replacing the entire control rack. Selecting the right conversion method depends primarily on required switching speed and channel count.
| Conversion Method | Maximum Practical Speed | Electrical Isolation | Best Field Use Case | Key Limitation |
|---|---|---|---|---|
| Slimline 24 V DC interposing relay | Slow (typically ≤ 5–10 Hz mechanical) | Full galvanic isolation | Emergency spare swap on slow cylinder stops or conveyor presence checks | Mechanical contact wear; unsuitable for high-speed bottle or gear counting |
| Solid-state NPN/PNP optocoupler converter | Fast (kHz range per module datasheet) | Optical isolation | High-speed encoders, packaging counters, and permanent machine retrofits | Adds panel DIN-rail width and per-channel component cost |
| Dedicated bidirectional PLC input bank | Full PLC input card scan speed | Per-group common isolation | Multi-sensor retrofits where PLC offers separate isolated COM groups | Requires an unused isolated input group on the PLC module |
Use a slimline 24 V DC interposing relay only for low-frequency presence checks below a few cycles per second; switch to a solid-state DIN-rail signal converter or a separate isolated PLC input group whenever the sensor feeds high-speed counting, conveyor indexing, or rapid cycle machinery.
Specifying NPN or PNP Output Codes Across HERED Industrial Sensor Families
Ordering the correct transistor polarity on the first purchase order eliminates cabinet rewiring and avoids stocking unnecessary signal converters. Across HERED Electric’s industrial sensor lines, identical mechanical barrels and sensing distances are manufactured in matched NPN and PNP part numbers so machine builders can standardize a single mounting bracket for both Asian and European panels.
- Inductive Proximity Sensors: In HERED Electric’s inductive proximity sensors catalogue, the M18 non-flush LR18-08N1 (DC 3-wire NPN NO) and LR18-08P1 (DC 3-wire PNP NO) share identical 10–30 V DC supply, 8 mm ± 10% nominal sensing distance, 200 mA load current, 500 Hz switching frequency, IP67 protection, and -20°C to +70°C temperature specifications—differing solely in output polarity.
- Photoelectric Sensors: Across HERED Electric’s photoelectric sensors range, cylindrical diffuse-reflective models such as the E3F-18S3MN1 (DC 3-wire NPN NO, 10–30 V DC, 600 Hz) and its PNP counterpart E3F-18S3MP1 allow direct electrical drop-in matching to either sourcing or sinking PLC cards.
- Capacitive Proximity Sensors: For non-metallic liquid, powder, and plastic detection, HERED Electric’s capacitive proximity sensors similarly offer M12, M18, and M30 cylindrical housings in DC 3-wire NPN and PNP output configurations.
When submitting a sensor bill of materials or requesting OEM equivalents through HERED Electric, specify five core electrical fields alongside your mechanical housing: supply voltage (e.g., 10–30 V DC), wire count (3-wire or 4-wire), output polarity (NPN or PNP), switching logic (NO, NC, or NO+NC), and termination style (pre-wired PVC cable or M12 connector).
Frequently Asked Questions
Can connecting an NPN sensor to a PNP PLC input damage the PLC?
Connecting an NPN sensor to a sinking (PNP-type) PLC input normally does not damage the PLC optocoupler, because both the PLC common terminal and the NPN transistor pull toward 0 V, creating zero voltage differential across the input channel. The input simply remains permanently OFF until the sensor polarity or PLC COM wiring is corrected.
Why is PNP preferred over NPN in European IEC control panels?
PNP sourcing sensors are standard in European IEC panels because a pinched signal wire shorting to a grounded 0 V metal machine frame draws fault current from the sensor’s short-circuit protection rather than pulling the PLC input active. On an NPN sinking circuit, that same cable-to-frame ground fault pulls the signal wire to 0 V and mimics a valid sensor trigger.
Do NPN and PNP sensors have different sensing distances or switching speeds?
NPN and PNP variants within the same sensor series share identical sensing coils, optical emitters, sensing distances, and rated switching frequencies. For example, HERED Electric’s LR18-08N1 (NPN) and LR18-08P1 (PNP) inductive sensors both rate 8 mm ± 10% nominal sensing distance and 500 Hz switching frequency; only the output transistor polarity differs.
References
- International Electrotechnical Commission (IEC), IEC 60947-5-2:2019 — Low-voltage switchgear and controlgear – Part 5-2: Control circuit devices and switching elements – Proximity switches, 4th edition — standard scope, DC 3-wire/4-wire color coding, and M12 pin assignments (IEC Webstore portal).
- International Electrotechnical Commission (IEC), IEC 61131-2:2017 — Industrial-process measurement and control – Programmable controllers – Part 2: Equipment requirements and tests, 4th edition — 24 V DC Type 1, Type 2, and Type 3 digital input voltage and current threshold framework (IEC Webstore portal).
- HERED Electric, LR18-08N1 Inductive Proximity Sensor and LR18-08P1 Inductive Proximity Sensor — HERED Electric first-party product specifications (M18 non-flush, 10–30 V DC, 8 mm ± 10%, 200 mA, 500 Hz, IP67, DC 3-wire NPN NO / PNP NO).
- HERED Electric, E3F-18S3MN1 Diffuse-Reflective Photoelectric Sensor and E3F-18S3MP1 Diffuse-Reflective Photoelectric Sensor — HERED Electric first-party product specifications (M18 cylindrical, 10–30 V DC, 600 Hz, DC 3-wire NPN NO / PNP NO).
Explore our 1,152+ catalogued inductive, photoelectric, capacitive, and magnetic proximity sensors or request factory cross-reference support.
DIRECT FACTORY RFQ
Need sensor pricing, samples, or OEM cross-reference?
Share your target material, sensing distance, NPN/PNP output, or model code. Our engineering team replies within 24 hours.