Buying guide
PNP vs NPN Proximity Sensors: Wiring, Differences and How to Choose
Ordering a replacement sensor with the wrong output type is a very common reason a “working” sensor does nothing once it’s installed. Here’s how PNP and NPN outputs differ, how to tell which one your machine uses, and how to choose the right sensing technology.
PNP vs NPN in one sentence
A PNP (sourcing) sensor switches +24 V to its output wire when it detects a target; an NPN (sinking) sensor switches its output wire to 0 V. Both do the same job — the difference is which side of the supply they switch, and it must match the input card.
| PNP (sourcing) | NPN (sinking) | |
|---|---|---|
| Output when ON | Connects output to +V (e.g. +24 V DC) | Connects output to 0 V |
| Load connected between | Output and 0 V | Output and +V |
| Matching PLC input | Sinking input card | Sourcing input card |
| Common on | European-style machines and panels | Many Japanese, Korean and Chinese machines |
3-wire sensor colour code
- Brown – supply positive (typically 10–30 V DC)
- Blue – supply negative (0 V)
- Black – switching output (normally open)
- White – second output, often normally closed (4-wire sensors)
Matching the sensor to your PLC
A sinking PLC input expects current to flow into it, so it needs a PNP sensor. A sourcing input needs an NPN sensor. Many PLCs (including popular Siemens, Delta and Mitsubishi models) let you choose by wiring the input common to 0 V or +24 V — check the input wiring diagram before ordering. Browse controllers & PLCs.
NO vs NC outputs
Normally open (NO) outputs switch ON when a target is present — the usual choice for counting and position detection. Normally closed (NC) outputs are ON until a target appears, then switch OFF. Because a cut cable also reads as OFF, NC outputs are often chosen where a wire break should be treated as an alarm. (They are not a substitute for certified safety devices.)
Inductive, capacitive or photoelectric?
| Type | Detects | Typical range | Use it for |
|---|---|---|---|
| Inductive | Metal only | 1–40 mm | Gear teeth, metal flags, cylinder end positions, conveyors |
| Capacitive | Almost anything (plastic, grain, liquids through tank walls) | 1–25 mm | Level detection in hoppers and tanks, non-metal parts |
| Photoelectric – diffuse | Objects that reflect light | up to ~1 m | Box detection on conveyors |
| Photoelectric – retro-reflective | Anything breaking the beam to a reflector | up to several m | Doors, conveyors, packaging lines |
| Photoelectric – through-beam | Anything between emitter and receiver | up to tens of m | Long distances, dusty environments, high reliability |
For inductive sensors, remember that the rated sensing distance is for mild steel; stainless steel, aluminium and brass reduce it noticeably. Flush (shielded) sensors can be mounted level with metal but have shorter range; non-flush (unshielded) sensors reach further but need clear space around the face.
Selection checklist
- Output type: PNP or NPN to match the input card.
- Output function: NO, NC or both.
- Technology: inductive, capacitive or photoelectric for your target material.
- Body size and thread: M8, M12, M18 or M30 — larger bodies sense further.
- Supply: 10–30 V DC is standard; 2-wire AC/DC types exist for retrofits.
- Connection: pre-wired cable or M12 connector (easier replacement).
- Protection: IP67 or better for wash-down and dusty plants.
Shop sensors from Omron, Pepperl+Fuchs and Fotek, or WhatsApp us a photo of the old sensor’s label and we’ll find the equivalent.
Frequently Asked Questions
Can I use an NPN sensor instead of a PNP sensor?
Not directly. The input card must be rewired (if it supports both) or you need an interface relay. It is usually simpler to order the matching output type.
Which is better, PNP or NPN?
Neither is better electrically. PNP is the usual choice on European-style panels; NPN is common on Japanese, Korean and many Chinese machines. Match whatever your PLC input card expects.
What do the brown, blue and black wires mean on a sensor?
Brown is +V (usually 24 V DC), blue is 0 V and black is the switching output. A white wire, if present, is a second output.
Why does my inductive sensor not detect aluminium?
Non-ferrous metals reduce the sensing distance to roughly 30–50% of the rated value. Move the sensor closer, use a larger body size, or choose a sensor rated for non-ferrous targets.