Learn Automation with MINATA #33: PLC Inputs, PNP and NPN — Read the Polarity Before You Wire
PLC Inputs, PNP and NPN: Read the Polarity Before You Wire
Two three-wire sensors can look identical and still not be wired by feel. The PNP/NPN difference lies in how the output switches current and how the COM of the PLC input group is referenced. Wire it the wrong way and the input reads permanently ON, never ON, or — worse — the device is damaged.
What you will learn
- What actually differs between PNP and NPN.
- How to check the sensor, the input module and the COM before wiring anything.
- The mistakes that make a signal flicker or never reach the PLC at all.
What PNP and NPN mean
- PNP (sourcing): when it operates, the output feeds the positive rail to the input.
- NPN (sinking): when it operates, the output pulls the input down to 0V.
Neither is "stronger" in principle; what matters is that the sensor and the input module are compatible according to the manufacturer's diagram. The words sourcing and sinking are sometimes applied from the sensor side and sometimes from the input side, which reverses their meaning as you read across documents — so never conclude from the name alone. Look at the actual wiring diagram in the datasheet of both parts.
Wiring a 24VDC input, step by step
- Read the label and datasheet: voltage, output type, wire colours, load current, NO/NC logic.
- Identify the PLC module and the COM terminal of that input group.
- Wire +24V, 0V and the output exactly as the diagram shows; do not infer wire colours if the device follows another convention.
- Measure the supply at the sensor before you take the signal wire into the PLC.
- Watch the sensor LED, the input module LED and the online state in the program.
Those three indications form a clean diagnostic chain: does the sensor see the target, does the signal reach the module, and does the program use the right address.
Choosing NO or NC by the safe state
A sensor's NO/NC has to be read in terms of the physical state, not mechanically as "safe or unsafe". A sensor confirming a part present may well be NO, switching ON when the part is there. A sensor watching for the presence of a mechanism is sometimes chosen so that a broken wire produces a fault state that is easy to detect. Safety circuits still have to use proper safety devices and architecture — you cannot infer them from an ordinary sensor contact.
PNP against NPN, side by side
| Criterion | PNP (sourcing) | NPN (sinking) |
|---|
| When it operates | Puts +24V on the signal pin | Pulls the signal pin to 0V |
| Output current direction | Out of the sensor into the input | Out of the input into the sensor |
| Compatible input module | Sinking type, COM tied to 0V | Sourcing type, COM tied to +24V |
| Measured at the signal pin when ON | Around +24V with respect to 0V | Near 0V with respect to +24V |
| Commonly found on | Machines built to European practice | Many Japanese machines |
The trap is the module COM. A sinking input module has its COM on 0V and accepts PNP sensors; a sourcing module has its COM on +24V and goes with NPN sensors. The same PLC family can still be configured with different COM arrangements per input group, so read the COM terminal on the module drawing before you order the sensors.
Two-wire sensors and leakage current
A two-wire sensor is wired in series like a switch. It saves wiring, but it always draws a small leakage current when OFF to keep its internal circuit alive, and it needs a minimum load current when ON. With a high-impedance input, that leakage can be enough to read as ON; conversely a low-current input may never reach the minimum the sensor needs to work properly. When you use two-wire sensors, compare the leakage and minimum current in the datasheet against the input module specification; if they do not line up, add a bleeder resistor or move to a three-wire sensor.
A worked engineering situation
A conveyor has a PNP photoelectric sensor, a 24VDC supply and PLC inputs that accept the positive rail. The terminal schedule should show all three wires: +24V, 0V and B1_OUT. During commissioning, block the beam and check in order: the sensor LED, the input LED, then bit X0. If the sensor LED changes but the module LED does not, the fault is in the wiring, the COM or the polarity — not in the PLC logic.
The real design must follow the wiring diagram of the specific sensor model and I/O module selected.
Common mistakes
- Seeing brown, blue and black wires and connecting them without reading the datasheet.
- Checking status only on the HMI, ignoring the LEDs at the sensor and the PLC.
- Sharing 0V with no rule, which makes fault finding painful.
- Confusing NO/NC with the colour of the sensor's own indicator LED.
- Connecting a sensor to I/O before the supply voltage has been measured.
Checklist
- [ ] The datasheet and pin diagram for the exact model are at hand.
- [ ] The PNP/NPN type and the input COM are compatible.
- [ ] The 24VDC supply has correct polarity, protection and labelling.
- [ ] Sensor → module → PLC tag has been tested in those three steps.
- [ ] Terminal numbers and wire tags match the schedule from #31.
Getting the inputs right on day one saves a great many hours of fault finding. After inputs, #34 covers PLC outputs: relay or transistor, and when an interposing relay is required.
Read more automation knowledge at MINATA: https://minatavn.com/en/blog/industrial-automation
Previous — #32: PLC basics and the scan cycle: https://minatavn.com/en/blog/automation-32-plc-basics-scan-cycle
Next — #34: PLC outputs, relay and transistor: https://minatavn.com/en/blog/automation-34-plc-outputs-relay-transistor
View all MINATA technical articles