I have a student creating a simple LED/Button project, and he claimed his LEDs were turning on/off as he put his hand near them. I thought it must be something wrong with his code/circuit at first but as I dissected his project the erratic behavior continued. I eventually took apart everything, and simply hooked a wire up to a digital pin, and printed the digitalRead from that pin. The wire went into an empty breadboard, and I still got readings of ‘0’ but readings switched to ‘1’ when I moved my hand near the wire at all(not touching it).
I thought I might need an external resistor going into the pin, but it’s not like there was any current flowing into the pin through the wire?