Let’s take that example. If we try to read the voltage at v1, with our ATtiny micro-controller, surprisingly we can’t tell what the voltage will be.
It may be at 0 Volts, sometimes, and 2.9 Volts or 4 Volts at other moments.
It’s voltage is undefined and varies depending on what surrounds it, like any electromagnetic field.
This is what is called high impedence.
Of course, if you push the button, then V1 will be at 5V but you will also short the power source and it can be very dangerous!
Pull-up and pull-down resistors are used to have a defined voltage in an open circuit.
Now, with that pull-up resistor, the voltage at V1 will be of 5 Volts as long as the button is not pressed.
Once we press the button, the voltage at v1 becomes 0 Volts since it is now connected to ground and the pull-up resistor takes all the voltage for itself!
You may now have an idea of what a pull-down resistor is about.
Exactly! It’s used to make sure the voltage at V1 will be at 0 Volts as long as the button is not pushed.
Look at this diagram and see how the pull-down resistor is not located at the same place as the pull-up resistor was.
That’s the trick!
So, what we need to remember is that:
– A pull-up resistor is used to have a (logical) high voltage when the circuit is open.
– A pull-down resistor is used to have a 0 Volts voltage when the circuit is open.