# Interference beetween ADC samples with XBee and photoresistor

I'm using an XBee serie 2 module for sampling the values of three sensors, a photoresistor (LDR) a moisture sensor and a temperature sensor (LM35). When there is no brightness the photoresistor has the maximum value (1023), but if the environment is very very dark the value is the same 1023, but the other sensors begin to be instable giving values ​​greater than normal. Maybe an XBee ADC sampling problem? or could be a circuit problem?

The XBee module I'm using for sampling, use a cyclic sleep mode: it wakes for 100ms and stay sleep for 3 minutes.. I tried to use a greater wake time like 1s but the problem is always there.

This is the scheme:

simulate this circuit – Schematic created using CircuitLab

This is a picture: https://dl.dropboxusercontent.com/u/9029111/IMG_4712.JPG

I think it's a power problem, because if I put a 1Kohm resistence near R2 the moisture sensor is ok, and the temperature varies very little to vary the brightness

• Are all three sensors sharing a common ADC via a multiplexer? If so, try sampling the different inputs with a bigger time-gap between them – Andy aka Apr 28 '13 at 15:42
• Please be more accurate than giving values ​​greater than normal – jippie Apr 28 '13 at 19:43
• jippie, I mean that when there is brightness i have values like this: brightness=300, temperatur=440, umidity=150; and this is right; but when there is no brightness i have values like: brightness=1023, and temperatur=990 and umidity=1005. brightness is right because when it is dark the value is at maximum, but temperatur and umidity should stay with their original value – Nicola Apr 29 '13 at 8:58
• Andy aka, I don't know; im'using only an XBee module for sampling; i have only linked the sensors to the D0, D1 and D2 pin of the XBee module. – Nicola Apr 29 '13 at 9:02
• Please add a picture of your setup and a circuit diagram (hit Ctrl-M while editing your question). – jippie Apr 29 '13 at 9:14

Check the datasheet for the ATmega that is on your Arduino for 'ADC Noise Reduction mode.
Unfortunately, as far as I can see, you will have to write your own alternative for analogRead();` as the standard library seems not to support that the sleep command.