Arduino board Digital I/O pin is reall sensitive help!

I just got my arduino board and I ran in to a sort of snag.

I loaded the button program on to it (I have the protosheild) I connected everything in the correct port and the led is on when the switch is off.

I then took the switch out and the light turned off, then I realized that if I move my finger near port 2 within 1cm the light turned. It also turns on when any object touches the wire.

Is this normal? And if so how do I tone down the sensitivity it seems to be sensitive to the slightest electrical signals.

Your program should enable the pullup resistor for the port pin(s) you are using. Such as

DDRB &= ~0x01 // bit 0 is an input

PORTB |= 1 // enable pull-up resistor for input mode

The pull-up resistor inside the AVR is, however, “high impedance” so there will still be some sensitivity, not much though as compared not enabling the pull-up.

Installing a lower value physical resistor to lower the impedance isn’t needed unless the switch is on a long wire. But it is commonly done.