Weird voltage spikes in analog input

Hi, I'm using this arduino code:

const int ledPin = 7;
void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}
void loop() {
int sensorValue = analogRead(A4);
float voltage = sensorValue * (5.0 / 1023.0);
Serial.println(voltage);
if (voltage == 5.00) {
digitalWrite(ledPin, HIGH);
}
else {
digitalWrite(ledPin, LOW);
}
}

And this circuit layout:

When using this I am getting a lot of weird voltage spikes as shown below. As far as I can tell this shouldn't be happening while the switch is closed and I'm starting to wonder if I have a defective arduino somehow. Help is much appreciated.

Well, the IDE reference states:

"If the analog input pin is not connected to anything, the value returned by analogRead() will fluctuate based on a number of factors (e.g. the values of the other analog inputs, how close your hand is to the board, etc.). "

So that should be your first area of inquiry.

Why are you doing an analogRead of a switch in the first place? Is it going to be half-on?

Thank you, I think this is what I need to do. Too bad I don't have any 10k resistors...

EDIT:

I'm really proud of myself for thinking of this, I used my body as a pull down resistor and it worked perfectly!

The Arduino inputs have internal pull up resistors that you can enable.

aarg:
The Arduino inputs have internal pull up resistors that you can enable.

As mentioned in my thread. Wire between the input and Gnd. Enable the pull-up. Use a digitalRead. Then it should work fine.