1. Descripción general y principio de funcionamiento
A 3-wire NPN (sinking / open-collector) sensor switches its Black output terminal down to 0 V (Blue) via an internal low-side NPN transistor. It is widely used in Asian machinery, Mitsubishi/Omron sourcing-DI PLC panels, and 5 V / 3.3 V microcontroller interfaces.
Because the collector is left open (unconnected to +Vcc inside the sensor), an NPN output CANNOT source voltage by itself. The load or pull-up resistor must be wired between +Vcc and the Black wire so current flows from +Vcc → Load → INTO the sensor → 0 V.
Triggered (Active Low / Sinking): The internal NPN transistor saturates (Vce_sat ≈ 0.2–0.8 V). Full load voltage (Vcc − Vce_sat) appears across the pull-up load or PLC sourcing optocoupler, turning it ON while the Black terminal sits near 0 V.
Standby (OFF / Pulled High): The NPN transistor cuts off. With a pull-up load present, no current flows across the load, so the Black wire rises cleanly to +Vcc (no voltage drop across load → PLC input is OFF).
Open-collector superpower (easy level shifting!): Because the NPN collector only pulls to 0 V, you can power the sensor from 12–24 V while pulling its Black output up to 3.3 V or 5 V through a 4.7 kΩ resistor — letting a 24 V industrial sensor talk directly to an MCU sharing 0 V ground (verify datasheet has no internal pull-up to 24 V!).

2. Step-by-step: Wiring an NPN sensor to a PLC or Microcontroller
1Connect PLC DI common (COM / S/S) to +24 V DC (Sourcing DI)
For an NPN sensor, the PLC digital input common terminal MUST connect to +24 V DC so the input card supplies current out of the channel terminal into the sensor Black wire.
2Add a pull-up resistor if bench-testing or wiring to an MCU
When testing an NPN sensor on a bench without a PLC, connect a 2.2 kΩ–10 kΩ pull-up resistor between Brown (+Vcc) and Black. Without it, Black floats in OFF state and multimeter readings will confuse you.
3Check sinking current & resistor wattage rating
Calculate I_L = (Vcc − Vce_sat) / R_L and verify I_L ≤ sensor Imax (typically 100–200 mA) and resistor power P = I_L²·R_L stays well below half its wattage rating (e.g. < 125 mW for a 1/4 W resistor).
4Inspect cable routing to prevent frame-ground false triggers
Route Black output cables away from sharp metal edges and moving pinch points: any unintended short from Black to 0 V chassis will immediately energize the load as a false ON signal.
3. Diagnóstico en campo y pruebas con multímetro
| Síntoma | Causa raíz | Prueba con multímetro | Solución |
|---|---|---|---|
| Multimeter reads ~0 V on Black both WITH and WITHOUT target | Missing pull-up resistor / open-collector floating output | Connect a temporary 4.7 kΩ resistor from +Vcc to Black and re-measure | Keep pull-up resistor or wire into PLC sourcing DI (COM = +24 V) |
| PLC input stays permanently ON even with sensor unplugged | Black signal wire pinched/shorted to grounded machine chassis (0 V) | Measure continuity from disconnected Black wire to 0 V / frame ground | Replace damaged cordset; consider migrating critical interlocks to PNP or NAMUR |
4. Preguntas frecuentes (FAQ)
Why is an NPN sensor called a "sinking" output?
In conventional current flow (+ to −), when the NPN sensor turns ON, load current flows FROM +Vcc, through the load, and INTO the sensor Black wire toward 0 V — the sensor acts as a current sink.
What pull-up resistor value should I use with an NPN sensor?
For 24 V logic, 2.2 kΩ to 4.7 kΩ (0.5 W) draws 5–11 mA with strong noise immunity. For 3.3 V / 5 V MCU inputs, 4.7 kΩ to 10 kΩ (0.25 W) is ideal unless high-speed encoder pulses (>20 kHz) require 1–2.2 kΩ.
Can I wire an NPN sensor directly to a 24 V Sinking PLC input?
Not directly — both the sensor and PLC try to connect to 0 V so no current flows. Use a 2.2 kΩ pull-up resistor to +24 V (inverts logic: target = PLC LOW) or an interposing relay / signal converter.
Does an NPN sensor have a built-in pull-up resistor?
Many industrial M12 sensors include a weak internal pull-up (typically 10 kΩ to +Vcc) so bench meters see Vcc when OFF, while true open-collector encoders have none. Always check the datasheet before wiring to a 3.3 V MCU!
Can two NPN sensors be wired in parallel for wired-OR?
Yes! Tying multiple open-collector NPN outputs to one shared pull-up resistor creates natural wired-OR (active-low): any triggered sensor pulls the shared line to 0 V without fighting the others.
Why do I need a flyback diode when an NPN sensor drives a relay?
When the NPN transistor turns OFF abruptly, the relay coil inductance generates a high-voltage inductive kickback (+60 V to +200 V) that can punch through the sensor output transistor. An anti-parallel 1N4007 across the coil clamps the spike safely.
5. Calculadoras relacionadas, guías y otros circuitos
- Calculadora de caída de tensión de alimentación del sensor
- Calculadora de salida de pulsos
- NAMUR vs PNP vs NPN: salidas discretas, cableado y CSV
- Circuito de Salida PNP 3 Hilos (Sourcing) — Simulador
- Circuito NAMUR 2 Hilos Seguridad Intrínseca (IEC 60947-5-6)
- Salida Push-Pull (HTL/TTL) y Drenaje Abierto — Simulador
- Aislamiento por Optoacoplador y Relé con Diodo Flyback
- Protección Entrada 24 V para Sensores (PMOS, TVS y PTC)
- Contacto Seco: Antirrebote Hardware RC y Corriente de Humectación
- Lazo de Corriente 4–20 mA 2 Hilos y Receptor Protegido
- Transmisor Analógico Activo 3 Hilos vs 4 Hilos (0–10 V)
- Transmisor Voltaje a 4–20 mA (Op-Amp + Transistor)
- Divisor de Tensión NTC + Buffer Op-Amp y Filtro RC