1. Présentation & principe de fonctionnement
A 3-wire PNP (sourcing) sensor is the default discrete sensor interface in European and North American factory automation. Its IEC 60947-5-2 color code is Brown (+Vcc, pin 1), Blue (0 V, pin 3), and Black (switched output, pin 4).
Internally, a PNP bipolar transistor or P-channel MOSFET connects the Black wire up to the +24 V rail whenever the target is detected. Because current flows OUT of the sensor into the load (PLC digital input or relay coil) and then to 0 V, the sensor "sources" current while the PLC input "sinks" it.
Standby (OFF): The internal oscillator/comparator holds the PNP base high, keeping the transistor cut off. Only the sensor quiescent supply current (~5–15 mA) flows from Brown to Blue. The PLC input resistor pulls the Black terminal cleanly to 0 V (Logic 0).
Triggered (ON): The PNP stage saturates with a small internal drop Vsat (typically 1.0–2.5 V including reverse-polarity protection diode). Terminal voltage at the PLC reaches Vcc − Vsat − I·Rwire (~22 V on a 24 V rail), well above the IEC 61131-2 Type 1/3 Logic 1 threshold (15 V, ≥ 2 mA).
Fail-safe behavior: If the Black signal wire breaks or gets pinched against a grounded metal frame (0 V), the PLC input drops to 0 V instead of generating a false "target present" signal. Short-circuit protected sensors automatically fold back current so the transistor survives.

2. Step-by-step: How to wire and commission a 3-wire PNP sensor
1Verify PLC input card polarity (Sinking / COM = 0 V)
Check the PLC DI wiring diagram before powering on. For PNP sensors, the PLC DI common terminal (M / COM / SS) MUST connect to 0 V DC so current sourced from the sensor can return to the power supply.
2Wire Brown (+24 V), Blue (0 V), and Black (PLC DI)
Connect Brown (Pin 1) to +24 V DC, Blue (Pin 3) to 0 V DC, and Black (Pin 4) directly to the PLC input terminal (e.g. I0.0). Keep inductive relay loads below the sensor Imax rating (typically 100–200 mA) and add a flyback diode across any relay coil.
3Verify supply & standby voltage with a multimeter
Power up and confirm the sensor Green power LED is ON. Measure DC voltage from Black to Blue with no target: it must read < 1 V (typically 0.0–0.2 V).
4Trigger target and verify IEC 61131-2 Logic 1 margin
Place a metal/optical target in range. Confirm the sensor Yellow LED and PLC channel LED both light up, and measure Black-to-Blue voltage ≥ 18 V (guaranteed > 15 V IEC 61131-2 threshold).
3. Dépannage terrain & mesures au multimètre
| Symptôme | Cause racine | Contrôle multimètre | Action corrective |
|---|---|---|---|
| Sensor yellow LED lights, PLC DI LED stays OFF | PLC COM wired to +24 V (Sourcing DI mismatch) or broken Black wire | Measure Black-to-Blue at sensor (22 V) vs at PLC terminal (0 V or 22 V) | Move PLC COM to 0 V (or add PNP-to-NPN converter/relay); repair cable |
| Yellow LED blinks rapidly and output voltage collapses | Output shorted to 0 V or load resistance too low (exceeds Imax) | Disconnect Black wire; if yellow LED becomes steady and reads ~22.5 V, fault is downstream | Clear short to chassis or drive heavy load via an interposing relay |
| Voltage at PLC drops below 15 V on long cable runs | Excessive cable resistance + low-resistance relay/lamp load | Measure Vcc at sensor Brown-Blue while ON | Upgrade cable cross-section (0.5–0.75 mm²) or raise PSU to 24.5–26 V |
4. Questions fréquentes (FAQ)
Does a PNP sensor connect to a Sinking or Sourcing PLC input?
A PNP (sourcing) sensor MUST connect to a Sinking PLC input (common terminal tied to 0 V DC). The sensor sources positive current out of its Black wire, and the PLC input sinks that current to 0 V.
Why does a PNP output measure ~22.5 V instead of 24.0 V when ON?
Internal semiconductor junctions — specifically the PNP output transistor Vce(sat) and series reverse-polarity protection diode — drop 1.0 to 2.5 V under load. This is completely normal per IEC 60947-5-2.
Can I connect two PNP NO sensors in parallel for OR logic?
Yes, most modern PNP sensors include reverse-blocking diodes so tying Black wires together performs wired-OR logic. Confirm the datasheet allows parallel connection to avoid reverse leakage back-feeding the inactive sensor.
Why is PNP preferred over NPN in safety-critical machinery?
Because industrial machine frames are bonded to 0 V DC ground. If a PNP Black wire chafes and shorts to the frame, the output collapses to 0 V (fail-safe). On an NPN sensor, a ground short mimics an active trigger and causes an unintended start!
Do I need an external pull-down resistor for a PNP sensor?
No for standard PLC inputs (which already have 2.2–4.7 kΩ internal input impedance to 0 V). Only add a 4.7–10 kΩ pull-down resistor if feeding a very high-impedance CMOS/MCU input (>1 MΩ) to drain microamp OFF-state leakage.
How do I interface a 24 V PNP sensor to a 3.3 V or 5 V microcontroller?
Never wire 24 V directly to an MCU pin. Use an optocoupler (e.g. PC817 with a 2.2–3.3 kΩ series input resistor) for full galvanic isolation, or a precision resistor divider (e.g. 68 kΩ / 10 kΩ) plus a 3.3 V Zener/Schottky clamp.
5. Calculateurs associés, guides et autres circuits
- Calculateur de chute de tension d’alimentation de capteur
- Calculateur de sortie impulsions
- NAMUR vs PNP vs NPN : sorties tout-ou-rien, câblage et CSV
- Sortie Capteur NPN 3 Fils (Sink / Collecteur Ouvert)
- Circuit NAMUR 2 Fils Sécurité Intrinsèque (IEC 60947-5-6)
- Sortie Push-Pull (HTL/TTL) & Drain Ouvert — Simulateur
- Isolation Optocoupleur & Relais avec Diode de Roue Libre
- Protection Entrée Alimentation 24 V (PMOS, TVS & Fusible PTC)
- Contact Sec : Anti-Rebond Matériel RC & Courant de Mouillage
- Boucle de Courant 4–20 mA 2 Fils & Récepteur Protégé
- Transmetteur Analogique Actif 3 Fils vs 4 Fils (0–10 V)
- Convertisseur Tension vers 4–20 mA (AOP + Transistor)
- Pont Diviseur NTC + Suiveur AOP & Filtre RC