🔌

Digital Sensors — NPN & PNP

CHAPTER 02 // ELECTRICAL FUNDAMENTALS // FIELD MANUAL

CH-02.4
Overview
⚡ Live Demo
PLC Matching
Wiring
🔧 Troubleshoot
Applications
📋 Quiz
What Are Digital Sensors?
OUTPUT TYPE // CURRENT SWITCHING // 24VDC INDUSTRIAL LOGIC
Core concept: A digital sensor has ONE job — detect something (metal, light, pressure, position) and switch a signal ON or OFF to the PLC. The difference between NPN and PNP is which direction current flows when that switch closes.
NPN — Sinking Sensor

When the sensor detects its target, it pulls the output to 0V (GND).

▶ PLC (+24V) → PLC Input → Sensor → 0V GND
N = Negative (GND) NPN pulls signal DOWN to ground → "sinking" the current

PLC supplies the voltage. Sensor completes path to ground.

PNP — Sourcing Sensor

When the sensor detects its target, it pushes +24V to the PLC input.

▶ Sensor (+24V) → PLC Input → 0V GND
P = Positive (+24V) PNP pushes signal UP to +24V → "sourcing" the voltage

Sensor supplies the voltage. PLC provides the path to ground.

⚡ The 3-Wire Standard

Most industrial digital sensors use 3 wires:

Wire Color Function Connect To
■ BROWN Supply power +24VDC
■ BLUE Common / Return 0V / GND
■ BLACK Signal output PLC input terminal
⚠ Wire color warning: Asian-manufactured sensors sometimes use Brown=+V, Blue=0V, Black=Output — but some deviate. Always verify with the datasheet. Never assume. Wrong polarity = dead sensor.
🧠 Key Difference — One Line
NPN SINKING
Output = switch to GND
Current flows INTO sensor
PLC input sees LOW when active
PNP SOURCING
Output = switch to +24V
Current flows OUT of sensor
PLC input sees HIGH when active
💡 SINK / SOURCE TRICK "NPN Needs the return path (sinks to GND)"  |  "PNP Provides Power (sources +24V)"
Live Circuit Demo
CLICK THE SENSOR — WATCH CURRENT FLOW IN REAL TIME
Select Sensor Type
PLC INPUT CARD +24V IN 0V I/O NPN SENSOR PROXIMITY DETECT BRN BLK BLU → No current flow (sensor OFF) PULL-↑ STATUS: OFF
TYPE: NPN / SINKING
ACTIVE STATE: LOW (0V)
CURRENT: INTO SENSOR
PLC INPUT TYPE: SOURCING
🔬 What's Happening Inside

NPN OFF: Internal NPN transistor is cut off. No path to GND. The PLC input floats high via internal pull-up. PLC reads logic 0.


When you activate the sensor, the transistor saturates, pulling the output pin to GND. Current flows from PLC +24V through input → signal wire → sensor output → transistor → GND.

📐 Logic Level Summary
StateNPN OutputPNP Output
No targetHIGH (open)LOW (open)
Target detectedLOW → GNDHIGH → +24V
PLC reads0 → 11 → 0 (inverted)
Sensor ↔ PLC Matching
CRITICAL — MISMATCH = NO SIGNAL // ALWAYS VERIFY BEFORE WIRING
✅ Correct Pairings
Sensor Type PLC Input Type Why It Works Status
NPN Sinking sensor SOURCING input PLC supplies +24V, sensor sinks to GND — complete circuit ✔ MATCH
PNP Sourcing sensor SINKING input Sensor supplies +24V, PLC sinks to GND — complete circuit ✔ MATCH
❌ Mismatches (No Signal)
Sensor PLC Input What Happens Status
NPN Sinking SINKING input Both trying to pull to GND — no voltage source for input ✘ FAIL
PNP Sourcing SOURCING input Both trying to source +24V — no path to GND ✘ FAIL
🔄 Pull-Up / Pull-Down (Inside PLC)

PLC inputs have internal resistors to guarantee a defined OFF state:

Input TypeInternal ResistorOFF State
SOURCING (for NPN)Pull-UP to +24VReads HIGH
SINKING (for PNP)Pull-DOWN to 0VReads LOW
Without pull-up/pull-down, disconnected inputs float — creating random ON/OFF signals. The internal resistor eliminates this.
🔑 Universal / Combo Inputs

Modern PLCs often have universal inputs that accept both NPN and PNP — configured by:

  • DIP switch on the card
  • Software configuration in PLC IDE
  • External jumper/terminal config
⚠ Always check the PLC datasheet before assuming universal input. Older cards are often NPN-only or PNP-only.
🧮 Quick Match Reference
Sensor Marking Also Called Output Action PLC Input Needed Common In
NPN Sinking, Current sink, NC output low Pulls output to 0V Sourcing (pull-up) Japan / Asian mfg
PNP Sourcing, Current source, NC output high Pushes +24V to output Sinking (pull-down) European / NA mfg
Wiring Reference
3-WIRE INDUSTRIAL STANDARD // VERIFY WITH DATASHEET BEFORE WIRING
⬇ NPN — Wiring Steps
  1. Brown → +24VDC (sensor power supply)
  2. Blue → 0V/GND (sensor common)
  3. Black → PLC input terminal
  4. PLC input card must be SOURCING type
  5. Verify: no pull-down on this input (or disable it)
Test: With sensor NOT seeing target, PLC input = HIGH (1). Sensor activated = LOW (0) → logic "1" in PLC ladder if using N/O contact.
⬆ PNP — Wiring Steps
  1. Brown → +24VDC (sensor power supply)
  2. Blue → 0V/GND (sensor common)
  3. Black → PLC input terminal
  4. PLC input card must be SINKING type
  5. Verify: no pull-up on this input (or disable it)
Test: With sensor NOT seeing target, PLC input = LOW (0). Sensor activated = HIGH (+24V) → logic "1" in PLC ladder directly.
⚠ Common Wiring Mistakes
#MistakeSymptomFix
1 Reversed polarity (Brown/Blue swapped) Sensor gets hot, no output, may blow internal protection Check polarity, replace sensor if damaged
2 Black wire to wrong PLC type No signal even when target present Verify sensor type vs PLC input type
3 Sensor 0V not connected to PLC 0V Intermittent or no signal All 0V commons must share same reference
4 Long cable run without shielding False triggers, noise on input Use shielded cable, tie shield to earth at ONE end
5 4-wire sensor, 3-wire application Extra wire hanging — which do you use? 4th wire = N/C output — leave disconnected or cap it
📏 4-Wire Sensors (N/O + N/C)

Some sensors have 4 wires — both N/O and N/C outputs:

WireFunction
Brown+24V supply
Blue0V common
BlackN/O output (active when target present)
■ WHITEN/C output (active when no target)
Connect only ONE output wire to PLC. Cap or insulate the other. Both wires live — touching them together = short circuit inside sensor.
Troubleshooting Guide
SYSTEMATIC FAULT ISOLATION // FIELD-PROVEN STEPS
🔧 Rule of thumb: Work from the PLC backward to the sensor. If the PLC input light is on — the input circuit is working. If it's off — start at the sensor and move in. Use a multimeter or loop calibrator on the signal wire.
🔴 Sensor LED ON but PLC input not registering
Sensor is detecting target, but signal not reaching PLC.
  • Sensor LED = sensor is working internally — problem is in the output circuit
  • Measure Black wire to 0V with DVM: NPN should read near 0V when active; PNP should read near +24V
  • Check sensor type matches PLC input type (NPN vs PNP mismatch)
  • Verify Black wire continuity end-to-end (wire break between sensor and PLC terminal)
  • Check PLC input terminal: corrosion, loose screw, blown input fuse on the card
  • If all ok — check PLC tag is mapped to correct physical input channel
🟡 PLC input always ON (never turns OFF)
Input is stuck high — likely wiring or logic issue.
  • Disconnect Black wire at sensor — does PLC input turn OFF? If yes → sensor output is shorted internally → replace sensor
  • Disconnect Black wire at PLC terminal — if still ON → PLC input channel is faulty (rare) or short somewhere in the run
  • Check for NPN sensor wired to sinking input — both fighting for 0V can cause false ON in some configurations
  • Check for wire-to-wire short in conduit (Black touching +24V rail)
  • Verify NO contact vs NC contact logic in PLC program — sensor may be working correctly but programmed inverted
⚡ Sensor gets hot / smokes immediately on power-up
STOP. Polarity or voltage problem.
  • Power off immediately
  • Verify Brown = +24V and Blue = 0V — polarity reversal kills sensors fast
  • Check supply voltage: should be 10–30VDC for most sensors; 24VAC will kill a DC sensor
  • Verify cable is correct (not accidentally wired to 120VAC circuit)
  • Check for short circuit on output wire before replacing sensor
🟠 Intermittent / chattering signal
Random false triggers are almost always noise or mechanical.
  • Check sensing distance: sensor may be at edge of range — adjust mounting position
  • Check for vibration moving the target in/out of range
  • Check cable routing: signal wire running parallel to motor power cables = induced EMI noise
  • Use shielded cable, separate signal cables from power cables by at least 6"
  • Check for loose terminal at sensor or PLC
  • Verify supply voltage is stable — measure it under load
  • If using long cable run (>30m), check for capacitance effects slowing switching
🔵 New sensor installed — nothing works
Start-up checklist for new sensor.
  • Verify sensor voltage rating matches supply (most industrial = 10–30VDC)
  • Confirm NPN or PNP matches PLC input type
  • Confirm N/O or N/C matches expected logic (some sensors labeled backwards by region)
  • Check sensing distance spec — is target within range?
  • For inductive prox: target must be ferrous metal (steel) unless specified for aluminum/non-ferrous
  • For capacitive: sensing distance changes with material dielectric constant — may need adjustment
  • Apply power — sensor LED should flash briefly then be OFF (no target). Move a steel object near it — LED should turn ON
📏 What voltages should I measure? (Quick DVM Reference)
Test PointSensor OFFSensor ON (NPN)Sensor ON (PNP)
Brown wire to 0V~24V~24V~24V
Blue wire to 0V0V0V0V
Black wire to 0V~24V (float)~0V~24V
Black wire to 24V~0V (float)~24V~0V
Actual readings may be 0.3–2V off due to transistor saturation voltage. A reading of 1.5V instead of 0V is still "logic low" for the PLC. Anything above 10V on an input that should be LOW = problem.
Common Applications
SENSOR TYPES // INDUSTRIAL USE CASES // YOUR PLANT EXAMPLES
🔩
Inductive Proximity
Detects metal targets. No contact. Immune to dirt, liquid. Most common in manufacturing. Range: 1–20mm.
NPN PNP
📦
Capacitive
Detects any material (plastic, liquid, powder). Used for level detection, bag-on-conveyor, fill level sensing.
NPN PNP
💡
Photoelectric
Uses light beam (laser/LED). Through-beam, retro-reflective, or diffuse. Long range up to 100m.
NPN PNP
🔄
Limit Switches
Mechanical contact. Your Westlock position indicators use dry contact outputs — wire through relay or digital input module.
CONTACT
🧲
Reed Switch
Magnetic activation. Used in cylinder end-of-stroke detection, door/hatch position. Built into pneumatic cylinders.
CONTACT
💧
Level Float Switch
Simple ON/OFF for tank levels. Can be NPN/PNP with electronic output or dry contact float mechanism.
NPN FLOAT
🔥
Flow Switch
Paddle or thermal type. Detects flow/no-flow condition. Used for pump protection, coolant circuits.
PNP CONTACT
🌡
Pressure Switch
Mechanical or electronic. Switches at set point. Your crystallizer pneumatic supply monitoring uses these.
SETPOINT
🏭 Your Plant — Crystallizer Context
LocationSensor TypeOutput TypeWired To
Westlock 2007 OPEN position Mechanical limit switch (internal) Dry contact (NO) PLC DI-201 (Terminal 2-3)
Westlock 2007 CLOSED position Mechanical limit switch (internal) Dry contact (NO) PLC DI-202 (Terminal 5-6)
Fill valve solenoid feedback N/A — output device 120VAC coil PLC DO-101 via relay
Note: Westlock dry contacts are polarity-independent — they are just mechanical switches, not transistor outputs. No NPN/PNP concern. Westlock terminal 1 = +24VDC common.
Knowledge Check
TAP AN ANSWER — INSTANT FEEDBACK
SCORE
0 / 0