Pull-up resistor

Jan 09, 2004 2 Replies

Hi,



I'm learning about microcontrollers and I want to know what a pull-up resistor is and why do we need to "enable it" when switching a pin for input? Thanks!



Steve



Hi Steve,

When setting an I/O pin to input on a microcontroller this allows the controller to "see" changes in voltage on the pin. A high voltage (5 volts) is considered on, or having a value of 1. A low voltage (0 volts) is considered off, or having a value of 0. Your circuit will have to change the pin value from one value to another to be useful. This is where the pull up resistor comes in, the pull up allows the pin to default to a particular value. For example if you wanted to connect a switch to your circuit you could connect a 10K resistor to the input pin and directly to 5 volts, you could also connect the switch to the same pin and directly to ground (0 volts). This configuration would allow the pin to be normally "pulled up" to 5 volts and grounded when the button is pressed. Without the pull up resistor the input value could float and be either 1 or 0.

Alan

Thanks Alan :) That explains it

Steve

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required