zoukankan      html  css  js  c++  java
  • What Is the Difference Between the Terms Sinking and Sourcing?

    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.

    http://digital.ni.com/public.nsf/websearch/A10122C63A7F5CFE86256B4C007491DD?opendocument&Submitted&&node=133020_US

    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/bf4b2f3568cb0d7086256b8e006ee07c?OpenDocument

    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 1: Sinking Digital Output Circuit

    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.

    Figure 2: Sourcing Digital Output Circuit


    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

    When a sourcing input is connected to a sourcing output, a circuit with two voltage sources and one load is created. Since the input determines the "on" and "off" based on the voltage level at the input, a pull-down resistor needs to be added to pull the line to ground. Since having two voltage sources is a problem, there are two ways to configure the digital input's voltage source. The first is to give it the same source as the digital output. This is diagrammed in Figure 2
    Figure 2: Common Voltage supply. 

    In this case, the pull-down resistor must be sized so that when the sourcing Digital Output is off, the voltage at the digital input registers at a logic low. Use the load resistance of the digital input to calculate this value. Additionally, the resistor must be sized so as to not violate the current limits of the Digital Input device.

    The other case is to remove the supply voltage for the Digital input entirely. Figure 3 shows a diagram of this:

    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: 


    figure 2.jpgfigure 1.jpg

  • 相关阅读:
    PHPstorm配置xdebug问题小记
    PHP 实现遍历出目录及其子文件
    localStorage存、取数组
    关于用户体验
    PHP实现导出Excel文件
    js将一位数组分割成每三个一组
    vue 动态绑定背景图片
    父组件传值给子组件
    数组字符串 转化成 对象
    Vuex 页面刷新后store保存的数据会丢失 取cookie值
  • 原文地址:https://www.cnblogs.com/xavier/p/3023345.html
Copyright © 2011-2022 走看看