Sinking and Sourcing confused me for some time. It's so easy if you understand the theory.
The contents were cited from ni website. These two article were writen by NI company.
What Is the Difference Between the Terms Sinking and Sourcing?
Hardware: FieldPoint, Digital I/O (DIO), Compact FieldPoint, Multifunction DAQ (MIO)
|
Problem:
What is the difference between the terms sinking and sourcing?
Solution:
Sinking and sourcing refer to the type of digital inputs and outputs used. A sinking digital I/O (input/output) provides a ground. A sourcing digital I/O provides a voltage source.
Consider a simple circuit that consists of one digital input connected to a digital output. The circuit needs a voltage source, a ground, and a load. A sourcing digital I/O provides the voltage needed for the circuit. A sinking digital I/O provides the ground needed in the circuit. The digital input provides the load required for the circuit to work.
Figure 1 shows a sinking digital output that is connected to a sourcing digital input. In this circuit, the sourcing digital input provides the voltage and the load. The sinking digital output controls the line by using a transistor to leave the line high (at +V) or to ground the line to 0 V.
Figure 2 shows a sourcing digital output that is connected to a sinking digital input. In this circuit, the sourcing digital output provides the voltage and the sinking digital input provides the load and the ground. The digital output controls the line by using a transistor to leave the line at 0 V or to raise the line to +V.
Because you need both a voltage source and a ground in order to create a complete circuit, you need to have a sourcing input or output connected to a sinking output or input. If you wish to connect a sourcing input to a sourcing output or a sinking input to a sinking output, you will need to add an additional resistor. For further information on connecting two I/O of the same type, please refer to KnowledgeBase 2K0D6H5F attached in the Related Links section below.
Related Links:
KnowledgeBase 2K0D6H5F: Connecting Two Sinking I/O or Two Sourcing I/O Together
KnowledgeBase 3E6AIAFL: M Series Maximum Sink/Source Current Specifications for PFI, DIO and Counters
KnowledgeBase 1EPBH9LK: Can I Connect a Coil Relay Directly to my FP-DO-400 or FP-DO-401?
Connecting Two Sinking I/O or Two Sourcing I/O Together
Hardware: FieldPoint>>Discrete I/O Modules>>FP-DI-300, Multifunction DAQ (MIO)
|
Problem:
I have two I/O of the same type (i.e. two sinking or two sourcing). How can I connect them together?
Solution:
For a basic description of how sinking and sourcing I/O work, please refer to KnowledgeBase 2HOE7K5F: What Is the Difference Between the Terms Sinking and Sourcing?
To Connect a Sinking Input to a Sinking Output:
Since a sinking input connected with a sinking output has a ground and a load, but no voltage source, a voltage source needs to be added to the circuit. This can be done by adding a "Pull-Up" resistor between the output of the I/O to a voltage source. This will add the voltage source that would otherwise be provided by the sourcing I/O and a resistor to prevent the voltage source from being shorted to ground. Figure 1 shows how to connect the resistor and voltage source along with the sinking input and sinking output.
The resistor must meet two requirements. First, the resistance of the resistor must be high enough to provide an adequate load when the line is connected to ground by the sinking output. Second, the resistance has to be low enough to pull the line up from ground when the sinking output is off. Below are the calculations used to calculate the resistor value needed to use this circuit. These calculations assume that the voltage source is 24 V, a sinking input impedance of 5 kohms, a maximum current of 20 mA through the resistor, and a threshold of 3 V.
Calculating the minimum resistor value using V=I*R
- V=I*R
- R=V/I
- R=24 Volts / 20 mA =
1.2 kohm
- minimum resistance
Calculating the maximum resistor value using the voltage divided equation:
- Vn = Voltage at the node (Output)
- Vt = Voltage source
- R1 = resistance of the Sinking Input
- R2 = resistance of the pull-up resistor
- Vn=Vt*(R1/(R1+R2)) - Voltage divider equation
- R2=Vt*R1/Vn-R1
- R2=24 Volts * 5 kohm/3 Volts - 5 kohm =
35 kohmFor this setup, the resistor needs to be between 1.2 kohm and 35 kohm.
Note: The digital output shorts to ground (turns the transistor on) when a 1 is written to it. This will cause the digital input to go low and read a 0. When the Digital Output is off (0), the voltage source is no longer grounded and the digital input will go high and read a 1. This is will cause logic to be inverted (i.e. a digital input will read a 1 if a 0 is written and read a 0 if a 1 is written).
To Connect a Sourcing Input to a Sourcing Output
![](http://digital.ni.com/public.nsf/$CXIV/ATTACH-AEEE-943N8W/$FILE/sourcing%20to%20sourcing%20with%20common%20supply.png)
The other case is to remove the supply voltage for the Digital input entirely. Figure 3 shows a diagram of this:
![](http://digital.ni.com/public.nsf/$CXIV/ATTACH-AEEE-943N92/$FILE/sourcing%20to%20sourcing%20with%20one%20supply.png)
In this case, the pull-down resistor must be large enough to provide an adequate load when the line is connected to a voltage source by the sourcing output. The resistance of the resistor must also be small enough to prevent the line from "floating" (not being grounded) when the voltage source is disconnect by the digital output. Since there is not a voltage source attached to the digital input, the maximum resistance only needs to be high enough to prevent the leakage current from the transistor from pulling the line to V+. This value can be determined if the leakage current of the transistor is measured; however, since this current is so small, a resistance with a value less than 100 kohms should be more than sufficient. Below are the calculations used to calculate the resistor value needed to use the circuit in fig 3. The calculations below assume a source voltage of 24 V and a maximum current of 20 mA through the resistor.
Calculating the minimum resistor value using V=I*R
- V=I*R
- R=V/I
- R=24 Volts / 20 mA =
1.2 kohm
- minimum resistance
For this setup, the resistor needs to be at least 1.2 kohms and less than 100 kohm.
Related Links:
KnowledgeBase 2HOE7K5F: What Is the Difference Between the Terms Sinking and Sourcing?
Attachments: