# Problems using XBee S2C ADC Channels

**URL:** <https://forums.digi.com/t/problems-using-xbee-s2c-adc-channels/15636>\
**Category:** XBee & XBee Gateway\
**Tags:** adc, s2c, analog, xctu, xbee\
**Created:** [October 23, 2015, 7:59am UTC](https://forums.digi.com/t/problems-using-xbee-s2c-adc-channels/15636 "2015-10-23T07:59:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndyDale](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@AndyDale](https://forums.digi.com/u/AndyDale)\
**Post date:** [October 23, 2015, 7:59am UTC](https://forums.digi.com/t/problems-using-xbee-s2c-adc-channels/15636/1 "2015-10-23T07:59:47Z")

</div>

I’m having problems using XBee S2C ADC Channels?

I’m trying to make sense of the results I’m getting from my ADC when measuring voltage.

The documentation suggests using the formula found on page 131 of the XBee / XBee-PRO ZigBee RF Modules User Guide PN: 90002002 T

I/O Sampling - Convert A/D reading to mV

0x0000 represents 0 V  
0x3FF = 1.2 V

AD(mV) = (A/D reading \* 1200mV) / 1023

I’m using XCTU v6.2 Console to view the results and I’ve tied the A0 to Gnd 0V using a 1K resistor the output shows 0x010. Strange! When I tie the A0 to VCC 3.3V VCC using a 1K resistor the output shows 0x3FF. Great!

The Formula is wrong or my ADC is wrong or XCTU is wrong. Which is it?

If it’s the formula, could I have the correct one and the documentation needs updating?  
If it’s the ADC then what do I do?  
If it’s the XTCU then what do I do?  
My updated formula to Convert A/D reading to mV

0x010 (16 Dec) = 0mV  
0x3FF (1023 Dec) = 1200mV

ADC\_Offset = (1023-ADC)\*(16/(1023-16))

AD(mV) = ((ADC\_reading - ADC\_Offset) \* 1200mV) / 1023

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [October 23, 2015, 9:03am UTC](https://forums.digi.com/t/problems-using-xbee-s2c-adc-channels/15636/2 "2015-10-23T09:03:19Z")

</div>

Try disabling the internal pull up resistor command (PR) and see if that fixes it.

---

<div class="post-metadata">

**Author:** ![AndyDale](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@AndyDale](https://forums.digi.com/u/AndyDale)\
**Post date:** [October 25, 2015, 9:42pm UTC](https://forums.digi.com/t/problems-using-xbee-s2c-adc-channels/15636/3 "2015-10-25T21:42:21Z")

</div>

Thanks for the response but the ADC\_readings are still not the expected 0x00 when A0 it is tied down to GND 0V.

All Pull-up resistors are disabled. RP = 0  
D0 is set to ADC(2). D0 = 2

A0 (Pin 20) is connected directly to 0V (GND). I’ve also connected and disconnected VRef to VCC but it doesn’t seem to change anything.  
I’ve tested this on 5 separate XBee S2C units and ALL are showing me that there is a problem.

I’m also using various test rigs: 3V Battery, 3V Bench PSU, USB Adapter, Arduino UNO Shield and Arduino NANO Shield.

Test Results:  
1, XBee S2C PCB, XB24CZ7PIT-004, VCC=3v3, A0=0V, ADC\_Reading=0x10  
2, XBee S2C RP-SMA, XB24CZ7SIT-004, VCC=3v3, A0=0V, ADC\_Reading=0x12  
3, XBee S2C U.FL, XB24CZ7UIT-004, VCC=3v3, A0=0V, ADC\_Reading=0x15  
4, XBee S2C WIRE, XB24CZ7WIT-004, VCC=3v0, A0=0V, ADC\_Reading=0x11  
5, XBee S2C WIRE, XB24CZ7WIT-004, VCC=3v3, A0=0V, ADC\_Reading=0x12

I’m using the latest version of XCTU v6.2 on a Windows 7 (64bit) Workstation.  
All XBees are currently loaded with the latest Firmware Version 4059. I initially completed the test on Firmware Version 4055 but installed the latest hoping the ADC problem would go away but it didn’t and the results stayed the same.  
I’m currently having to individually calibrate each XBee unit by setting A0=0V and plugging the resulting ADC\_reading into my ADC\_Offset formula.  
Clearly there is a problem with the ADS Readings what do I do next?

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [October 27, 2015, 9:33am UTC](https://forums.digi.com/t/problems-using-xbee-s2c-adc-channels/15636/4 "2015-10-27T09:33:36Z")

</div>

I would suggest mounting the radio on an XBIB board and seeing what you get. After all that is what Digi Tech support is going to ask you to do if you were to contact them.

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [October 27, 2015, 9:34am UTC](https://forums.digi.com/t/problems-using-xbee-s2c-adc-channels/15636/5 "2015-10-27T09:34:45Z")

</div>

I would also want to see the full API frame you are receiving on XCTU to verify that it is not an issue with your code.
