Shopping Cart

⚡️ We’re Helping 1 Million People Build Their First Robots

🇺🇸 Proudly Women-Owned Small Business
difference between npn and pnp

What is the difference between PNP and NPN?

We sometimes use affiliate links in our content. This won't cost you anything, but it helps us to offset the costs of paying our writing team. You can support us directly on BuyMeACoffee. Thank you!

Here on the blog, we spend a lot of time working with 5 VDC sensors and controllers (Arduino, for example). And, a lot of that knowledge is a great primer for getting into Industrial Controllers like PLC’s (Programmable Logic Controllers).

However, when you start working with PLC’s and 24 VDC sensors you have to follow a slightly different wiring technique. Two very common, yet confusing terms in this space are “PNP” and “NPN”. This article aims explain these terms and provide real examples of how to wire PNP and NPN sensors to a PLC.

How to Remember PNP and NPN (which is which)?

Before we dive into the wiring, let’s talk about what PNP and NPN are and some methods for remembering the two. You can think of the “N” as “Negative” and “P” as “Positive.” The middle letter is the letter connected to the common terminal. For PNP sensors, the Negative side is connected to common. For NPN sensors, the Positive side is connected to common.

PNP and NPN Standard Diagram

To Sink or Source?

PNP is also known as “Sourcing.” PNP devices switch the positive side of the circuit.
A PNP device “sources” or provides +24 V to the input card when active.

NPN devices are known as “Sinking” and can switch the negative side. An NPN device “sinks” or provides -24 V to the input card when active.

Also, the terms Sourcing and Sinking alone are not enough to describe the configuration because SINKING provides a path to ground and SOURCING provides a path to V+. Standard convention has NPN = SINKING and PNP = SOURCING.

How to choose a PNP or NPN sensor?

PNP vs. NPN sensors are determined by the type of circuit used in the system. In most PLC’s it’s possible to configure cards as PNP or NPN. Another thing to note, is that NPN and PNP sensors should never be mixed on a PLC input card.

Furthermore, if you have a specific type of PLC input card that’s NPN or PNP, It’s important to make sure that you choose sensors that match. For example, you can use NPN sensors with an NPN Input card or “sourcing type” Input card. However, you can’t use PNP sensors with an NPN input card.

Steps to Wire an Industrial sensor to a PLC

Now let’s take a look at a case study using a 3-wire Proximity Sensor and a discrete DC Input card on our to wire a prox sensor to a PLC diagram

1. First, select a Sensor that matches your PLC Input Card (discrete DC INPUT) and has the same Circuit Wiring type (PNP or NPN). For this example, we’ll wire a 3-wire proximity sensor to a Discrete DC Input Card and walk through both PNP and NPN wiring types.

2. Next, check the data sheet for your sensor. Wire 3 is typically connected to the load (or the terminal input on the PLC input card).

3. Then, follow one of the two wiring guides for PNP or NPN below.

How to Wire PNP (Sourcing) Sensors to a PLC Input Card

To wire our PNP proximity sensor, you can use this methodology. It’s a good idea to check the sensor’s data sheet because wire colors and configurations may differ.PNP wiring diagram

First, connect the Brown Wire, or Wire 1, to +24 V. Then attach Wire 2 (blue wire), to the common terminal on the power supply. Finally, connect the black wire, or Wire 3, to the load or pin on the PLC input card.

How to Wire NPN Sensors to a PLC Input Card

NPN sensors are wired the same, except, you’ll connect +24 V to commonNPN sensor to PLC wiring diagram

Test out and Program Your PLC

Once you have your power supply, PLC, input card, and sensor wired up, the next step is to verify it works. Most modern PLC’s have indicator lights for both the Input and Output pins. Trigger the proximity sensor and verify that the Indicator light turns on.

Test PLC inputs discrete DC input card S7-1200

Graphic Courtesy of S7-1200 Course on Udemy

Finally, you can go into your PLC programming environment (Studio5000 for Allen-Bradley controllers or TIA Portal for Siemens controllers) and create some Ladder Logic.

If you’re new to PLC programming, I recommend checking out this PLC programming course from Udemy. I’ve taken the S7-1200 course and it provides very thorough content to get you started with Ladder Logic and Function Block diagrams.

You don’t want to miss it!

Support Content Like This

You May Also Like

Have a question? Need Help?

Thanks for dropping by! Comments are no longer moderated daily.
Before posting your comment, please consider buying a coffee.
If you'd like to work with Liz, you can schedule a call here.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Learn Robotics Botly Favicon

Become a Learn Robotics Insider


Be the first to know when we launch new robotics content. Plus gain FREE robotics tips to your inbox.

Awesome! Check your inbox for a surprise!

Remote Robotics Courses for High School, Middle School, or Pre-College Training

Join the Powered by Learn Robotics Program

Teach robotics anywhere with our turnkey robotics program!

Download our free program brochure!

Success! Check your email for the download!