NPN and PNP Proximity Sensors Electronics

NPN and PNP Proximity Sensors | 3-Wire Configuration Explained

Share:

NPN and PNP Proximity Sensors: Introduction

In today’s industrial automation and instrumentation world, proximity sensors are everywhere. From detecting metal parts on conveyor belts to sensing machine positions in packaging lines, proximity sensors play a silent but very important role.

But when you go to purchase or replace a proximity sensor, one confusing question always comes up:

“Should I use an NPN Sensor or a PNP Sensor?”

Many technicians and even engineers get confused between these two. Both sensors look almost similar from the outside, but their output working and wiring logic are different

If you select the wrong one, your PLC input may not work at all.

In this article, we will explain:

1) What NPN and PNP proximity sensors are
2) How they work in simple language
3) Difference between NPN and PNP
4) Wiring concept
5) How to choose the correct one
6) Common mistakes made in the field

Let us start from the basics.

What Is a Proximity Sensor?

A proximity sensor is a device that detects the presence of an object without physically touching it. It senses the object using magnetic fields, electric fields, ultrasonic waves, or light.

The most common type used in industries is the inductive proximity sensor, which detects only metal objects.

These sensors are widely used in:

  • Manufacturing plants
  • Packaging machines
  • Conveyor systems
  • CNC machines
  • Robotics
  • Automation panels

Modern proximity sensors are solid-state electronic devices, meaning they use transistors instead of mechanical contacts.

This is where NPN and PNP come into the picture.

What Do NPN and PNP Mean?

NPN and PNP refer to the type of transistor used in the output stage of the sensor.

In simple words:

  • PNP sensor gives a positive output
  • NPN sensor gives a negative (ground) output

This difference decides how the sensor sends its signal to a PLC, relay, or load.

Another common way to describe them is:

  • PNP = Sourcing sensor
  • NPN = Sinking sensor

These terms simply describe the direction of current flow.

In a PNP sensor connection, the load is connected to the Negative (0V) line, and the sensor switches the Positive voltage when it detects a target. On the other hand, in an NPN sensor connection, the load is connected to the Positive supply, and the sensor switches the Negative (0V) line when an object is detected.

See the schematic below for your reference.

PNP Sensors
PNP Sensor
NPN Sensors
NPN Sensor

Basic Working Principle (In Very Simple Language)

Let us understand this with easy logic.

PNP Proximity Sensor (Sourcing Output)

  • When the sensor detects an object, it supplies +24V to the output wire
  • The load or PLC input is connected to 0V (ground)
  • The sensor “pushes” current into the load

So:

PNP = Output becomes POSITIVE when ON


NPN Proximity Sensor (Sinking Output)

  • When the sensor detects an object, it connects the output to 0V (ground)
  • The load or PLC input is connected to +24V
  • The sensor “pulls” current from the load

So:

NPN = Output becomes NEGATIVE (0V) when ON

Standard Wire Colors in 3-Wire Proximity Sensors

Most 3-wire DC proximity sensors follow a standard color code:

  • Brown wire → +24V DC (Power Supply Positive)
  • Blue wire → 0V DC (Power Supply Ground)
  • Black wire → Output Signal

Only the black wire behavior changes between NPN and PNP.

Proximity sensors work as digital devices, so they always require a 24V DC power supply to operate.

PNP vs NPN for 3 wire connection of a sensor

Most industrial proximity sensors are solid-state devices, which means they have no moving parts inside. The most commonly used version is the 3-wire proximity sensor. These sensors use either a PNP or an NPN transistor to switch the output when a target is detected.

Out of the three wires, two wires are used to supply power to the sensor, while the third wire carries the output signal.

It is important to note that PNP or NPN type does not determine whether the sensor is Normally Open (NO) or Normally Closed (NC). The NO or NC function depends only on how the sensor is designed and applied. A PNP sensor can be either NO or NC, and the same applies to an NPN sensor.

3-Wire NPN Sensor
3-Wire PNP Sensor

Now, let us consider a relay-operated circuit controlled directly by a proximity sensor.

In a PNP wiring configuration, the relay is permanently connected to 0V, and the sensor switches the +24V supply when it detects an object. 

In an NPN wiring configuration, the relay is permanently connected to +24V, and the sensor switches the 0V (ground) when an object is detected.

In both cases, the sensor itself is always powered by +24V and 0V, regardless of whether it is PNP or NPN

How to Choose Between NPN and PNP Sensors

Before buying or replacing a sensor, always check the following:

1. Check Your PLC Input Type

This is the most important step.

  • If your PLC input is sinking → Use PNP sensor
  • If your PLC input is sourcing → Use NPN sensor

You can find this in:

  • PLC datasheet
  • Panel wiring diagram
  • PLC terminal marking

2. Check Existing Installed Sensors

If the machine already has sensors working:

  • Open the panel
  • Check old sensor part number
  • Read the datasheet
  • Replace with the same type (NPN or PNP)

Never change the type unless the PLC also supports it.


3. Check Power Supply Voltage

Most proximity sensors work on:

  • 10–30V DC
  • Standard industrial voltage = 24V DC

Always confirm the power supply before installation.

How to Identify NPN or PNP Sensor in the Field

Sometimes the sensor body label is missing or unreadable. In that case:

Method 1: Read Datasheet / Part Number

Search the sensor model number online. It will clearly mention NPN or PNP.


Method 2: Using a Multimeter (Practical Field Test)

  1. Power the sensor with 24V DC

  2. Put multimeter in DC voltage mode

  3. Measure voltage between: Black wire (output) and Blue wire (0V)

Now bring metal near the sensor:

  • If voltage goes from 0V to +24V → It is a PNP sensor
  • If voltage goes from +24V to 0V → It is an NPN sensor

This simple test is extremely useful for technicians.

What we learn today?

NPN and PNP proximity sensors perform the same physical sensing job, but their electrical signal behavior is different. Understanding this difference is absolutely essential for everyone. 

A small mistake in NPN vs PNP selection can stop an entire machine. But with proper knowledge, correct wiring, and simple testing methods, this topic becomes very easy.

If you remember only one line from this article, remember this:

“PNP switches Positive, NPN switches Negative.”

You can also read my artcle: Basics of Transistors

I hope you like above blog. There is no cost associated in sharing the article in your social media. Thanks for Reading !! Happy Learning

2 Comments

  • Samuel f conteh December 2, 2025

    Am so impressed an appreciate this platform.
    Thanks so much.
    I kindly requested to the team to also be sending this articles in pdf form.

Leave a Reply

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