I was playing around with my Arduino Uno when I realized incorrect results for the analogRead() command: values were in the 200s when my sensor was off. At first, I thought that my Uno had broken. Then I figured that it was a problem with the insulation on the bottom of the board, where the Uno was soldered together. When I placed my fingertip on the bottom of the analog pins, they gave accurate results (it printed 0 when my sensor was off). I tried covering it up with electrical tape. That didn't work. Can someone please suggest an effective method for insulation?? Will the Arduino Uno case be okay??
What sensor, and what do you mean with "off".
A disconnected (floating) analogue pin will return a value of about 200-300. Normal behaviour.
To properly help you we need more info.
Read the "how to post" sticky, that you can find on top of every main page.
Leo..
Sorry for the lack of specificity. I was trying to use an rf receiver for a rc vehicle project. I found inaccuracy. So I hooked the pin up to a pushbutton. That is what I meant by "off".
If 200 to 300 values are normal, how does one reduce that kind of noise??
Also, for testing the analog input, I used this program:
const byte pushbuttonPin = A5; // button between pin and ground
void setup() {
pinMode(pushbuttonPin, INPUT_PULLUP); // enable internal pull up, so you don't need an external pull up resistor
Serial.begin(9600);
}
void loop() {
int val = analogRead(pushbuttonPin); // bit silly to analogRead a switch that can only be on or off
Serial.println(val);
delay(10);
}