My $0.05 solution to this problem is as following. As people earlier in the thread have indicated the arduino itself has a multiplexer and only one ADC. Problem occurs when flipping between different voltage sources that they introduce transient which takes a while to disappear. Source of the transient is the input capacitance of the ADC and its huge input resistance (hence the large time constant).

This said, of 6 input channels of arduino, I take one - say A0 - and through a 5k resistor I ground it. Then, before I try to read any other analog channels, I first connect the ADC to the ground by reading from A0.

!!Code snippetanalogRead(A0); // dummy read to discharge ADCdelay (20); // wait a littleanalogRead(A1); // now hook up ADC to the channel we really want to readdelay (20); // doze a littletemp = 100*(analogRead(A1)*5/1025 -0.5); // now read once more !!End of code snippet

With this approach I was able to read 4 additional analog inputs - in my case these were 4 x TMP36 temperature sensors at rate 50, or so, milliseconds per sensor.

I'm having a similar problem. I'm running a photoresistor and a TMP36 and logging the data on an arduino. The temperature sensor is fine but the photoresistor is very noisy. Any tips?

Details, the photoresistor is in a voltage divider with a 1K resistor (the lower resistor is there to increase the range). I've tried the tricks suggested and then some, here's an excerpt of code for example:

The ground pin is a 5K resistor tied to ground to try and flush the ADC cap between measurements. The 6th order polynomial is my attempt to get an accurate lux measurement from one of these sensors. (I calibrated using an OLED taped to the top of a dremel tube and a lux meter)

CdS cells are fairly slow, but the fluorescent flicker could be part of the problem. You can minimize the 60Hz flicker and other noise as well by taking the average of multiple samples over some multiple of 16ms. If you are only logging once per second, you have plenty of time to take multiple samples.

I have arduini uno board, seeeduino wifly-shield http://www.seeedstudio.com/wiki/Wifi_Shield and extension DFRduino shield. I need to send results from IR and Ultra Sound length-meters via WiFi on PC, just making a robot.

void setup(){ Serial.begin(9600);//use the hardware serial to communicate with the PC bool wifi = true; if(wifi){ Wifly.init();//Initialize the wifishield Wifly.setConfig("MyWiFi","12345678");//here to set the ssid and password of the Router Wifly.join("MyWiFi"); Wifly.checkAssociated(); while(!Wifly.connect("192.168.137.1","40020"));//connect the remote service Wifly.writeToSocket("Connected!"); }}

If i set wifi = true, then sensors show me some rubbish, every pin shows value is about 1010, and does not change on differenr ranges.But when I set wifi = false, i.e. do not do wifly initialisation, everything works propally. I found that priblem in function WiFly.init() which do the next:

Just registered here to say thanks for the informative thread. Had stability issues reading only a single TMP36 with my Uno while working on a smart web-enabled thermostat project where I would like to keep the temperature with 1 degree F.

I used the mentioned solution of just taking many samples and finding an average. In my case I'm sticking with 64 samples. Speed isn't a big issue as even with the over-sampling all other project functions seems responsive (web server, user parameter parsing, NTP time synchronization, etc).

Without this fix I would get swings of multiple degrees. With 16 samples it still wasn't to my liking. 64 seems to do the trick.

I'm using the default 5v reference, with power from USB. TMP36 current on breadboard via some cheap jumper cables.

Seems for my Uno that would be 1.1V. If my arithmetic is correct, with a TMP36 (.5v offset and 10mV per degree C) I can still measure up to 60 degrees C, or 140 degrees F. This would be plenty for my home thermostat project.

Of course in all of the above I'm ignoring other noise sources like stray capacitance and unshielded cables that have been discussed earlier, but I'm willing to take what I can get while keeping external parts/connection to a minimum.