strange electric phenomenon

I have my arduino connected to my computer via USB running this code

void setup() 
{
  Serial.begin(9600);
}

void loop() {
  int sensorValue = pulseIn(A0,LOW);
  Serial.println(sensorValue, DEC);
}

I JUST have 1 hookup wire connected to the A0 pin. when I touch the wire (not even the metal the insulation ) I get all sorts of weird numbers. If i don't touch it I get 0 in the serial monitor.

here is a example of the numbers I get when touching the insulated wire (I am not touching anything else in fact I'm sitting in a leather chair on top of carpet,I am not touching the floor directly )

31818
14846
15047
14723
14861
14899
15828
14581
14508
14408
14445
14005
15325
14500
14442
14372
14258
14391
14614
14366
14315
14328
14252
13717
14145
14170
14086

When I touch the case of my computer it goes back to 0 in the serial monitor.
If I touch the metal on my desk I get numbers in the 7000's vs the 14000 in the above

That's [u]EMI[/u]. Your body picks-up electromagnetic radiation, mostly from the power lines all-around you and that signal can be capacitively coupled through insulated wire. Audio cables are [u]shielded[/u] for the same reason... Unshielded audio cables pick-up hum, and if you get the unshielded wire near a human body, a power line, or a transformer, the hum gets worse.

The solutions are to use a lower impedance input (if possible), and/or shielded cable, and/or a higher signal (if possible) for a higher signal-to-noise ratio.

When I touch the case of my computer it goes back to 0 in the serial monitor.
If I touch the metal on my desk I get numbers in the 7000's vs the 14000 in the above

Your computer case is grounded. That creates a low resistance (low impedance) path to ground which essentially "shorts out" the signal/voltage on your body. I assume your desk is not grounded and it is also picking-up electromagnetic radiation from all-around.

I also experienced a similiar phenomenon ONLY when I have the Arduino connected to the desktop: Odd analogRead results with USB power - Project Guidance - Arduino Forum and Earthing of Arduino Board - Project Guidance - Arduino Forum. The first one was an EMF detector that picks up voltage near ac appliances (due to capacitive coupling between the appliance and high impendance Arduino [due to ac]). When the Arduino was Earthed through the desktop, I experience the same phenomenon as you.

When you leave a pin floating, it picks up stray electrical noise. I wrote this tutorial and made videos of floating (and non-floating) pins with my scope:

http://www.cmiyc.com/tutorials/arduino-pull-ups/

James C4S:
I wrote this tutorial and made videos of floating (and non-floating) pins with my scope

How much voltage showed up on the oscilloscope while floating?

dkl65:

James C4S:
I wrote this tutorial and made videos of floating (and non-floating) pins with my scope

How much voltage showed up on the oscilloscope while floating?

10s or 100s of millivolts, I don't really remember.

I just turned my Tektronics 2213 on and I notice nearly a Volt PP when touching the end of my probe at my desk Uno in front of me running a sketch that displays text GPS data on a little 1.8" color TFT LCD... Lot of voltage for an unterminated input, especially when connected to the ground that most all computers except possibly a laptop represent. Unless they are analog it does no harm in my not so humble opinion to just pull them down or deal with them in the sketch. An open input is really an accident looking for a place to happen.

Doc