Browse our Blog. You will find multiple applications, solutions, code examples. Navigate using the tag cloud or search using specific criteria

PNP Digital Inputs on industrial PLC

Using PNP inputs with industrial controller Arduino

Introduction

In this post we are going to explain how PNP sensors work. PNP  concept is something that we can frequently find everywhere in the industrial environment, for example when we have to select a three-wire detector or photocell and especially when we design schematics and wiring.

All the inputs of the PLC controllers from Industrial Shields are based on PNP connection.

This concept could be a little confusing, especially at the beginning of one's career. But at lenght, when users think about these words, their mind already visualizes the concept corresponding to this kind of sensors.

                   

Technical details

The PNP sensors are based in junctions transistors wich are electronic devices switching and amplifying electrical currents.

A PNP transistor controls the main current flow altering the number of holes instead of the number of electrons in the base. The low cost, reliability and small size of transistors has made them one of the greatest inventions of the 20th century.

Basically we need to know that the input that arrives in our Arduino based PLC is positive(+).

Main differences between PNP and NPN

Firstly, we should keep in mind that one of the main differences is in the design of the internal circuit and the type of transistor that the sensors have.

             

As we can see in the sketches above, the main difference between both systems both is that PNP provides to the industrial Arduino based PLC a positive input meanwhile NPN provides a negative one.

Moreover, PNP is more common in Europe while NPN is used in Asia. Due to this fact, PNP sensors are easier to find in Europe because there is more stock.

Some devices using PNP connections


 


 



Inductive sensor                                                       Photocell sensor                                                                     Capacitive sensor

Example of programming with Arduino IDE
PLC Arduino for industrial automation used: ARDBOX-ANALOG

 

On this simple example, we are printing on the Serial Monitor when a photocell digital sensor is detecting any movement.

void setup() {
Serial.begin(9600);
}
void loop() {
bool state = digitalRead(I0.0);
//send message to port series in function of the readed value
if (state == HIGH)
{
Serial.println("Detection");
//here will execute the actions
}
delay(1000);
}

Do you want more information?

Open Source technology allows you to develop your installations.

Just fill the form and we will contact you as soon as we can.

Send