Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Analog readings on Arduino returns wrong values

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

like image 759
Casper Marcussen Avatar asked May 17 '10 17:05

Casper Marcussen


1 Answers

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).

like image 50
Yann Ramin Avatar answered Sep 19 '22 04:09

Yann Ramin