PNP sensor:- This is a sensor whose output pulls up to the positive supply rail when it senses a metal target. Thus any attached load to the sensor output must be connected between zero volts & the output of the sensor to operate. This type of sensor is very vulnerable to short circuits to earth ( zero volts), a common fault if the wiring chafes/ becomes damaged. Often it will fry under this type of fault.
NPN sensor: - This is a sensor whose output pulls down to the negative ( 0 volts) supply rail when it senses a metal target. Thus any attached load to the sensor output must be connected between the Positive supply rail & the output of the sensor to operate. This type of sensor cannot survive a short up to the positive supply rail ( a very rare occurrence!). Shorts to the negative rail (zero volts) will not damage it at all & it can tolerate this indefinitely. NPN sensors are current sinking devices and PNP sensors are current sourcing devices. You can't connect a current sourcing sensor to another current sourcing input (like TTL for example), it just won't work unless you provide a path to ground. Likewise a current sinking sensor must be connected to a current sourcing input. So you have to know something about the input circuitry of the device you're trying to read the things with.
Sensor Connection with PLC:
Other factors affecting choice :- If there is a PLC attached then :-
a ] If the input device of the PLC registers a logic high/true state when left open circuit then this type of input is best served by an NPN sensor. This will pull the PLC input low when a target is sensed.
b ] If the input device of the PLC registers a logic low/false state when left open circuit, then this type of input is best served by a PNP sensor. This will pull the PLC input high when a target is sensed.
How to find sensor is NPN or PNP :
1) Power the sensor from (usually) 24VDC.
2) Connect one end of a (say) 10kohm resistor to the sensor output.
3) Connect the other end of the resistor to either 24Vdc or 24 VDC common.
4) Actuate the sensor.
5) If switching at the sensor output happens when the resistor is connected to 24 VDC, the sensor is NPN.
6) If the sensor output switches when the resistor is connected to 24 VDC common, the sensor is PNP.
One way to find out would be to look at the load the sensor is currently driving. If it is a relay, for example, the sensor output will go to one coil terminal and the other coil terminal will go to one of the power rails. If it is the low side, your sensor is PNP; if the other side of the relay is the low side, you sensor is NPN. If it is presently not connected, you will need to connect two resistors in series across the DC power rails. 3.3k, 1/4w should do if your supply is around 24VDC. Now hook the sensor output to the point between the resistors and activate the sensor. If the sensor is PNP, the sensor output point between the resistors will go high, if it's NPN, it will go low.
How to test NPN and PNP sensor
Things You’ll Need:
• 3 wire sensor (DC voltage)
• digital multimeter
Set the multi meter to DC voltage. This is indicated by either the letters "VDC" or "DCV" or by a symbol which looks like 3 dashed lines over a solid line. There are usually several levels within the DC voltage setting. Choose the "600" level.
The power will need to be ON to perform this test, so use caution when attempting the following. Connect two of the sensor wires to the power supply. If the color combination of the wires is blue, black, and brown, then normally, the blue wire connects to 0v and the brown wire connects to positive volts. Touch the black meter probe to the 0V wire of the sensor. Connect the red meter probe to the signal output wire of the sensor. This wire is normally black. The meter should read "0."
Force the sensor to output. If it is a photoelectric sensor, block the photoelectric beam. If it is an inductive proximity switch, introduce a small piece of metal in front of the sensor. For an ultrasonic sensor or a capacitive sensor, you can just use your hand to make the sensor output. Be sure that the sensor is detecting the object. Many sensors have a small LED that illuminates when the sensor detects it's target.
Watch the meter display as you force the sensor to output. If the readout changes to a number between 10 and 30, then the sensor output is a PNP type, also known as "sourcing." If the meter display remains at "0", then the sensor output is an NPN type, also known as "sinking."
If you believe that the sensor is NPN, there is an additional test that may be done to confirm. Remove the meter probes from the wires. Now place the red meter probe on the positive voltage sensor wire, normally a brown wire. Touch the black meter probe to the signal output wire of the sensor, normally black. When the sensor does not detect it's target, the meter display should read between 10 and 30. When the sensor senses an object, the display should drop to "0." This will confirm that the sensor has an NPN type output.
• Be sure to make solid contact between the meter probes and the wires.
• Do not handle the bare wires!
• Always use caution when working with any electrical device