Most industries these days use solid-state sensors in their electronic devices, meaning that they use solid semiconducting components like transistors to switch the sensor's output when it detects something. When dealing with electronic connections, for example to a PLC, people usually refer to PNP or NPN sensors. However, this designation just indicates the type of transistor used inside the device. PNP and NPN are types of bipolar junction transistor, with the two different abbreviations denoting their composition.
The semiconducting material of which they're constructed is either a positive layer situated between two negative layers (NPN), or a negative layer between two positive layers (PNP). In the most basic terms, P=Positive and N=Negative. The device the sensor is connected to is the load, which might be anything from a relay or PLC input to a lamp or a pneumatic valve.
So What's The Difference?
Both types of transistor can amplify signals and switch larger currents, but they do it in different ways. Both types of sensor have positive and negative power leads, but the PNP type produces a positive output in the ON state while the NPN type signal in the ON state is negative. A PNP sensor (also called a sourcing sensor) sources positive power to the transistor's output. An NPN sensor (also called a sinking sensor) sinks ground to the output. So in effect, they both do the same basic job – but NPN transistors are usually preferred for most simple circuit design applications as they're faster, easier, and cheaper to produce. Faster transfer of electrons is a great advantage in high-speed switching applications and amplifier circuits.
When a positive signal is applied to the base pin of an NPN transistor or sinking sensor, it amplifies the signal by enabling the flow of a larger current from the collector to the device's emitter pins. This current flow is proportional to the base voltage and occurs in an active range. No current will flow below a certain voltage threshold, but electrons can flow freely above a certain point, when the transistor reaches saturation. In an NPN configuration, the load is wired between a positive voltage input and the collector of the controlling transistor.
In the case of a PNP transistor or sourcing sensor, it amplifies the signal when a negative voltage is applied. In this configuration, the load being controlled is wired between the transistor's collector and ground. While this type of transistor configuration is less common, it is frequently used in certain circuits such as traditional relay-type control circuits. PNP transistors can also be used in tandem with NPNs, in applications where it's necessary to amplify oscillating signals efficiently. Some more complex devices can even be wired as PNP or NPN, so it’s very helpful when designing a circuit to have both types of switching option available.
PLC Sensor Selection
If you're using a sensor with a PLC, it's crucial that it should match the PLC input card, since the sensed stimulus represents the base signal. Positive logic input cards sink the current from the transistor, so they need a sourcing or PNP sensor to switch. Negative logic input cards source their current and use a sinking or NPN sensor. These terms are not always the most commonly used in industries, so it's important to match the PLC card with the correct type of sensor using the PLC manufacturer's wiring diagrams and documentation. Many modern PLC input cards are more flexible, and can be configured as either sinking or sourcing. Having made the decision though, the wiring must be consistent across all inputs.
NPN transistors are more commonly used as base components, but the PNP configuration is more usually found in industrial control applications. PNP sensors are generally more approachable for the less specialised engineer or technician, where it seems logical that a positive output = ON. NPN circuitry wiring might make better sense to an electrical engineering expert, but it poses a greater risk. In the event that an NPN sensor output wire got frayed and somehow grounded, the PLC or controller would perceive this as an ON signal, which could potentially be hazardous.
In Europe and North America, the PNP sensor is used more frequently for PLCs as the inputs are more usually of the sinking type, whereas the opposite is more typical in Asian industry. Sourcing input cards require the NPN type of sensor which is less common in modern PLCs, but having the option of both provides the most flexibility.