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.

2.14.2018_PNP-v-NPN-Graphic-2-768x1000_update

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

  1. Thank you Sir for the great explanations. It finally makes sense to me!

  2. 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?
    Dave

    1. Henry Menke says:

      Hello Dave, thanks for your question. Essentially, yes, the output driver contains both sourcing and sinking transistors and is able to either “push” current (sourcing) from positive to the load or “pull” current (sinking) from the load to ground.

  3. 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.

      1. Lothar Peters says:

        Hello, could you please explain to me how I have to connect my 4-wire optical level switch? (PnP NC) This one has:

        brn – 1 – L+
        blu – 3 M
        blk – 4 – Q
        wht – 2 – NC

      2. Henry Menke says:

        Hello Lothar, thanks for commenting. The pinout / wiring designations you’ve given for your sensor likely have these functions:

        BN 1 L+ Supply Positive
        BU 3 M Common (Ground, Supply Negative)
        BK 4 Q Output
        NC 2 NC “No Connection”

  4. 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.

  5. 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!

    1. Henry Menke says:

      Thanks for reading and commenting, Alessio!

Leave a Reply