Sinking sensors allow current to flow into the sensor to the voltage common, while
sourcing sensors allow current to flow out of the sensor from a positive source. For both of
these methods the emphasis is on current flow, not voltage. By using current flow, instead
of voltage, many of the electrical noise problems are reduced.
When discussing sourcing and sinking we are referring to the output of the sensor
that is acting like a switch. In fact the output of the sensor is normally a transistor, that will
act like a switch (with some voltage loss). A PNP transistor is used for the sourcing output,
and an NPN transistor is used for the sinking input. When discussing these sensors the term sourcing is often interchanged with PNP, and sinking with NPN. A simplified example
of a sinking output sensor is shown in Figure 4.3. The sensor will have some part that
deals with detection, this is on the left. The sensor needs a voltage supply to operate, so a
voltage supply is needed for the sensor. If the sensor has detected some phenomenon then
it will trigger the active line. The active line is directly connected to an NPN transistor.
(Note: for an NPN transistor the arrow always points away from the center.) If the voltage
to the transistor on the active line is 0V, then the transistor will not allow current to flow
into the sensor. If the voltage on the active line becomes larger (say 12V) then the transistor
will switch on and allow current to flow into the sensor to the common.
Figure 4.3 A Simplified NPN/Sinking Sensor
Aside: The sensor responds to a physical phenomenon. If the sensor is inactive (nothing
detected) then the active line is low and the transistor is off, this is like an open
switch. That means the NPN output will have no current in/out. When the sensor is
active, it will make the active line high. This will turn on the transistor, and effectively
close the switch. This will allow current to flow into the sensor to ground
(hence sinking). The voltage on the NPN output will be pulled down to V-. Note: the
voltage will always be 1-2V higher because of the transistor. When the sensor is off,
the NPN output will float, and any digital circuitry needs to contain a pull-up resistor.
Sourcing sensors are the complement to sinking sensors. The sourcing sensors use
a PNP transistor, as shown in Figure 4.4. (Note: PNP transistors are always drawn with the
arrow pointing to the center.) When the sensor is inactive the active line stays at the V+ value, and the transistor stays switched off. When the sensor becomes active the active
line will be made 0V, and the transistor will allow current to flow out of the sensor.
Figure 4.4 A Simplified Sourcing/PNP Sensor
Aside: The sensor responds to the physical phenomenon. If the sensor is inactive (nothing
detected) then the active line is high and the transistor is off, this is like an open switch.
That means the PNP output will have no current in/out. When the sensor is active, it
will make the active line high. This will turn on the transistor, and effectively close the
switch. This will allow current to flow from V+ through the sensor to the output (hence
sourcing). The voltage on the PNP output will be pulled up to V+. Note: the voltage
will always be 1-2V lower because of the transistor. When off, the PNP output will
float, if used with digital circuitry a pull-down resistor will be needed.
Most NPN/PNP sensors are capable of handling currents up to a few amps, and
they can be used to switch loads directly. (Note: always check the documentation for rated
voltages and currents.) An example using sourcing and sinking sensors to control lights is
shown in Figure 4.5. (Note: This example could be for a motion detector that turns on
lights in dark hallways.)
Figure 4.5 Direct Control Using NPN/PNP Sensors
In the sinking system in Figure 4.5 the light has V+ applied to one side. The other
side is connected to the NPN output of the sensor. When the sensor turns on the current
will be able to flow through the light, into the output to V- common. (Note: Yes, the current
will be allowed to flow into the output for an NPN sensor.) In the sourcing arrangement
the light will turn on when the output becomes active, allowing current to flow from
the V+, thought the sensor, the light and to V- (the common).
At this point it is worth stating the obvious - The output of a sensor will be an input
for a PLC. And, as we saw with the NPN sensor, this does not necessarily indicate where
current is flowing. There are two viable approaches for connecting sensors to PLCs. The
first is to always use PNP sensors and normal voltage input cards. The second option is to
purchase input cards specifically designed for sourcing or sinking sensors. An example of
a PLC card for sinking sensors is shown in Figure 4.6.
PLC Input Card for Sinking Sensors
Figure 4.6 A PLC Input Card for Sinking Sensors
The dashed line in the figure represents the circuit, or current flow path when the
sensor is active. This path enters the PLC input card first at a V+ terminal (Note: there is
no common on this card) and flows through an optocoupler. This current will use light to
turn on a phototransistor to tell the computer in the PLC the input current is flowing. The
current then leaves the card at input 00 and passes through the sensor to V-. When the sensor
is inactive the current will not flow, and the light in the optocoupler will be off. The
optocoupler is used to help protect the PLC from electrical problems outside the PLC.
The input cards for PNP sensors are similar to the NPN cards, as shown in Figure
PLC Input Card for Sourcing Sensors
Figure 4.7 PLC Input Card for Sourcing Sensors
The current flow loop for an active sensor is shown with a dashed line. Following
the path of the current we see that it begins at the V+, passes through the sensor, in the
input 00, through the optocoupler, out the common and to the V-.
Wiring is a major concern with PLC applications, so to reduce the total number of
wires, two wire sensors have become popular. But, by integrating three wires worth of
function into two, we now couple the power supply and sensing functions into one. Two
wire sensors are shown in Figure 4.8.
Figure 4.8 Two Wire Sensors
A two wire sensor can be used as either a sourcing or sinking input. In both of
these arrangements the sensor will require a small amount of current to power the sensor,
but when active it will allow more current to flow. This requires input cards that will allow
a small amount of current to flow (called the leakage current), but also be able to detect
when the current has exceeded a given value.
When purchasing sensors and input cards there are some important considerations.
Most modern sensors have both PNP and NPN outputs, although if the choice is not available,
PNP is the more popular choice. PLC cards can be confusing to buy, as each vendor
refers to the cards differently. To avoid problems, look to see if the card is specifically for
sinking or sourcing sensors, or look for a V+ (sinking) or COM (sourcing). Some vendors
also sell cards that will allow you to have NPN and PNP inputs mixed on the same card.
When drawing wiring diagrams the symbols in Figure 4.9 are used for sinking and
sourcing proximity sensors. Notice that in the sinking sensor when the switch closes
(moves up to the terminal) it contacts the common. Closing the switch in the sourcing sensor
connects the output to the V+. On the physical sensor the wires are color coded as indicated
in the diagram. The brown wire is positive, the blue wire is negative and the output
is white for sinking and black for sourcing. The outside shape of the sensor may change
for other devices, such as photo sensors which are often shown as round circles.
Figure 4.9 Sourcing and Sinking Schematic Symbols