An Easy Way to Remember PNP and NPN Sensor Wiring

Here’s a simple way remember how to wire up a 3-wire DC PNP or NPN sensor:

PNP = Switched Positive

NPN = Switched Negative

“Switched” refers to which side of the controlled load (relay, small indicator, PLC input) is being switched electrically. Either the load is connected to Negative and the Positive is switched (PNP), or the load is connected to Positive and the Negative is switched (NPN). These diagrams illustrate the differences between the two connections.

Click here for more information about the Sensor Fundamentals training course.


7 Replies to “An Easy Way to Remember PNP and NPN Sensor Wiring”

  1. Dave Seward says:

    So in the case of a sensor that has push/ pull output, does this mean that the sensor automatically detects if it needs to source or sink on the output?

  2. There are also 4-wire PNP and NPN sensors with +VCC & GND and Black & White for signal. What if I am using the White cable instead of Black shown above?

    Also what happens if I use a PNP sensor for a device working with an NPN input? Thanks in advance!

    1. Henry Menke says:

      Hello George, interesting questions! The White wire is for a second output, typically Normally Closed. The sinking / sourcing logic is the same as for the Black wire. That is, if the sensor is PNP for the Black wire, it is also PNP for the White wire. I have never seen a sensor with mixed PNP and NPN outputs, but perhaps some specialty types exist on the market.

      An NPN input is looking for the input to be connected to GND to respond. If connected to a PNP sensor, the NPN input will be floating (open) when the PNP sensor is off (not triggered). Depending on the sensor’s internal wiring, there might be some current flow from the NPN input to the sensor, for example there may be reverse current that “leaks” through a protection diode or an LED in the sensor. This current flow might be high enough to falsely trigger the NPN input. When the PNP sensor turns on, it will connect +24VDC to the NPN input. This should not trigger the NPN input, since it is looking for a GND connection to activate, but again there may be some unexpected reverse current flow from the sensor and into the NPN input circuitry that is not intended.

  3. Can you also add “sinking” and “sourcing” to this diagram? It’s also a common question that comes up.

    1. Henry Menke says:

      Thanks for that helpful suggestion, Ben. We’ve updated the diagram accordingly.

  4. Very well done. I can show this to my craft class who never saw a transistor but need to know how to connect different sensors. Thank you very very much!

Leave a Reply