Sinking and sourcing
The Core Idea
Sourcing and sinking describe the two sides of a direct current (DC) path. A sourcing connection supplies current from the positive supply, and a sinking connection provides its return toward 0 V. A working input circuit needs a complete path.
What you will learn
Trace a complete 24 V DC current path through a three-wire sensor and programmable logic controller (PLC) input.
Choose a compatible sensor output and input circuit, then explain an input that stays OFF even with a target present.
Distinguish an input circuit from the PLC's relay or transistor output choices.
Why it matters
A sensor and input can each work on their own yet fail to work together when their current paths do not match. Tracing the whole circuit makes the connection understandable.
The problem
A proximity sensor detects a part and feeds input IN0. The sensor's brown wire is connected to +24 V, its blue wire to 0 V, and its black output wire to IN0. The PLC input also has a COM (common) terminal. In this simplified circuit, the sensor's output switch closes when a target is present. IN0 is TRUE only when current flows through the input circuit.
| Signal | Meaning |
| Target present | A part is in front of the sensor; its output switch closes. |
IN0 | TRUE when the input circuit carries current, so the PLC reads the point ON. |
DETECTED_LAMP | TRUE commands an indicator lamp on after the program reads IN0. |
The target does not supply power by itself. For the input to turn ON, current needs a closed route from the supply's +24 V terminal, through the input circuit, back to 0 V. The diagram models one three-wire DC sensor and one DC input point; actual terminal labels and ratings vary by module.
Predict
The diagram starts with a sourcing sensor and a sinking input, with no target. Predict what happens when you place a target.
Place the target, then choose Trace the current step by step. Follow all five legs from the supply's + terminal back to its − terminal.
Try it
Use the diagram above. Start with no target and read Sensor output, Input COM, Across the input, and Input IN0. Place the target, then read them again. Trace the current one leg at a time. Remove the target to reopen the sensor's output switch; IN0 should return to OFF.
The PLC program sees the resulting bit, not a label saying “PNP” or “NPN,” the transistor types usually used for sourcing and sinking sensor outputs. In this separate simulator, IN0 BIT directly sets that bit. It does not simulate the sensor wiring. Turn IN0 BIT on and off and watch the indicator follow after a scan.
Look closer
In the wiring diagram, compare the black sensor output with input COM:
| Sensor output when active | Input COM | Result at IN0 |
| Sourcing output at +24 V | Sinking input COM at 0 V | 24 V across the input; current flows; ON. |
| Sinking output at 0 V | Sourcing input COM at +24 V | 24 V across the input; current flows in the opposite direction; ON. |
| Output and COM on the same rail | Same voltage at both ends | 0 V across the input; no input current; OFF. |
“Sourcing” and “sinking” describe what each device does to the current. The sourcing side supplies current from the + rail. The sinking side provides the path to the 0 V rail. The labels alone do not diagnose the circuit; the voltage and return path do.
Change it
In the first diagram, leave the target present and change only the PLC input to sourcing. Both the sourcing sensor's active output and the input COM are now at +24 V. Read Across the input and Input IN0. Then change the sensor output to sinking, leaving the sourcing input in place. Trace the current again. This time it begins at input COM, passes through IN0, enters the sensor's black output wire, and returns by the sensor's blue 0 V wire.
Return to the starting pair by choosing a sourcing sensor and sinking input and removing the target. If the result surprises you, change just one selector at a time and inspect the two voltages before reading the ON/OFF result.
In the simulator, try making DETECTED_LAMP follow the already established IN0 bit. This step is about the program after the input, not about fixing a wiring mismatch in code.
Check yourself
A sourcing sensor is powered and sees a target, but IN0 stays OFF. The sensor output is at +24 V, and the input COM is also at +24 V. Decide what one wiring choice would restore a path through the input before touching the diagram.
Start with the mismatched pair below. Change the input type, leave the target present, and trace the restored route. Then try the reverse compatible pair: sinking sensor with sourcing input.
Finally, make the separate indicator program follow IN0. The tests check input OFF, input ON, and the input opening again. You can retry and use the hints as often as you need.
Show the worked answer
For the field circuit, use a sourcing sensor with a sinking input, or a sinking sensor with a sourcing input. With the target present, trace conventional current from +24 V through the input and back to 0 V. A sourcing sensor paired with a sourcing input leaves its output and COM at +24 V; there is no voltage across the input. A sinking sensor paired with a sinking input puts both at 0 V, with the same result.
For the simulator, put one normally open IN0 contact before an ordinary DETECTED_LAMP output coil. The lamp follows the input bit. It cannot tell why an input stayed OFF; inspect the field circuit first.
What happened and why
There are two valid current directions through this simplified DC input. With a sourcing sensor and sinking input, current goes +24 V → sensor → IN0 → COM → 0 V. With a sourcing input and sinking sensor, it goes +24 V → COM → IN0 → sensor → 0 V. Either route can turn the input bit ON. When the target is absent, the modeled sensor output is open and neither route is complete.
When diagnosing an input that will not turn ON, inspect the path in order: sensor supply, target and output switch, output wire, IN0, COM, and the return rail. Compare the active output voltage with COM. If they sit on the same rail, this model predicts no current through the input even when the sensor detects the target. Real devices have voltage thresholds and wiring details that must be checked against their documentation.
A PLC output module is a separate circuit on the other side of the program. A relay output is a contact that opens or closes an externally supplied load circuit; the contact itself does not provide 24 V. A transistor output switches a DC load electronically and has a specified sourcing or sinking polarity. Those output choices do not change the sensor-to-IN0 current path we just traced. This lesson's indicator is a software observation, not a relay or transistor wiring design.
Common mistakes
Same-type pairing: The target is present but IN0 remains OFF because sensor output and input COM land on the same rail. Compare their voltages and choose an input with a return path.
Treating the target as the power source: The sensor detects the target, yet no current reaches IN0 when its supply or return path is missing. Trace the supply's + and − terminals through the whole loop.
Changing program logic first: The indicator stays OFF because IN0 never turned ON. Check the field input's current path before testing the program that reads the bit.
Confusing an output relay with a sensor output: A relay contact needs a separate load supply; it is not the three-wire sensor's black output. Identify which circuit is being traced.
Enable JavaScript to run the embedded simulator and complete the interactive exercises.