If you have a 5V power source connected with a switch in between to a pin without a ground, when the switch is open (or off), you can have electrical noise travel on the floating wire on the pin (Point to the wire that is only connected to the pin.) The pin will read the voltage of the noise. Noise can come from nearby wires, static electricity etc. The pin reads the noise as input and could potentially if there is enough noise voltage going across the open switch, the pin would read the switch as closed even though it really is not.

If you connected the pin to the ground without a resistor, when the switch is closed, the pin will read the input voltage in the case of an arduino of 5V. When the switch is open, the pin will read 0 volts. With out the ground, the floating voltage could be as high as 5V and the pin’s reading would be the same as if the switch was closed. The input voltage (5V) naturally goes to the ground because the ground has the least resistance but this all results in a short circuit.

To prevent the short caused by the connection to the ground, what we need is a pull down resistor.

To prevent pin from reacting to unintentional noise and shorting our circuit, we use pull down resistors. Think about the metaphor of a person jumping off a building 900 feet off the ground and then falling straight down or hitting a mattress after falling 400 feet and then falling another 400 feet to hit another mattress before hitting the ground.

Pull down resistors are resistors that have a high resistance value that are attached to the ground. (There are online calculators that can help you to determine what resistor to use, but typically people use 10K resistor as a pull down resistor.) What happens even though it may seem counter intuitive is that the pull down resistor drops the voltage coming from the power source that is attracted to the ground which has to be connected to the switch to prevent noise.

Think symbiotic relationship. The pin needs to be grounded so it does not give erroneous readings and the ground needs the resistor to when the switch is closed to prevent a short circuit. Think Farmer in Dell. The pin takes the ground; the ground takes the pull down resistor so the farm does not blow up.

There are also pull up resistors where the high resistance resistor is placed after the powers source. A pull up resistor is used on switches that prevent voltage to flow when they are open instead of closed.