
NPN vs PNP Sensor Outputs: Which One Matches Your PLC?
A PNP output supplies current to a PLC input. An NPN output provides a return path to 0 V. For a conventional three-wire DC sensor, match PNP to a sinking input and NPN to a sourcing input, then verify the input-group common, electrical limits and switching logic.
What is the difference between NPN and PNP sensor outputs?
The difference is which side of the load the sensor switches. A PNP output switches the positive side; an NPN output switches the return side. Neither name tells you what the sensor detects or whether it is normally open or normally closed.
Think of the PLC input circuit as the load. It needs a complete path from the positive supply to 0 V before it can recognize an ON signal. The arrows below show conventional current, from positive to negative, with the output conducting.
PNP: current leaves the sensor output
When a PNP output turns ON, it connects the output toward the positive supply. Current enters the PLC input terminal and returns through that input group's common to 0 V. The sensor is sourcing; the PLC input is sinking.
- Positive supply+V
- Sensor outputPNP switch ON
- PLC inputInput circuit
- Input-group COM0 V return
NPN: current enters the sensor output
When an NPN output turns ON, it connects the output toward 0 V. Current comes from the positive input-group common, passes through the PLC input circuit and returns through the sensor. The sensor is sinking; the PLC input is sourcing.
- Input-group COM+V supply
- PLC inputInput circuit
- Sensor outputNPN switch ON
- Sensor return0 V
Low output voltage does not necessarily mean PLC OFF. With a correctly connected NPN circuit, pulling the signal toward 0 V causes current to flow through the sourcing input. That input can therefore report ON while the signal conductor is near 0 V.
Which PLC input works with each sensor?
Use the input module's wiring diagram, not the PLC brand or a label such as “PNP input” by itself. Some descriptions name the input's own current role; others name the sensor it accepts. Find the numbered channel and the common serving that channel.
| Sensor output | Matching PLC input | Input common |
|---|---|---|
| PNP / sourcing | Sinking: receives current from the sensor. | 0 V, for the conventional circuit shown above. |
| NPN / sinking | Sourcing: supplies current through the sensor. | +V, for the conventional circuit shown above. |
A terminal marked COM is not automatically 0 V, protective earth or an interchangeable spare terminal. Some inputs permit either current direction; others have a fixed arrangement. Check group boundaries and any required hardware or software setting before deciding that a common can be changed.
For a documented example, Rockwell Automation's MicroLogix 1000 installation instructions show the 1761-L32BWA with separate DC input commons configured for opposite current directions. That example does not establish the grouping or permissions of a different PLC. See the manufacturer's diagram on printed page 19.
Illustrative example: the replacement lights up, but the input stays OFF
Assume a machine has NPN sensors on a conventional sourcing input group with COM at +24 V. A replacement has the same body size and sensing range, but its full suffix identifies a PNP NO output.
The replacement's indicator changes with the target. Its active output, however, moves toward +24 V while the input common is already at +24 V. The intended voltage across the input circuit is missing. A working indicator does not prove the output matches the card.
Under these assumptions, choose the compatible NPN version. A separately configurable group or a rated interface is another route only if the machine design supports it. Moving the existing shared COM to 0 V would also affect the other NPN channels.
Decision: do not approve the replacement as drop-in compatible. Resolve the output mismatch, then verify both target states. Inverting a program bit cannot repair a missing electrical current path.
Does NPN mean normally closed, or PNP mean normally open?
No. Output topology and switching logic are separate choices. For an ordinary proximity sensor's defined detection state:
- NO: the output switching element turns ON when the target is detected.
- NC: the output switching element turns ON when the target is not detected.
Either behavior can use a PNP or NPN output. For example, a PNP NC sensor can source current with no target present. That does not make its output NPN. Likewise, an NPN NO sensor can pull its signal low when a target arrives and still give the correctly configured PLC an ON input.
For photoelectric sensors, read the Light-ON/Dark-ON definition and sensing mode: “light received” is not always the same as “object present.” During commissioning, record the target state, physical input state and program meaning separately.
How do you identify the three sensor wires correctly?
Start with the complete part number and its output diagram. In a common three-wire DC arrangement, brown is positive supply, blue is 0 V and black is the switching output. The same colors can appear on both NPN and PNP versions, so color cannot identify the output type.
Both sensor types still need correct supply polarity. Swapping brown and blue does not convert NPN to PNP. Protection, if provided, has defined limits; it is not a reason to try reversed connections.
For connector models, match device function → contact number → cordset conductor → PLC terminal. Verify the connector view and exact suffix. An extra conductor can be another output or a different function; do not assume it is unused. The M12 sensor connector pinout guide explains that mapping without relying on left-versus-right pin positions.
This guide's pairing diagrams cover conventional three-wire discrete DC outputs. Two-wire, push-pull, analog, IO-Link and safety interfaces need their own documented connection method.
What else must match after NPN or PNP is correct?
The combination must produce a valid electrical ON state, a valid OFF state and a pulse the controller can capture. A matching output name passes only the current-direction check.
ON state: enough input voltage, within the output's current rating
Compare the PLC input's guaranteed ON voltage and current with the sensor supply range, maximum output current and ON-state voltage drop. Account for wiring losses under load. A “100 mA maximum output” is a capacity limit, not a promise that the sensor pushes 100 mA into every PLC input.
Illustrative voltage check: assume the circuit has 20.4 V at its supply terminals at the lowest operating condition, a maximum 1.5 V ON-state sensor drop, and 0.6 V of total wiring loss along the load path. The input has 20.4 − 1.5 − 0.6 = 18.3 V available. If its specified minimum ON voltage is 15 V, this voltage check passes. Current, maximum voltage, temperature and OFF-state checks are still separate. These assumed values are not xsz sensor or PLC ratings.
OFF state: little enough leakage for the input to release
An electronic output is not an ideal open contact. OFF-state leakage can leave voltage across the connected input. Compare the resulting OFF voltage and current with that module's limits, especially when evaluating two-wire devices or a replacement.
Keep the terms separate: sensor residual voltage usually describes its ON-state drop; voltage remaining across the load while OFF is a different observation. Do not use an arbitrary resistor to hide an incompatibility; any interface or leakage remedy needs a rated, documented design.
Timing: long enough in both states to be recorded
A compatible electrical signal can still be missed if its HIGH or LOW interval is too short for the input filter and acquisition method. Compare the sensor's ON/OFF response, actual target and gap duration, configured input filtering and the controller's capture method. The sensing LED and a handheld meter cannot establish short-pulse capture.
Why does the sensor switch while the PLC does not?
Follow the signal through the sensor, loaded output, physical PLC channel and mapped program tag. The point where the observations stop agreeing tells you which part to investigate next.
Before testing: prevent unintended machine motion and follow the equipment's energy-isolation procedure. De-energize before changing conductors. Any necessary energized measurement belongs to qualified personnel using an approved method and correctly rated instruments. Do not bridge unknown terminals or deliberately short an output.
| What you observe | What to check next | What it helps separate |
|---|---|---|
| No confirmed sensor response | Identify the LED's meaning; verify sensor supply, target and operating mode. | A power or detection problem from a PLC-side issue. |
| Sensor indicates detection; physical input stays OFF | Trace Q to the actual channel and COM. Check loaded signal voltage and input thresholds. | Wrong polarity, wrong terminal/group, broken conductor or insufficient drive. |
| Input indicates ON; expected program tag does not | Check the channel address, mapping, configuration, diagnostics and any forces. | Input acquisition or software interpretation from sensor operation. |
| Works slowly; misses events at speed | Use an approved capture method to compare output pulses with input filtering and counting. | Sensing instability from insufficient pulse duration or acquisition speed. |
| Input stays ON in both target states | Verify NO/NC or optical mode, loaded OFF state, cable condition and channel diagnostics. | A valid but unexpected state from leakage, a forced signal or a wiring fault. |
Why can an unloaded meter reading be misleading?
An open-collector output can be high impedance when OFF. Without the intended load or bias path, the signal voltage may float; a high-impedance meter does not necessarily establish a useful logic level. Identify the circuit first, then interpret readings under its documented load.
Always state the reference. “Signal is 0 V relative to sensor 0 V” can describe an active NPN output; it does not say the voltage across the PLC input circuit is zero. Conversely, a PNP signal near +V does not prove the input has a valid return through COM.
What should you confirm before ordering or approving a replacement?
For an existing machine, select the output that matches its documented input arrangement and process logic. For a new design, define the controller interface first and specify that consistently. Neither NPN nor PNP is automatically the better detector.
- Identity: full sensor part number and suffix, PLC input-module model, channel and common group.
- Interface: output topology, NO/NC or optical mode, supply, connector functions, ON/OFF limits and timing.
- Application fit: target, sensing range, mounting, environment and cable requirements; electrical matching alone does not establish interchangeability.
- Commissioning record: final wiring and mapping, target-present/absent results, operating-speed checks and intended response to loss of signal or power.
A supplier description such as “24 V, three-wire proximity sensor” is incomplete. Ask for the output circuit and switching-state chart for the exact delivered version, not just a family photograph.
Neither output name establishes a safety function. A signal fault toward +V can imitate an active PNP output; a fault toward 0 V can imitate an active NPN output in the conventional circuits above. Choosing NC does not resolve every fault. Personnel protection requires the appropriate safety-rated devices and validated system, not this ordinary process-input arrangement.
Sources and method references
- OMRON: NPN and PNP transistor output circuits — load position relative to the output and supply rails.
- AutomationDirect: connecting three-wire devices to PLC inputs — complementary source/sink roles and shared-common arrangements.
- Schneider Electric: PNP/NPN three-wire sensor connections — separating output topology from NO/NC and using module documentation.
- Rockwell Automation: MicroLogix 1000 installation instructions, 1761-IN001D-EN-P — printed page 19 for the 1761-L32BWA input-common example; input specifications are model-specific.
- OMRON: proximity-sensor terminology and proximity-sensor precautions — switching states, response, leakage and operating limits. Example values are not universal ratings.
- Rockwell Automation: sensor/controller interface manual — model-pair wiring selection and OFF-state leakage compatibility; use the applicable installed-model documentation.
- OMRON E2B documentation — a manufacturer example of defined output options, wiring precautions and the boundary between process sensing and personnel protection.
Current-path diagrams are original simplified explanations. The replacement scenario and voltage calculation use stated illustrative assumptions, not customer test results. The hero is a generated illustration, not an exact-model wiring or product reference.