Led blinks without wiring up

So just got my Arduino and love the simplicity of it. I do encounter one problem though.

I have a simple code that flashes the led in pin 13 when a digitalRead in another channel (i used 9) is HIGH. So, when I wire up the 5V to channel 9, the led should blink. Not so hard is it.

But when I do not wire up the 5V to channel 9, and move my hand somewhere near the arduino... the led flashes. So there is some sort of static electricity around the board. See the not so clear youtube movie:


Anyone an idea how to get rid of this effect

With nothing connected to the input it is floating in a state that is almost midway between on and off. So when you hand comes near it has enough capacitance to change the state of the input even though its not touching anything. Floating inputs have been discussed here before and you should be able to find more info on this using google. The fix is simple. Ensure that input is wired up using a pull-up (or pull-down) resistor. You can find information on using resistors on input pins in the tutorials

ok, thanks very much for your reply. I could not find the correct word for it (i'm from the netherlands) so googling is a hard task then... This will help a lot.

Thanks again.

Simpler still use the internal pull up resistor.

Just write a HIGH to the digital input pin you want to use after initialising it as an input.