Overview


With a pull-up resistor, 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. When the button is pressed, it connects the input pin directly to ground. The current flows through the resistor to ground, thus the input pin reads a low state. 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.

A pull-down resistor works in the same way but is connected to ground. It holds the logic signal near zero volts when no other active device is connected.

Why do we use them?

Using a pull-up or pull-down resistor ensures that we have with a HIGH or LOW value at the pin. Without, we would have a floating value. Always use a pull-up or pull-down with a button to ensure state.

References

ReferenceURL
Spark Fun - Pull Up Resistorshttps://learn.sparkfun.com/tutorials/pull-up-resistors
  • No labels