| 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:
NPN Type: PNP Type:
+Vcc +Vcc
| |
[Load] [Load]
| |
OUT←─┤ NPN OUT─→┤ PNP
│ │
GND GND
| 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 |
NPN to PLC (Sinking Input):
Sensor Brown(+Vcc) → +24V Sensor Blue(GND) → GND Sensor Black(OUT) → PLC Input PLC COM → +24V // Key difference
PNP to PLC (Sourcing Input):
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!
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)]
| 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 |
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
| State | NPN Output | PNP Output |
|---|---|---|
| ON | 0V (LOW) | +24V (HIGH) |
| OFF | High-Z (Floating) | High-Z (Floating) |
| Oscilloscope | Falling edge trigger | Rising edge trigger |
| Region | Mainstream Type | Example Equipment |
|---|---|---|
| Asia/Japan | NPN | Mitsubishi FX, Omron CP1E |
| Europe | PNP | Siemens S7-1200, Pepperl+Fuchs |
| North America | Mixed | AB CompactLogix |
Key Difference:
NPN: "Active LOW", current flows from load to sensor
PNP: "Active HIGH", current flows from sensor to load
Selection Mnemonic:
"Asian NPN, European PNP; Safety=NPN, Driving=PNP"
Compatibility Solution:
Use bidirectional optocouplers (e.g., TLP281-4) to support both types.