EXCLUSIVE TRAINING: Learn Robotics At Home & Unlock Highly Desirable $100,000 Tech Skills to Advance Your Career

Share on facebook
Share on twitter
Share on linkedin
Share on pinterest

What is the difference between PNP and NPN?

Disclosure: Some of the links below are affiliate links. This means that, at zero cost to you, I will earn an affiliate commission if you click through the link and finalize a purchase. Learn Robotics is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a way for websites to earn advertising revenues by advertising and linking to Amazon.com.

EXCLUSIVE TRAINING:
Learn Robotics At Home & Gain Highly Desirable $100,000 Tech Skills to Advance Your Career… for ‘Absolute Beginners’ looking to learn robotics at home …without needing access to a robotics lab!

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 PLC.how 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!

Botly Learn Robotics

Get Exclusive Learn Robotics Projects Directly to Your Inbox!

2 Responses

  1. I am interested to learn more about your free robotics training and programs you have in robotics.

Leave a Reply

Your email address will not be published.

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

Did this content help you? 🤖
...say thanks and send us a coffee!

EXCLUSIVE TRAINING:

Learn Robotics At Home & Gain Highly Desirable $100,000 Tech Skills to Advance Your Career

For ‘Absolute Beginners’ looking to learn robotics at home …without needing access to a robotics lab

WHAT IS LEARN ROBOTICS?

Learn Robotics helps self-starters, hobbyists, and tech professionals get started in the robotics industry. 

We leverage a simple formula to make it easy to gain highly marketable and high-value 6-figure robotics & automation skills. 

Learn Robotics was founded by Robotics Engineer, Liz Miller, and leverages the Robotics Success Equation, our unique methodology that helps people learn to build robots while enhancing their careers for the future.

liz's featured robotics PROJECT ON YOUTUBE

Learn Robotics Botly Favicon

MORE LEARN ROBOTICS ARTICLES

Get Liz's Exclusive Robotics Content Directly to Your Inbox

Liz Miller Learn Robotics