35
\$\begingroup\$

First, I acknowledge that there are several questions regarding this topic in the forum, however, the answers assume too much background knowledge of electronics to be of use to a true beginner (like myself). That being said, if you choose to answer, please limit your responses to heuristic (non-technical) explanations.

My understanding of a pull-up resistor, is to ensure a consistent charge on a line, as opposed to a disconnected line, which could potentially fall victim to electrical fields and then produce noise. The noise could then be interpreted as an input signal and cause unexpected results from your device.

Question 1) Am I correct in my understanding of the purpose of pull-up and pull-down resistors?

Question 2) How does this work? Can someone provide a metaphor or analogy to describe what exactly is taking place with the electrical current?

\$\endgroup\$

2 Answers 2

86
+50
\$\begingroup\$

First: Yes, your understanding is essentially correct, other than the issue being voltage and not charge.

Here is my analogy:

Consider a door to a house, with really smooth hinges, and no bolt or latch. The door is so light and so well-hinged that the slightest breeze would cause it to flap open and closed.

Now add a light door-spring to the door. The spring keeps the door shut, but not terribly firmly: A gentle push will open it, and letting it go will cause the door to close again.

A so-called "floating input" is like that door - the slightest perturbations in electromagnetic field, like the breeze above, will cause the input to randomly toggle between open and shut (low and high).

Add the pull-up resistor (if you want the default to be "high") or pull-down resistor (if you want it to be "low"), and your spring is in place.

Now, an external voltage applied, like the gentle push, can overcome the "keep the door shut" tendency of the spring / pull-x resistor - and once the push is removed, the input returns to the desired default value.

A low value resistor in such use is like a really stiff spring - it needs a much firmer push to open, but open it will. It will also slam shut faster when the push is removed.

\$\endgroup\$
7
  • 6
    \$\begingroup\$ I very much like you analogy. Should be very helpful to those trying to understand the concept. \$\endgroup\$ Feb 4, 2013 at 19:23
  • 2
    \$\begingroup\$ +1 Excellent analogy, this helps visualize the concept of pull-up and down resistors quite well. \$\endgroup\$
    – JYelton
    Feb 4, 2013 at 19:30
  • 4
    \$\begingroup\$ Answers like these are the gems of EE.SE ! \$\endgroup\$
    – bdutta74
    Apr 25, 2013 at 13:44
  • 2
    \$\begingroup\$ Damn those huge electronics books which don't explain like this !! Thanks a lot, you don't have any idea , how much time and pain this answer saved me.....my question here got downvoted , because i couldn't express the concept of float state properly, now i definitely have understood the concept because of this analogy.......if you have more of these AMAZING analogies, do share it with the community in Q&A style !! \$\endgroup\$ May 6, 2013 at 15:57
  • 4
    \$\begingroup\$ @AnindoGhosh you made us Indians proud.... Really informative one. Now i will never forget about pull up resistor or pull down resistor in my life \$\endgroup\$ Aug 26, 2014 at 10:35
15
\$\begingroup\$

A pull up/down does three things.

1, it stabilizes the line, with a fixed reference (V+ for a pull up, or Gnd for a pull down, in most cases). The line will not float around. This could also be done without the pull-up, by directly connecting it to V+ or Gnd. This is a problem, which part 2 fixes.

2, it protects the circuit. If a line is connected directly to V+, and then it is also connected to Ground, you just created a short circuit. This happens for example, if a microcontroller pin connected directly to V+, is set as an output with logic level low. With a pull-up resistor, you no longer have a short circuit, just a minor load. This is a safety you want in place.

3, it allows you to override the reference on the line, without the short circuit. Aside from just being a safety precaution, it is a desired effect. This is how a microcontroller can read a switch changing from high to low, or low to high, when pressed. When the button connected to Ground is not pressed, with a pull-up the microcontroller reads HIGH state. Once you press the button, the direct connection to ground causes the state to change to LOW instead, since a direct connection is stronger than a weak pull-up. Then it goes back to a HIGH state once the button is released.

@AnindoGhosh analogy of a swinging door is good for part 1 (The spring) and 3 (The push). To add to that, part 2 is the spring preventing a strong wind from slamming the door off the hinges and messing everything in your house up. No spring (Pull-up/down), and a strong wind (A short circuit) can destroy a microcontroller or cause a battery to overheat, catch fire, explode.

\$\endgroup\$

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