What PNP and NPN mean
Inside a 3-wire DC sensor (inductive, capacitive, photoelectric, fiber amplifier) the output is a transistor. The letters say which kind, and that decides which side of the supply the output switches.
- PNP (sourcing): when the sensor detects, the output wire goes to +24 V. The load sits between the output and 0 V.
- NPN (sinking): when the sensor detects, the output wire is pulled to 0 V. The load sits between +24 V and the output.
Europe has built machines almost entirely on PNP for decades, so most sensors you pull out of a European machine are PNP. NPN is common on Japanese and Asian equipment, and many Keyence amplifiers come in both versions.
The wire colours
For DC sensors with a cable or an M8/M12 connector, IEC 60947-5-2 fixes the colours and pins. They are the same for PNP and NPN; only the behaviour of the black wire changes.
| Wire | M12 / M8 pin | Function |
|---|---|---|
| Brown (BN) | 1 | +24 V supply |
| Blue (BU) | 3 | 0 V |
| Black (BK) | 4 | Switching output (or IO-Link C/Q) |
| White (WH) | 2 | Second output, if the sensor has one |
The Captron CAA-60-H18G4T-PO6 capacitive level probe on our shelf is a good example: its M8 plug has brown on pin 1, blue on pin 3 and black on pin 4, and nothing on pin 2.
How to wire a PNP sensor to a PLC input
- Brown to +24 V of the same supply that feeds the PLC input card.
- Blue to 0 V of that supply.
- Black to the input terminal.
The input card must be a sinking input (current flows from the sensor into the input and back to 0 V through the card's common). On most European PLCs this is the default and the card's common goes to 0 V.
How to wire an NPN sensor to a PLC input
Brown and blue go to +24 V and 0 V exactly as before. Black goes to the input, but the card must be a sourcing input, with its common tied to +24 V. Many Japanese PLCs and some European cards let you choose per group by wiring the common to +24 V or to 0 V. Check the card manual before you rewire a common, because it moves every input in that group.
If you must mix types on one input group, an interface relay or a small PNP/NPN converter module is cleaner than a resistor trick.
NO and NC
Normally open (NO, make) means the output switches on when the target is present. Normally closed (NC, break) means the output is on while nothing is there and drops out when the target arrives. NC is chosen where a broken wire must look like an alarm, for example a level probe that must never let a tank run dry unnoticed.
Some sensors fix the function in the type code, others let you set it:
- Captron spells it out: in CAA-60-H18G4T-PS6 the PS means PNP NO, and in our CAA-60-H18G4T-PO6 the PO means PNP NC.
- The Balluff BAE SA-OH-035-PP-S75G (order code BAE00NF) is an amplifier for optical sensor heads with a PNP output you can set to NO or NC, plus a separate PNP error output, on an M8 4-pin plug.
- Sensors with a white wire often give both at once (antivalent outputs): black NO, white NC.
How to tell PNP from NPN on a label
Start with the printed wiring symbol. PNP drawings show the load between the output and the blue (minus) wire; NPN drawings show it between the output and brown (plus). Then look for the words "PNP", "NPN", "pos." or "neg." in the small print.
Type codes help when the label is worn. Keyence uses a trailing P for the PNP version: the FS-M1P fiber amplifier we hold is PNP, the FS-M1 is NPN, and the same goes for GT2-71P and GT2-71N or GV-21P and GV-21. Other makers each have their own code, so take the meaning from that maker's datasheet rather than from another brand's pattern.
How to test a sensor with a multimeter
Power the sensor from 24 V and connect it to a PLC input or a test lamp, then trigger it.
- PNP: measure between black and blue. You should see close to the supply voltage when the sensor detects, and close to 0 V when it does not.
- NPN: measure between black and brown. The reading jumps to supply voltage when the output switches, because black is now at 0 V.
An NPN output with nothing connected floats, so a meter between black and blue can show a misleading value. Always test with a load.
2-wire vs 3-wire sensors
A 2-wire DC sensor sits in series with the input, like a switch, and draws its own supply through the load. That makes it easy to retrofit where a limit switch used to be. The catch: a small residual current flows when it is off, and a few volts drop across it when it is on. The PLC input has to tolerate both. IEC 61131-2 defines Type 2 inputs for exactly this; Type 1 inputs are meant for contacts and 3-wire sensors. Check the sensor's residual current against the input's off-state limit in the two datasheets.
A 3-wire sensor has none of these problems, which is why it is the default in new machines.
Inductive, capacitive and optical
- Inductive sensors see metal only. Their rated switching distance is measured on a mild steel plate, and it is shorter for aluminium or brass.
- Capacitive sensors see almost anything that changes the electric field: plastic granulate, liquids, wood. Probes like the Captron CAA-60 detect oil or epoxy level and have an adjustable switching point.
- Optical sensors come as through-beam, reflector and diffuse types. Fiber-optic systems put a small fiber head at the detection point and a separate amplifier, such as the Keyence FS-M1P with an FU-35FA fiber unit, on the DIN rail.
All three use the same PNP or NPN output stage and the same wiring above.
If you have many sensors far from the cabinet, an IO-Link sensor hub collects them on one cable; see what IO-Link is. Safety sensors such as door switches and light curtains are a different matter: wire them only as their own manual and your machine's risk assessment require.
On our shelf
We hold sensors and amplifiers from Balluff, Keyence, Captron, ifm and others in Szeged, from single pieces to a lot of 14 mixed small Keyence sensors. If you have the type code off an old sensor, send it to us and we will tell you whether we have it and what condition it is in.



