一世n this post we are going to explore pull-Up resistor and pull-down resistor, why they are commonly used in electronic circuits, what happens to electronic circuits without Pull-Up or Pull-down resistor, and How to calculate Pull-Up and Pull-down resistor values and finally we will see about open collector configuration.
How Logic Inputs and Outputs Work in Digital Circuits
一世n digital electronics and most microcontroller based circuits the involved digital signals are processed in the form of logic1 or logic0, i.e. “HIGH” or “LOW”.
数字逻辑门成为任何数字电路的基本单元,通过利用“和”,“或”,“不是”门我们能够构建复杂电路,但如上所述,数字门可以只接受两个“高电平的电压电平”“和”低“。
The “HIGH” and “LOW” are generally in the form of 5V and 0V respectively. “HIGH” is also referred as “1” or positive signal of the supply and “LOW” is also referred as “0” or negative signal of the supply.
Problems arise in a logic circuit or a microcontroller when the fed input is somewhere in the undefined region between 2V and 0V.
在这种情况下,逻辑电路或微控制器可能无法正确识别信号,并且电路将产生错误的假设并执行。
Generally a logic gate can recognize the signal as “LOW” if the input is below 0.8V and can recognize the signal as “HIGH” if the input is above 2V. For microcontrollers this can actually vary a lot.
未定义的put Logic Levels
The problems arise when the signal is between 0.8V and 2V and varies randomly at the input pins, this issue can be explained with an example circuit using a switch connected to an IC or a microcontroller.
Assume a circuit using a microcontroller or an IC, if we close the circuit, the input pin goes “LOW” and the relay turns “ON”.
如果我们打开开关,继电器应该转动“关闭”吗?那不是真的。
We know that the digital ICs and digital microcontrollers only takes input as either “HIGH” or “LOW”, when we open the switch, the input pin is just open circuited. It is neither “HIGH” nor “LOW”.
The input pin must be “HIGH” in order to turn the relay off, but in the open situation this pin becomes vulnerable to stray pickups, stray static charges, and other electrical noise from surrounding, which can cause the relay to go ON and OFF randomly.
To prevent such random triggers due to stray voltage, in this example it becomes mandatory to tie the shown digital input pin to a “HIGH” logic, so that when the switch is flipped off, the pin automatically connects to a defined state “HIGH” or the positive supply level of the IC.
To keep the pin “HIGH” we can connect the input pin to Vcc.
在下面的电路中,输入引脚连接到VCC,如果我们打开开关,则将输入“高”保持“高”,这防止了随机触发继电器。
你可能会想到,现在我们解决了解决方案。但是没有......还没有!
根据该图,如果我们关闭开关,将有短路并关闭整个系统。您的电路永远不会具有比短路更糟糕的情况。
短路由于电流非常大的流过低电阻路径,燃烧PCB痕迹,熔断熔丝,触发安全开关,甚至可能对您的电路造成致命损坏。
为防止如此重电流流动并在“高”条件下保持输入引脚,我们可以利用连接到VCC的电阻,即在“红线”之间。
一世n this situation the pin will be in a “HIGH” state if we open the switch, and on closing the switch there won’t be any short circuit, and also the input pin is allowed to directly connect with the GND, making it “LOW”.
一世f we close the switch there will be negligible voltage drop via the pull-Up resistor and rest of the circuit will remain unaffected.
必须最佳地选择上拉/下拉电阻值,以便它不会通过电阻绘制过量。
Calculating Pull-Up Resistor value:
To calculate an optimum value, we have to know 3 parameters: 1) Vcc 2) Minimum threshold input voltage which can guarantee to make the output “HIGH” 3) High level input current (The required current). All these data are mentioned in the datasheet.
让我们借用逻辑NAND门的示例。根据其数据表VCC是5V,最小阈值输入电压(高电平输入电压V.一世H) is 2V and High level input current (I一世H)是40 ua。
By applying ohm’s law we can find the correct resistor value.
r = vcc - v一世H (MIN)/ 一世一世H
在哪里,
VCC是工作电压,
V.一世H (MIN)is HIGH Level Input voltage,
一世一世His the HIGH Level Input Current.
Now let’s do the matching,
R = 5 - 2 / 40 x 10^-6 = 75K ohm.
我们可以使用最多75k欧姆的电阻值。
NOTE:
该值计算在理想条件下,但我们不住在理想的世界中。为了获得最佳操作,您可以将电阻略低于计算值,例如70K,65K甚至50k欧姆,但不足够降低电阻,以至于上述示例的2020欧姆的巨大电流。
Multiple gate Pull-Up resistors
一世n the above example, we saw how to pick a Pull-up resistor for one gate. What If we have 10 gates which all are need to be connected to Pull-Up resistor?
One of the ways is to connect 10 Pull-Up resistors at each of the gate, but this isn’t cost effective and easy solution. The best solution would be connecting all the input pins together to single Pull-Up resistor.
要计算上述情况的上拉电阻值,请遵循以下公式:
r = vcc - v一世H (MIN)/N x I一世H
“n”是门的数量。
您会注意到上述公式与前一个公式相同;唯一的区别是乘以门的数量。
So, let’s do the math again,
R = 5 -2 / 10 x 40 x 10^-6 = 7.5K ohm (maximum)
现在,对于10个NAND门,我们通过比一个NAND门(在前面的示例中)高10倍的方式获得电阻值,使得电阻能够在峰值负载下保持最小2V,这可以保证所需的输出没有任何错误。
You can use the same formula for calculating Pull-Up resistor for any application.
Pull-Down Resistors:
上拉电阻使销如果没有“高”put is connected; with Pull-down resistor, it keeps the pin “LOW” if no input is connected.
通过将电阻连接到地代替VCC来制造下拉电阻。
The Pull-Down can be calculated by:
R = V一世L (MAX)/ 一世一世L
在哪里,
V.一世L (MAX)是低电平输入电压。
一世一世L是低电平输入电流。
数据表中提到了所有这些参数。
r = 0.8 / 1.6 x 10 ^ -3 = 0.5k欧姆
我们可以使用最多500欧姆电阻进行下拉。
但再次,我们应该使用小于500欧姆的电阻值。
Open collector output / Open Drain:
当IC无法驱动输出“高”但只能驱动其输出“低”时,我们可以说一个引脚是“开放收集器输出”。它只是将输出连接到地面或与地面断开连接。
我们可以看到IC中的开放收集器配置如何。
Since the output is either ground or open circuit, we need to connect an external Pull-Up resistor which can turn the pin “HIGH” when the transistor is OFF.
This is same for Open drain; the only difference is that the internal transistor inside the IC is a MOSFET.
Now, you may ask why do we need an open drain configuration? We need to connect a Pull-Up resistor anyway.
Well, the output voltage can be varied by choosing different resistor values at the open collector output, so it gives more flexibility for the load. We can connect load at output which has higher or lower operating voltage.
一世f we had a fixed pull-up resistor value we can’t control the voltage at the output.
One disadvantage of this configuration is that, it consumes huge current and may not be battery friendly, it need higher current for its correct operation.
让我们拍摄IC 7401开漏逻辑“NAND”门,看看如何计算上拉电阻值。
We need to know the following parameters:
V.OL(MAX)which is the maximum input voltage to IC 7401 which can guarantee to turn the output “LOW” (0.4V).
一世OL(MAX)which is the Low level input current (16mA).
V.cc is the operating voltage which is 5V.
So, we here we can connect a Pull-Up resistor value around 287 ohm.
Have any questions? Please use the comment box below to express your thoughts, your queries will be replied ASAP
如何将XL6009重新拉动下拉下拉在XL6009降压助推器上?我找到一个图表的地方?
Why would you need a pull up or pull down resistor in xl6009?