Newbie's Analog input problems - please help

Hello folks,

I have an Arduino Diecimila (A Freeduino equivalent, actually), and I am having a lot of trouble getting a stable analog input.

The drawing below shows 2 experiments I did:

http://picasaweb.google.com/glman74/NutsAboutElectronics#5354455408700776946

I am just printing to the serial port and using the serial monitor to see the values.

int val = 0;       

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

void loop() {
  val = analogRead(0);    
  Serial.println(val);
  delay(100);
}

With the 10K Pot, I am getting values in the range 300 to 700. The values are never steady.

With LM 35, the multimeter shows a reading of 240 mV at the center pin, which I am guessing corresponds to 24 degrees Celsius, which seems right for my room. But the analog values being printed are close to 400 range, which seems wrong by a factor of 10.

Why I am I not able to get values in the 0-1023 range with the pot? I'd appreciate any help with this as I have been stuck with this for several weeks.

Could this be due to some interference with the USB connection to the laptop? Also, when I put my hand close to the board, the analog values fluctuate wildly.

Based on what I read online, I tried a few ideas, none of which worked:

  • Switched to a separate 9V supply.
  • Added a 47 K pull down resistor at analog pin 0.
  • Tried averaging values.
  • Pulled out most of my remaining hair. ;-)

I'd appreciate any help with this.

Best Regards

MV

You don't need or want a pull down resistor on the analog input. Try connecting to a different analog pin. Too much voltage (more than 5 volts) can damage the input circuit and if this had happened you would get the symptoms you are seeing.

Thanks for your response.

On a whim, I tried an analogRead() on all pins. I was amazed to see correct results on pin 5 - i. The order of analog pins printed on the (Freeduino) board is wrong (reversed). Everything works now. I've notified the manufacturer and they have agreed to correct the mistake.