I've seen many microcontrollers use pull up or pull down resistors either as a setting for GPIO pins or as part of the hardware.

How do I know if I need a pull up or pull down resistor for a GPIO pin and if I do, how do I know which is right for my application?


3 Answers 3


You need a pull up or pull down resistor on a line of which the voltage level at least sometimes is "unpredictable" - for example, a floating input, but also an I2C line.

If you want the default of the line to be a digital 1, you use a pull up. If you want it to be a digital 0, you use a pull down.

A very typical example is a button. Suppose the software expects a pin to go down when a button is pressed. On the corresponding pin, you use a pull up and the button connects the pin with ground.


In final layout it is also strongly recommended to pull every unused pin to the appropriate level. Do not leave them not connected as it can cause unpredictable behaviour at start time or during the running program.


Whether you pull it up, or down, is really up to you and your project needs.

As mentioned prior

If your code is looking to trigger on a falling edge or a 0, you would want to use a pull up to keep the level high when unused.

If your code is looking to trigger on a rising edge or a 1, you would want to use a pull down to keep the potential at 0, util your external source pulls it up.

Now, pulling resistors should have a high ohmic value, enough to overcome the noise you need to eliminate, but not so strong that your external soucre can not overcome it.

Generally, by pulling down you will conserve a few mA of power.

Lets say we have a 5k pull up @ 5v, that is 1mA per pin; when running off of batteries, every mA is precious.

When we pull down, we are generally just burning off the EMF noise, consuming a negligible number of mAs.

  • $\begingroup$ wouldn't a pullup draw nominally no current when the line isn't driven low, and likewise a pulldown waste current when the line is driven high? $\endgroup$
    – John O'M.
    Jul 29, 2015 at 12:17
  • $\begingroup$ Typically a pull up/down resistor is just enough such that the desired "default" signal achieved, typicall Vin or Gnd. To that end, they are typically around 10k or there about, so if you drive the line HIGH while a pull down resistor is connected you only waste Vhigh/10k amps. If Vhigh is 5V, then that amounts to 0.5mA. $\endgroup$
    – Chuck
    Aug 23, 2015 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.