Circuit design · Inputs: buttons, pull-ups, noise

Internal pull-ups and long wires

The pull-up built into a pin is free and fine beside the chip, but a long cable or a noisy neighbor beats it.