Lilypad USB Pin 9 goes high without being connected in a circuit

Hello

This is my first arduino project and I was trying to test a simple program that uses pin 14 as an output to an LED and Pin 9 as an input for a button. The program simply waits for pin 9 to go high when the button is pushed. My issue is that i connect the LED from pin 14 to the negative power port, and when I just touch pin 9 with either my bare finger or a piece of stripped wire the pin acts as if it has gone high and runs the program to blink the LED for roughly 5 seconds and then stop. So I know that my program sort of works, but I am unsure why pin 9 goes high when it is not connected to the negative port on the board and is activated when touched by a finger or wire in my hand. If need be I can post my code on this thread. Any help would be much appreciated.

-womtom

womtom:
but I am unsure why pin 9 goes high when it is not connected to the negative port on the board and is activated when touched by a finger or wire in my hand.

You're coupling "stray AC" (it's all around us, everywhere) into the input pin.

ou need pull up or pull down resistors, see:-
http://www.thebox.myzen.co.uk/Tutorial/Inputs.html

Your body acts as a big capacitor and it can be charged to a quite high voltage. You have no doubt noticed that you can produce a spark by touching a grounded object after you have walked across a rug.

As Grumpy-Mike says add a pull down or up resistor to avoid the false high states

Use the internal pullup, and look for a low instead:

pinMode (9, INPUT_PULLUP);

then
if (digitalRead (9, LOW){
// do whatever
}