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?
Answer
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.
No comments:
Post a Comment