본문 바로가기

Electron

풀다운(Pull Down),풀업(Pull Up) 저항



  




저항값 계산 방법은 아래를 참고 하시면 됩니다.


Floating refers to a situation when it is difficult to tell the state of a pin that is not connected.  To prevent this unknown state, a pull-up or pull-down resistor will insure that the pin is in either a high or low state, while also using a low amount of current.  Pull-ups are more common than pull-downs.

pull-up resistor is connected to the high voltage (this is usually 3.3V or 5V and is often refereed to as VCC and the pull-down resistor is connected to ground.

With a pull-up resistor(figure above), the input pin will read a high state when the button is not pressed.  In other words, a small amount of current is flowing between VCC and the input pin (not to ground), thus the input pin reads close to VCC.  Keep in mind, if the resistor wasn’t there, your button would connect VCC to ground, which is very bad and is also known as a short.

The short and easy answer is that you want a resistor value on the order of 10kΩ for the pull-up.

A low resistor value is called a strong pull-up (more current flows), a high resistor value is called a weak pull-up (less current flows).

The value of the pull-up resistor needs to be chosen to satisfy two conditions:

1.  When the button is pressed, the input pin is pulled low. The value of resistor R1 controls how much current you want to flow from VCC, through the button, and then to ground.

2.  When the button is not pressed, the input pin is pulled high. The value of the pull-up resistor controls the voltage on the input pin.

For condition 1, you don’t want the resistor’s value too low. The lower the resistance, the more power will be used when the button is hit.

You generally want a large resistor value (10kΩ), but you don’t want it too large as to conflict with condition 2. A 4MΩ resistor might work as a pull-up, but its resistance is so large (or weak) that it may not do its job 100% of the time.

The general rule for condition 2 is to use a pull-up resistor (R1) that is an order of magnitude (1/10th) less than the input impedance (R2) of the input pin.  An input pin on a microcontroller has an impedance that can vary from 100k-1MΩ.  (*Impedance is just a fancy way of saying resistance)
The pull-up resistor R1 and input pin impedance R2 divides the voltage, and this voltage needs to be high enough for the input pin to read a high state.
A resistance of 10k to 100kΩ for R1 should avoid most problems.

How to calculate the size of the resistor (R1) when you want to limit the current to approximately 1mA where Vcc = 5V. ?