Differences Between NPN and PNP in Digital Inputs

WELCOME TO OUR BLOG

We're sharing knowledge in the areas which fascinate us the most
click

Differences Between NPN and PNP in Digital Inputs

By ARMxy April 1st, 2025 1083 views

Differences Between NPN and PNP in Digital Inputs


1. Core Working Principle Comparison

Type Transistor Structure Current Flow Output Logic
NPN Negative-Positive-Negative Load → Sensor → GND (Sinking) Active LOW (0V when ON)
PNP Positive-Negative-Positive Power → Sensor → Load (Sourcing) Active HIGH (Vcc when ON)

Equivalent Circuit Diagram:

plaintext
复制
NPN Type:          PNP Type:
 +Vcc                +Vcc
  |                   |
 [Load]             [Load]
  |                   |
 OUT←─┤ NPN        OUT─→┤ PNP
      │                 │
      GND              GND

2. Electrical Characteristics

Parameter NPN Sensor PNP Sensor
Output Level ON: 0V; OFF: High-Z ON: +Vcc; OFF: High-Z
Wiring Sinking Input Sourcing Input
Noise Immunity Better against negative noise Better against positive noise
Voltage 12/24V DC (Industrial Std.) 12/24V DC

3. Industrial Wiring Standards

NPN to PLC (Sinking Input):

plaintext
复制
Sensor Brown(+Vcc) → +24V
Sensor Blue(GND) → GND
Sensor Black(OUT) → PLC Input
PLC COM → +24V  // Key difference

PNP to PLC (Sourcing Input):

plaintext
复制
Sensor Brown(+Vcc) → +24V
Sensor Blue(GND) → GND
Sensor Black(OUT) → PLC Input
PLC COM → GND   // Key difference

Warning: Incorrect wiring may cause PLC detection failure or short circuit!


4. Selection Guide

mermaid
复制
graph TD
    A[PLC Input Type?] -->|Sinking| B[Choose NPN]
    A -->|Sourcing| C[Choose PNP]
    B --> D{Need fail-safe LOW?}
    D -->|Yes| E[Prefer NPN (0V on fault)]
    D -->|No| F[Select by availability]
    C --> G{Need direct relay drive?}
    G -->|Yes| H[Prefer PNP (HIGH output)]

5. Typical Applications

Scenario Recommended Reason
Emergency Stop NPN Fail-safe 0V state
Direct Relay Drive PNP Simplifies drive circuit
Japanese PLCs NPN Default sinking input
European PLCs PNP Default sourcing input

6. Troubleshooting

Issue 1: NPN sensor not working with sourcing PLC

  • Cause: Incomplete current path

  • Fix: Add 1kΩ pull-up resistor between PLC input and +24V

Issue 2: PNP sensor keeps PLC input ON

  • Cause: COM terminal wrongly connected to +24V

  • Fix: Connect COM to GND

Issue 3: Noise-induced false triggers

  • Solution:

    • NPN: Add 100nF capacitor between signal and GND

    • PNP: Add 100nF capacitor between signal and +Vcc


7. Signal Waveforms

State NPN Output PNP Output
ON 0V (LOW) +24V (HIGH)
OFF High-Z (Floating) High-Z (Floating)
Oscilloscope Falling edge trigger Rising edge trigger

8. Regional Standards

Region Mainstream Type Example Equipment
Asia/Japan NPN Mitsubishi FX, Omron CP1E
Europe PNP Siemens S7-1200, Pepperl+Fuchs
North America Mixed AB CompactLogix

Conclusion

  1. Key Difference:

    • NPN: "Active LOW", current flows from load to sensor

    • PNP: "Active HIGH", current flows from sensor to load

  2. Selection Mnemonic:
    "Asian NPN, European PNP; Safety=NPN, Driving=PNP"

  3. Compatibility Solution:
    Use bidirectional optocouplers (e.g., TLP281-4) to support both types.

Key Factors Affecting Analog Signal Accuracy
Previous
Key Factors Affecting Analog Signal Accuracy
Read More
Types and Applications of PWM Output
Next
Types and Applications of PWM Output
Read More
We use Cookie to improve your online experience. By continuing browsing this website, we assume you agree our use of Cookie.