9
\$\begingroup\$

I understand the basic use of a pull-up or pull-down resistor, including the specific case of using it with a tact switch.

When both are an option I was wondering whether I should favor one over the other and if so, why?

\$\endgroup\$

3 Answers 3

8
\$\begingroup\$

Some times you can gain a reduction in current by choosing one over the other. For a momentary switch this would not be the case.

If all other things are equal I would favor a pull-up resistor. Some microcontrollers (like the Atmega series) have inputs that can be configured with an internal pull-up. Using only pull-ups (internal or external) does provide some consistency.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ I normally favor a pull up as older devices and some very very low power devices will have a state they favor for power saving. This is often the high state. \$\endgroup\$
    – Kortuk
    Commented Apr 19, 2010 at 9:47
5
\$\begingroup\$

One advantage not yet mentioned for using pull-ups rather than pull-downs is that when using a pull-up, one end of the switch must be tied to ground; when using a pull-down, it must be tied to VDD. Exposing ground or VDD means there's some possibility something else might get shorted to it. Generally, shorting something to VDD is apt to be more damaging than shorting it to ground. Further, exposed connections run the risk of electrostatic discharge; discharge into VDD is often more damaging than discharge into ground.

\$\endgroup\$
2
\$\begingroup\$

When both are an option I was wondering whether I should favor one over the other and if so, why?

If both are a option, then I like to ground stuff. It just feels better since ground tend to have less noise (even thou this is not always true)

\$\endgroup\$
3
  • \$\begingroup\$ By ground you mean a pull-down resistor so the input will default to being grounded and flip to 5V when the switch is pressed? \$\endgroup\$
    – Redwood
    Commented Apr 19, 2010 at 6:38
  • 2
    \$\begingroup\$ Yes, that is what he means. Often people use a ground plane but not a power plane in hobbyist projects. this leads to ground being a much lower impedance path. My issue with this is simple, i would rather have the switch connect to a very low impedance path and the resistor to the higher impedance path as this will lead to smother transitions when buttons are pressed and less transients imposed on nearby devices using power. \$\endgroup\$
    – Kortuk
    Commented Apr 19, 2010 at 9:45
  • 4
    \$\begingroup\$ To expand on this, decoupling capacitors should be on your board, a nearby decoupling capacitor will act as a power source for the surrounding area to higher frequency transients, the allowing the switch to see the same impedance regardless of the net it is connected to. \$\endgroup\$
    – Kortuk
    Commented Apr 19, 2010 at 9:46

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.