I've been using Arduinos for years but one thing I have just taken for granted without understanding is why, for example, in a simple button circuit using the internal pullup, you connect the button to ground rather than 5V.
But now I'm trying to teach my kids and they have me stumped and I'd really like a good answer that even a kid can understand (and hence me as well). I've spent the last 2 hours reading articles on the internet but no one has explained it like I'm a 5th grader.
A simple LED control circuit with a pin set to OUTPUT treats the pin like a voltage source - and the circuit connects to GND.
It would seem logical (to a 5th grader) that when the pin is set to INPUT, it's "receiving" the voltage, hence acting like GND, but as we all know this is definitely not the case.
So what exactly is happening at the pin when set to INPUT or INPUT_PULLUP that allows it to "read" the voltage level while still acting like the voltage source?
CLARIFICATION: the question is not about why a pullup (or pulldown) resistor is needed, but more about how the pin can "read" voltage (when set to INPUT) even as it's "sourcing" 5V, as in the button shorting to ground example.