The Arduino Digital Read Serial tutorial guides you through the wiring of a simple button. My questions are centered around the resistor.
Why is the resistor necessary?
I think I understand this, but correct me if I am wrong. To ensure that the input pin reads a low signal, and does not float, we should connect the pin to ground when the button is not pushed. When the button gets pushed, we will have a 5V signal flowing to both the pin and to ground. Kirchhoff's voltage law states that total voltage in closed loop must equal zero, so we have to deal with this 5V that is flowing directly to ground. That is why we put a resistor between the button and ground.
How was the resistor value chosen?
This is what I am unclear on. Ohm's law states that...
resistance = voltage / current
This is a 5V supply and the Arduino Uno spec says that the pin provides 40 mA of DC current. So..
resistance = 5V / 0.04A = 125 Ohms
In the Digital Read Serial tutorial, why do we have a 10K Ohms resistor? That is way overkill, right? Which leads to another question: Can you ever put too much resistance in place, if your only goal is to obliterate voltage?
Thanks in advance for any feedback!