When hooking up switches or buttons to an Arduino I/O pin, sometimes the results might appear completely random. Sometimes it will appear as though there is a delay from when the button is pressed until the state of the pin actually changes. Other times the pin’s value will seem to randomly fluctuate from HIGH to LOW. Even more maddening might be as your finger gets closer to the switch, the pin’s state changes! The fix to these problems is simple: use the Arduino Internal Pull-up Resistor. Here’s how they can fix this problem and how you can use them with an Arduino board.