Electronic – When to use pull-down vs. pull-up resistors

microcontrollerpulldownpullupresistorsswitches

After learning and experimenting with microcontrollers, I've understood the concept of pull-up- and pull-down resistors. I now understand when and how to use them, and how they work. I've mainly used pull-ups because I was taught to, but it has always seemed a little backwards to me, as closing the switch sets the MCU input to LOW. I think it would make more sense to use a pull-down resistor, so that the input is LOW when the switch is open, but that is just my way of thinking.

Should I pull my single-throw inputs up or down? When is pulling down preferred over pulling up and vice versa?

Best Answer

The answer depends on what you want the "default" configuration to be. For example, say you have a down-stream N-channel MOSFET, and you want it default off. Then you would use a pull-down resistor to ensure this behavior if the input becomes high impedance.

schematic

simulate this circuit – Schematic created using CircuitLab

On the other hand, suppose you have an upstream P-channel MOSFET, and want it default off. This time a pull up resistor is required to create this behavior.

schematic

simulate this circuit

There's also the alternative case where you want a device to be default-on, in which case the above two cases would be reversed (pull-up for the N-channel MOSFET, pull-down for the P-channel MOSFET).

A few other considerations:

  1. I2C lines specify pull-up resistors because devices are "expected" to have an open-drain to ground, and thus need some way to raise the line potential.

  2. Analog comparators are usually configured as open-drain devices, and thus also need pull up resistors to get a high potential output.

  3. You may draw more current using pullup/pulldown resistors, depending on what's hooked to the input/output.

  4. Either configuration could works equally well in your application (i.e. there's no significant advantage one way or the other).

... And any number of very application-specific reasons why one configuration may be preferred.