I have an ethernet shield on top of a Duemilanove. I have a battery and potientiometer set up so that between ground of the battery, and the middle pin of the potientiometer is a fixed voltage between 0 and 5 V. I have one of the ground pins of the arduino connected to the ground of the battery. The arduino is currently powered by a USB connection. When I connect either analog pin 0 or 1 to the center pin of the potentiometer, I get a value of about 343. When I connect any of analog pins 2 through 5 to the middle pin of the potentiometer, I get about 43. I checked the voltage with a voltmeter while I was doing this, and the values reported by the analog ports actually match up with what the voltage is as each pin is connected. My question is why does connecting pins 0 and 1 change the voltage while the other pins are reading the correct value?
I believe some (all?) ethernet shields use some of the analog pins for communications. If you continue with your experiment you probably should either remove the shield or ensure none of the analog pins are used by the shield.
Are the other pins connected to the ethernet shield also? Might be used as D14-D15 & pulling them low?
Thanks for the quick replies. I tried removing the ethernet shield and doing the same check with just the arduino. The analog pins all report the correct value. I checked the ethernet shield site http://www.arduino.cc/en/Main/ArduinoEthernetShield and didn't see anything about analog pins 0 and 1 being used for anything. I was using the ethernet shield initially to use the micro SD card for data logging, with the thought that later I'd try to figure out how to hook it up to the ethernet to collect the data, either from the SD card or as it is collected. For now I can just not use pins 0 and 1. An interesting note is that when the pins should have reported about 43 they reported about 343, but if I connect them to arduino ground, they report zero (when the ethernet shield is connected). Thanks again for the suggestions.
Check the voltage on the 5v pin while the ethernet shield is attached. My arduino with a w5100 has lower than 5v when powered from my laptop USB port.
An interesting note is that when the pins should have reported about 43 they reported about 343, but if I connect them to arduino ground, they report zero (when the ethernet shield is connected). Thanks again for the suggestions.
Analog pin 0 & 1 in use on ethernet shield, they wired as Write Protection & Detect signals. I'd not recommend to connect them to ground, when shield is attached to board. :~