Analog readings on Arduino returns wrong values

Casper Marcussen picture Casper Marcussen · May 17, 2010 · Viewed 18k times · Source

I have tried measuring the analog pin value using the provided standard sketch in the Arduino IDE. However even when there is no connection to the pin, it prints out random values. Is there anything that has to be taken care of?

I have a FSR sensor connected from 5V+ to analog pin 0

Answer

Yann Ramin picture Yann Ramin · May 17, 2010

No connection giving you random value is completely expected. The pin is floating, and may or may not have a charge on it at any time, giving random values.

Attach the analog input to ground - it should return a number approaching zero (within the accuracy and noise of the ADC).