
PNP Sensor Wiring Diagram: A Simple Step-by-Step Guide
For a conventional three-wire DC PNP sensor, connect L+ to the positive supply, 0 V to the supply return, and Q to a compatible PLC input. The input circuit must return to 0 V. Brown, blue and black are common wire colors—not a substitute for the sensor and PLC terminal diagrams.
How do you wire a three-wire PNP sensor?
A PNP output supplies positive current to its load when ON. For a PLC connection, the load is the module’s input circuit—not an extra resistor you normally need to add. The diagram below shows both the output-current loop and the sensor’s separate power-supply return.
Before touching wiring: follow the machine’s isolation, lockout and absence-of-voltage procedure. Prevent unintended motion. Energized tests require qualified personnel, suitable test equipment and an authorized procedure. This guide covers ordinary DC process inputs, not mains circuits or safety-light-curtain outputs.
Three-wire PNP sensor → compatible sinking PLC input
On a narrow screen, swipe the diagram sideways to see the complete circuit.
Trace the active loop: L+ → PNP output stage → Q → PLC input circuit → input-group COM → 0 V. Blue also powers the sensor electronics through their own return. Connecting only the signal wire does not complete the input loop.
Make the connections in a controlled sequence
- Identify the hardware before connecting it. Read the complete sensor part number and output diagram. Confirm three-wire DC PNP, the allowed supply range and the required NO/NC behavior. Locate the exact PLC channel, its common group and its input specification.
- Isolate the circuit and establish the supply pair. Connect the documented L+ conductor to the protected positive DC supply and the documented 0 V conductor to its return. In the common convention these are brown and blue.
- Connect the switching output to the selected input. Route Q—commonly black—to the PLC input terminal shown in the channel map. Record the corresponding address; a terminal number is not necessarily the program address.
- Complete the input return. For the sinking input shown above, its group common returns to supply 0 V. Some modules provide that connection internally; others need an external terminal connection. Follow the module drawing, including any separate field-power terminals.
- Inspect before energizing. Check terminations, polarity, conductor identity, unused-core insulation and connector engagement. Perform continuity checks only on isolated, appropriately disconnected wiring. Use the specified cable size, stripping length and terminal torque.
- Test both sensing states with motion controlled. Restore power under the approved procedure. Compare the sensor’s output indication, the physical PLC input and its diagnostic address with the intended target states. Do not release automatic operation just because an LED changes.
A conventional PNP output pairs with a sinking input. Some catalogues describe inputs by the sensor type they accept, so the current path is more reliable than the label alone. If the installed sensor is NPN, use its own circuit; swapping the brown and blue supply wires does not convert the output.
Where should the PLC input common connect?
In this conventional PNP arrangement, connect the relevant input common to the same circuit’s 0 V return. A correctly powered sensor can still fail to operate an input if that return is missing, belongs to another group or is referenced to the positive supply.
Find the common for this channel—not just a nearby COM
A PLC may have several isolated input groups, separate logic and field supplies, or selectable input modes. Follow the diagram from the selected input to its own common. Do not join isolated groups or separate supplies simply because both are labelled “0 V.” Establish the manufacturer-specified reference or use a compatible isolated interface.
On a selectable shared-common group, changing the common can affect every connected channel. Conventional NPN and PNP devices need opposite current paths; changing program logic does not make an incompatible electrical group work.
Example: the output is high, but the PLC input stays OFF
Illustrative diagnosis—not recorded test data. Consider a nominal 24 V circuit with a known PNP sensor. The supply between brown and blue is correct. With the output ON, Q measured against blue is near the positive supply, yet the PLC channel remains OFF.
Now suppose Q measured against the channel’s COM is near zero, while COM measured against blue is near the positive supply. The important clue is that Q and COM are at almost the same potential: there is little voltage across the input circuit.
Next action: isolate the circuit and trace the selected group’s common against the module diagram. Investigate a wrong positive reference or wrong common group before replacing the sensor. Only correct the connection if the module permits it, then retest both states and the other affected channels.
A documented example is AutomationDirect’s AM1-AP-1A PNP sensor connected to the D2-16ND3-2 input module: the drawing returns the PNP group’s common to supply negative. That is a useful illustration of the loop, not a terminal map for every PLC. Manufacturer wiring note, page 1.
What do the wire colors and M12 pin numbers mean?
Use the following as an orientation map for a common three-wire switching sensor. Check three things separately: cable color, connector pin number and device-assigned function. Neither an M12 connector nor a familiar wire color proves that the output is PNP.
| Conductor | Common pin | Function to confirm |
|---|---|---|
| Brown / BN | 1 | L+ positive DC supply; check the actual operating range. |
| Blue / BU | 3 | L− / 0 V power return; not an automatic earth connection. |
| Black / BK | 4 | Q, the switching output in this example. Confirm PNP and switching mode. |
| White / WH, if fitted | 2 | Device-defined: unused, another output or another function. Do not bridge it to black or 0 V by default. |
A three-wire sensor can use a four-position connector
The sensor may need only supply, return and one output while its connector or cordset has four contacts. An extra core does not automatically mean an extra switching output. Insulate unused conductors individually as specified.
Read whether the drawing shows a plug or socket and the mating or wiring side. Physical positions can appear mirrored; use the printed pin numbers and key orientation. This guide intentionally does not give a universal connector-face sketch. The M12 pinout guide covers those connector-specific checks.
Does PNP mean normally open?
No. PNP describes how current is driven; NO or NC describes when the output conducts. Both PNP NO and PNP NC versions use the same conventional sourcing-current path. The target state that turns that path ON changes.
| PNP version | Target absent | Target detected |
|---|---|---|
| Normally open / NO | Output OFF | Output ON; sources current |
| Normally closed / NC | Output ON; sources current | Output OFF |
For a photoelectric sensor, also check light-on/dark-on and the sensing mode. Beam interruption and light return do not mean the same thing. A reversed program condition changes how the PLC uses a bit; it does not change the physical output type.
Neither PNP nor NC makes an ordinary sensor safety-rated. A signal wire shorted to L+ can imitate a PNP ON state. Do not use this wiring example as a personnel-protection circuit.
How do you test a PNP output with a multimeter?
Test a known, correctly wired sensor with its compatible input or specified load connected. An unloaded voltage reading does not reliably identify PNP versus NPN or prove an output is healthy.
For an authorized energized voltage test, select DC volts, put the black meter lead in COM and the red lead in the V jack. Do not measure across a supply or output with the red lead in A/mA: that creates a short through the meter. Use the instrument’s required rating and procedure.
| Check | Probe locations | What the result tells you |
|---|---|---|
| Sensor supply | Red: sensor L+ Black: sensor 0 V | Whether the supply reaches the sensor within its rated range. Check at the device, not only the power supply. |
| Output at sensor | Red: Q Black: sensor 0 V | Whether the loaded output changes in the intended states. ON is toward L+, less the output-stage voltage drop. |
| Signal at PLC | Red: selected input terminal Black: that input group’s COM | The voltage actually applied across the input. Compare it with the module’s guaranteed ON/OFF limits. |
Why “not exactly 24 V” is not automatically a fault
A transistor output has a voltage drop. As a model-specific example, Pepperl+Fuchs lists up to 3 V for its NBB3-V3-E2-V3. With an assumed 24 V at that sensor and negligible cable loss, subtracting that maximum gives 21 V available to the load. This is a simple bound from the stated assumptions—not a measured result, universal PNP value or PLC compatibility approval. Check whether the actual input’s ON requirements are met. NBB3-V3-E2-V3 technical data.
Why an OFF output can still show voltage
Electronic outputs may pass a small OFF-state current. A disconnected conductor can also float, and a high-impedance meter may display a voltage without demonstrating usable output current. With the intended load connected, compare the OFF state with the sensor’s leakage specification and the PLC’s OFF limits. Do not fit an arbitrary resistor just to force the reading to zero.
A handheld meter can miss short pulses. If detection works while the target is held still but fails at speed, investigate pulse duration and input filtering—not just the average voltage.
Can the same PNP output drive a relay coil?
Sometimes, but a relay coil is a different load from a PLC input. Direct operation is suitable only when the sensor manufacturer permits the inductive load and the coil’s voltage, worst-case current and suppression requirements fit the output. The sensor’s own supply consumption is not its allowable output current.
Connect the coil between Q and 0 V
For a permitted DC coil, Q supplies the positive side and the other end returns to 0 V. Use manufacturer-approved suppression. A plain flyback diode, where specified, connects in parallel with the coil: its cathode/banded end faces Q, and its anode faces 0 V. It is reverse-biased while the coil is powered.
DC coil with a parallel flyback diode
On a narrow screen, swipe sideways. This shows the output/load portion only.
Suppression protects against the coil’s turn-off transient, but a diode can lengthen relay release time. Recheck the required response. Do not add a diode over an unknown built-in suppressor or select it solely by appearance.
Use an interface when the load does not fit
Check coil current over its supply and temperature range, including any specified startup demand of an electronic load. If the limits do not fit—or remain unknown—select a compatible interface with an input the sensor can drive and an output rated for the load. An arbitrary “interposing relay” is not a fix if its own coil also overloads the sensor.
Why does the sensor switch but the PLC not respond?
Find the first point where the state stops matching: sensing condition → sensor output → input terminal → PLC channel → program logic. An indicator can describe detection, output state or a diagnostic condition; identify its meaning in the manual before treating it as proof of the electrical signal.
| Observed symptom | Check next | How to narrow it down |
|---|---|---|
| Sensor does not change state | Supply at the device, target and selected mode. | Resolve supply, sensing geometry or configuration before blaming the PLC. Confirm what the sensor LED represents. |
| Q changes at the sensor, not at the input terminal | Cable, connector mapping and terminal selection. | Compare both ends using their proper references. Isolate before checking conductor continuity or changing a termination. |
| Input voltage changes, physical channel stays OFF | Group COM, input thresholds, field power and channel configuration. | Measure input-to-its-COM, not input-to-an-unrelated 0 V. Check the actual module’s voltage and current requirements. |
| Physical channel changes, program condition does not | I/O address, mapping, forces and logic interpretation. | Watch the raw diagnostic input before downstream logic. Remove test overrides under the commissioning procedure. |
| Input is always ON | NC mode, sustained detection, Q shorted to L+, or excessive OFF-state current. | Separate the physical channel state from a software-inverted condition. Compare a loaded OFF measurement with the specified limits. |
| Works slowly, misses moving targets | Sensor response, pulse width, input filter and PLC task timing. | Use an appropriate signal-capture method. A steady DC reading cannot prove that every short pulse reaches the controller. |
| False changes when a motor or coil switches | Supply disturbance, cable routing, reference connections and load suppression. | Correlate the event with the signal and supply. Follow the equipment’s EMC/grounding plan; do not add arbitrary ground links. |
Before returning to production: verify both target states at the actual channel, expected behavior after power restoration, signal capture at operating speed and removal of temporary forces or test wiring. Record the final sensor model, pin map, common group and I/O address. A working input is one commissioning result—not proof that the complete machine safety function is validated.
Sources and method references
- Balluff — Electrical wiring of sensors: sourcing/sinking load placement and the separate NO/NC distinction.
- OMRON — FAQ00379, PNP and NPN transistor outputs: load placement relative to the output and supply return.
- Pantron Automation — Connecting a three-wire DC sensor to a PLC: supply, signal and common-return connections.
- AutomationDirect — D2-16ND3-2 three-wire sensor wiring note: a specific PNP/common-group example, revised February 15, 2002. Use the current manual for the installed module.
- Balluff — High Durability Cables, printed pages 122–123: the M12 four-conductor pin/color map. Phoenix Contact — SAC-4P-M12MS/ 2,0-542/M12FS BK: plug/socket views. Cable construction does not assign every connected sensor’s function.
- Fluke — Measuring DC voltage: meter function, lead jacks and the short-circuit hazard of using a current jack for a voltage test.
- Pepperl+Fuchs — NBB3-V3-E2-V3 technical data: the model-specific voltage-drop example and separate output, OFF-state and supply-current specifications.
- OMRON — Relay coil surge countermeasures: DC-coil suppression and its effect on release time.
The wiring figures are original simplified explanations, not manufacturer-approved installation drawings. The common-reference scenario is illustrative; the 21 V calculation uses stated assumptions. Photographic illustrations are conceptual and do not identify a tested sensor/PLC combination.