# What is pull up and pull down on a pin?

I am not getting clarity on how pull up, pull down, and GPIO values work.

If a pin is input and pull up, does it make the value 1?

If a pin is input and pull down, does it make the value 0?

If the above assumptions are wrong then what is missing in my understanding? Image from the diagram on page 5 of this presentation.

• When you set a pin to "input with pull-up" then read the input, you will get a "1" for the value.
• When you set a pin to "input with pull-down" then read the input, you will get a "0" for the value.

This applies as long as nothing else is connected to the pin. When you connect something to the pin, then that something else can force the pin to a different value - that's kind of the point of it.

The pull-up or pull-down provides a default for the input when nothing is connected.

If you connect an input pin with a pull-up to ground, then current will flow out of the input to ground. It will be a very low current, likely less than one milliampere because the pull-up resistors are typically more than 10 kiloohms.

This really can be used to light LEDs when you don't have resistors handy to limit the current. More a sort of "party trick," though. It is exceedingly dim.

• If a pin is input and pull up, does it mean the if I connect this pin to ground, current will sink from this pin to ground and if an led is connected it will light up? So actually the pin is behaving as output? Jan 27 at 11:26
• It is not an output. It is an input. An input that will sink or source current through the resistance that is activated. Jan 27 at 11:57
• So if a pin is input and pull up (3.3V), then what can become an input here, 5V? What does input mean, to sink current into the pin? Jan 27 at 12:12
• Just to give context, pull up means connecting to VDD, i.e. 3.3 V generally, then how the current is very low when it is connected to ground? Or VDD is very less compared to 3.3 V usually. Jan 27 at 12:20
• For $V_{DD}$ = 3.3V and $R_{PU}$ = 10kΩ: when 0V is connected to the input, the current through the pull-up will be 330μA, which is sufficiently low. Jan 27 at 12:35