Posts

Showing posts with the label Floating Pin

Arduino DigitalRead Reading Wrong

Answer : What you have is called a Floating pin. Digital Input pins are very sensitive to change, and unless positively driven to one state or another (High or Low), will pick up stray capacitance from nearby sources, like breadboards, human fingers, or even the air. Any wire connected to it will act like a little antenna and cause the input state to change. And I mean any wire, the trace on the board, the wire to the breadboard, the breadboard pin, even the metal pin of the IC itself. This is refereed to in the Arduino reference page: If the pin isn't connected to anything, digitalRead() can return either HIGH or LOW (and this can change randomly). If you look at the Arduino Digital Pin Tutorial: This also means however, that input pins with nothing connected to them, or with wires connected to them that are not connected to other circuits, will report seemingly random changes in pin state, picking up electrical noise from the environment, or capacitively coupli...