I have rigged up a basic circuit as follows: Fritzing image
The XBee is a Pro, series 2. It is configured as a Router using the AT firmware. Pin 20 (D0) is configured as an analog input. There is a co-ordinator XBee running the Co-ordinator API firmware.
When I measure the TMP36 using a multimeter, I can see a voltage of 0.752. However, the XBee is returning values of around 30 at the same time. I have a basic Python script (using the XBee Python API) running that grabs the data and outputs it as follows:
You need to wire-up VREF (Pin 14) before youāll get any useful values from the A/D. I usually tie it to VCC.
Of course, youāll also need to parse the packet for a value for āadc-0ā , then convert it to an actual voltage using V=(VREF)(adc-0)/1023, and finally a temperature using T= (100)(V) - 50.
Thanks for your reply. I understand the series 2 XBees have an internal VREF, so that shouldnāt be necessary.
I think iāve tracked the issue down to the power supply. When running the circuit from batteries, the reading is much more accurate. I think the USB explorer must be introducing some noise along the way. Iām now looking at wiring up a circuit with a voltage regulator to see if thatās more reliable.
Interesting, Iām currently using a 3V Lithium Battery Powered XBee S2C TH with the MCP9700A Temperature Sensor. I have also found that the XBee ADCās are giving me strange inaccurate results.
Iāve contacted the Digi Tech Support and they inform me the ADCās have a ±20mV Error which translates to ±2 DegC which is totally unacceptable.
Iām hoping the Digi Engineers will add a ADC calibration routine to eradicate the ±20mV error into a Firmware upgrade some time soon.
Iāve created my own ADC calibration routine using linear equation y=mx+c which works well but Iād prefer Digi to solve it in a more elegant way.
Hi man I have a question for you, I am a new xbee user, I got 2 xbee s2c, and I want to know if I can transmit from one of the xbee modules the data get from a temp sensor to the other xbee without any microcontroller (Arduino, raspberry pi, etc). I mean like set a periodically transmission of analog values
Sure you can. You just need to make sure you get the right sensor. Some output an Analog voltage that is 0 - 1.2V, others 5V and still others UART data.
Yes Iām using the MCP9808 I2C temperature sensor instead of relying on the ADC accuracy. Iāve heard that the Xbee ADC issues have now been solved by DiGi but I havenāt had time to revisit this project as I endid up using the ESP8266.
I had the same problem with LM35. I was using a 5V/120 mA power supply and then the analog input values were totally crazy. So I needed to replace the 120mA supply for a bigger one, in my case I had another one of 3A.
As to the calculation I made a circuit adjustment as you see bellow and the formula (AD05100)/1024.