NPN and PNP proximity sensors

Proximity sensors are used to detect objects without making physical contact. There are 2-wire and 3-wire proximity sensors, and 3-wire proximity sensors are more popular. There are two main types of proximity sensors based on their output type: NPN and PNP.

Selecting the correct type of proximity sensor for a particular application can ensure the correct operation of a system. This article aims to provide an outline of the two main output types and a guide on how to connect a proximity sensor to a PLC.

What is an NPN proximity sensor?

NPN proximity sensors provide an active LOW output. This means that when an object enters the detecting range of the sensor, the output of the sensor is connected with the ground. This type of sensor is also known as ‘sinking’ sensor.

What is a PNP proximity sensor?

PNP proximity sensors provide an active HIGH output. When an object enters the detecting range of the sensor, the output of the sensor is connected with +24V. When connected to a PLC input, it detects this as a logic HIGH signal. PNP proximity sensors are also known as ‘sourcing’ sensors.

A Way to Remember NPN and PNP Sensor Wiring

To easily remember the wiring of a 3-wire DC proximity sensor, we can use the following analogy:

PNP = Switched Positive

NPN = Switched Negative

Proximity sensors are digital sensors. Therefore, they must always be connected to a 24V power source to function.

In the PNP sensor wiring, the load is always connected to Negative. The Positive is switched when the proximity sensor detects an object. But, in the NPN sensor wiring, the load is always connected to Positive, and the Negative is switched when an object is detected.

PNP vs NPN for 3 wire connection of a sensor

Almost all the industrial proximity sensors are solid-state devices, meaning that they do not have moving parts inside. The most popular type of proximity sensor is the 3-wire type. They use PNP or NPN type transistors to switch the output when an object is detected.

Two of the wires are used to provide the sensor with power to operate, while the other wire is the output from the sensor.

At this point, t’s worth mentioning that being a PNP or NPN type sensor, does not imply if the sensor output is normally open (N/O) or normally closed (N/C). This is dependent only on the application. (I.e. a PNP sensor can be either N/O or N/C as can an NPN be either N/O or N/C)

Let’s have a look at a relay-type circuit, where a relay is operated directly by a proximity sensor.

The difference between the two wirings is that in the PNP type wiring, the relay is always connected to 0V, and +24V is switched by the sensor. But in the NPN type wiring, the relay is always connected to +24V and the sensor switches the 0V connection. Regardless, the sensor is connected to +24 and 0V to supply power to it.

How to Connect NPN/PNP Proximity Sensor to PLC

Warning! Before attempting any wiring, make sure that the system is powered off to prevent electric shock.

Identifying the color code of a 3-wire proximity sensor

On a 3-wire sensor, the wiring color code is as follows: (Brown: +24V, Blue: 0V, Black: output)

If your sensor’s wires are differently colored or unsure about the color code, please refer to its manufacturer’s datasheet.

Wiring an NPN type 3-wire proximity sensor to a PLC

Before connecting the sensor to the PLC, make sure that the PLC is configured to the ‘sourcing’ type. On a Siemens S7-200 PLC, this can be done by connecting input 1M to +24V. This means that the PLC will ‘source current’ out of the input, and the NPN sensor will ‘sink current’ when it detects an object.

If the input is fed to the PLC through an input card, it must be a sourcing type input card, or else a configurable one. The SIMATIC S7-1200, Digital Input SB 1221 is such a sourcing-type input card.

Wiring a PNP type 3-wire proximity sensor to a PLC

For a PNP type sensor, the PLC needs to be configured as a ‘sinking’ type. Connecting the input 1M to 0V will configure the PLC as input sinking. With this configuration, the sensor can ‘source current’ and the PLC will ‘sink current’ to detect sensor output.

For a PNP type proximity sensor, if an input card is used, it must be a ‘sinking type card. The S7-1200, Digital Input SM 1221 input card for S7-1200 PLCs is a sink/source configurable input card and it can interface with either type of sensor.

How to choose a PNP or NPN sensor?

Selecting PNP vs NPN depends mostly on the application and the availability. As Arrow Electronics mentions, NPN sensors are more common in the automation industry in the Asia region. PNP sensors are more popular in Europe and America.

NPN sensors are used in high-speed applications because they are faster than PNP sensors. They also find more applications in relay circuits than PLC circuits. PNP sensors are more popular in PLC circuits as they can prevent false-positive signals if damaged and shorted with the ground.

How do I know if my proximity sensor is NPN or PNP?

The easiest way to identify the sensor type is by observing the sticker on the body of the sensor. This sticker can sometimes have a wiring diagram printed on it as well.

If the sensor is not marked and is installed, a multimeter can help identify the sensor type. Power on the system and carefully measure the voltage between 0V and the black wire. If there is a voltage of +24V when the sensor is active, it is a PNP-type sensor. If there is a 0V reading on the multimeter when the sensor is active, it is most likely an NPN sensor.

Conclusion

In this article, we discussed the two types of proximity sensors, their construction, and their applications in automation systems. It is always a good practice to design the system to be able to use both NPN and PNP type sensors if possible. This can greatly increase the flexibility controls-wise.

Facebook
Twitter
LinkedIn
Pinterest
Latest Posts

Table of Contents

Send us