Xbee Analog problems

I’m having problems reading a temperature sensor using an XBee. I’ve managed to receive values just fine, the numbers just don’t make any sense. I’ve seen similar problems from other people online, but the symptoms I have don’t seem to match.

The temp sensor is connected to pin 20 of the XBee, which is configured as the only analog input pin. The XBee is set to send a single measurement every 20 seconds. The temp sensor is an AD22103, although I have the same problem with an LM34. The XBee is a series 1, 802.15.4 module.

With a voltmeter I get a reading of 0.8V which matches what I would expect based on the temperature in the room. The supply/reference voltage measures 3.27V. The raw value I get from the XBee is 1004, which seems to correspond to a reading of closer to 3.2V. If I connect pin 20 to the supply voltage, I get a raw value of 1020. Connecting to ground gives me a value of 0. These numbers stay consistent for 10s of readings in a row, with only very minor variations (± 2 in the raw value).

I’ve checked the pin connections through the breakout board and everything looks fine. I’ve switched pins on the XBee, I’ve swapped send and receive XBees with no change. Given that I’m getting very consistent values I’m not sure what else I can do to debug the problem.

Odd, all of your math looks correct. I believe that this is the values you receive out of the other XBee, The one with the Temperature sensor is sending to the other one.

Is the receiving XBee in AT or API mode? Could you post a copy of the complete raw data you get?

When you measure the sensor output as 0.8V is it connected to the XBee input?

Do you have the XBee’s internal pull-ups disabled on the pin set to ADC input? Just thought of this one and would explain your results.

You might think about, just for testing purposes, temporarily replacing the temperature sensor with a simple potentiometer, so that you can quickly confirm that the ADC output is tracking changes in the input voltage.

Is Vref connected to your +3.27V supply?

waltr:
Do you have the XBee’s internal pull-ups disabled on the pin set to ADC input?

This was it. Disabling the pull-up on pin 20 now gives me raw values of around 24, which makes a lot more sense. The math still doesn’t work out completely, but I’m assuming this is some type of high impedance problem with the temp sensor, which I’ve seen solutions for.

Thanks for the help!

Hi, i want to use the AD22103 sensor for my XBee, too.

Have you used the sensor like this?:

http://imageshack.us/photo/my-images/689/ad22103app.gif

Figure 1 from the AD22103 datasheet.