# XBee ADC value has a 10mV difference

**URL:** <https://forums.digi.com/t/xbee-adc-value-has-a-10mv-difference/14260>\
**Category:** XBee - 802.15.4\
**Tags:** xbee-pro-s2b, adc, measure-voltage\
**Created:** [January 28, 2015, 5:26am UTC](https://forums.digi.com/t/xbee-adc-value-has-a-10mv-difference/14260 "2015-01-28T05:26:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![geurtsen](https://avatars.discourse-cdn.com/v4/letter/g/22d042/32.png) [@geurtsen](https://forums.digi.com/u/geurtsen)\
**Post date:** [January 28, 2015, 5:26am UTC](https://forums.digi.com/t/xbee-adc-value-has-a-10mv-difference/14260/1 "2015-01-28T05:26:59Z")

</div>

Hello,

I have a XBee S2B router which send its ADC values to the coordinator (once every minute)

When there is a low Voltage value on the pin, below 10mV it is seen always as 0. (did this test with a few different Xbee’s).  
When the input on the ADC is above 10mV the ADC gives numbers above 0.

A few examples of ADC measurements:  
used (ADC/1023)\*1.2 to calculate the voltage from the ADC.

68.4mV Multi meter; ADC 49 =\> 57.5 mV  
300.7mV Multi meter; ADC 248 =\> 290.9 mV  
928.0mV Multi meter; ADC 783 =\> 917 mV

Firmware version Router: 22A7

Using the [https://pypi.python.org/pypi/XBee](https://pypi.python.org/pypi/XBee) XBee-2.1.0 library to readout the frames/values.

My question is why does the ADC does not detect values below 10mV and why are the ADC readings 10mV lower?

Thanks!  
Jasper

---

<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:** [January 28, 2015, 8:24am UTC](https://forums.digi.com/t/xbee-adc-value-has-a-10mv-difference/14260/2 "2015-01-28T08:24:50Z")

</div>

Jasper, what is the actual API frame provided from the radio?

---

<div class="post-metadata">

**Author:** ![geurtsen](https://avatars.discourse-cdn.com/v4/letter/g/22d042/32.png) [@geurtsen](https://forums.digi.com/u/geurtsen)\
**Post date:** [January 28, 2015, 10:46am UTC](https://forums.digi.com/t/xbee-adc-value-has-a-10mv-difference/14260/3 "2015-01-28T10:46:50Z")

</div>

Hi mvut, thanks for your question.

7E 00 14 92 00 13 A2 00 40 B4 E3 54 55 FB 01 01 00 00 81 03 0F 0A CC D2

```
- Start delimiter: 7E
- Length: 00 14 (20)
- Frame type: 92 (Zigbee IO Data Sample RX Indicator)
- 64-bit source address: 00 13 A2 00 40 B4 E3 54
- 16-bit source address: 55 FB
- Receive options: 01
- Number of samples: 01
- Digital channel mask: 00 00
- Analog channel mask: 81
- Analog sample: 03 0F 0A CC

```

* * *

So two samples first one ADC-0 (030F) second one ADC-7 (power level, 0ACC).  
030F = 783

783/1023\*1.2= 918.4 mV  
multiemeter gives 927mV

Still around 10mV difference.

Thanks,  
Jasper

---

<div class="post-metadata">

**Author:** ![geurtsen](https://avatars.discourse-cdn.com/v4/letter/g/22d042/32.png) [@geurtsen](https://forums.digi.com/u/geurtsen)\
**Post date:** [January 28, 2015, 11:32am UTC](https://forums.digi.com/t/xbee-adc-value-has-a-10mv-difference/14260/4 "2015-01-28T11:32:28Z")

</div>

and an other sample with low Voltage, below 10mV:

Zigbee IO Data Sample RX Indicator

7E 00 14 92 00 13 A2 00 40 B4 E3 54 55 FB 01 01 00 00 81 00 00 0A CC E4

```
- Start delimiter: 7E
- Length: 00 14 (20)
- Frame type: 92 (Zigbee IO Data Sample RX Indicator)
- 64-bit source address: 00 13 A2 00 40 B4 E3 54
- 16-bit source address: 55 FB
- Receive options: 01
- Number of samples: 01
- Digital channel mask: 00 00
- Analog channel mask: 81
- Analog sample: 00 00 0A CC
- Checksum: E4

```

So this gives 00 00.

The multimeter give: 5.4mV

Thanks,  
Jasper

---

<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:** [January 28, 2015, 11:37am UTC](https://forums.digi.com/t/xbee-adc-value-has-a-10mv-difference/14260/5 "2015-01-28T11:37:09Z")

</div>

Jasper, you can see with the actual API frame that you are not getting a 0 value. If you calculating a 0 value from the 00 0A CC value, then there is an issue with your Code and not the radio.

---

<div class="post-metadata">

**Author:** ![geurtsen](https://avatars.discourse-cdn.com/v4/letter/g/22d042/32.png) [@geurtsen](https://forums.digi.com/u/geurtsen)\
**Post date:** [January 28, 2015, 4:42pm UTC](https://forums.digi.com/t/xbee-adc-value-has-a-10mv-difference/14260/6 "2015-01-28T16:42:16Z")

</div>

mvut thanks for the quick reply.

This frame has two ADC value, I believe it should be read like this:

- Analog channel mask: 81
- Analog sample: 00 00 0A CC

00 00 = ADC-0 (should be 5.4mV)  
0A CC = ADC-7 (Supply voltage High Threshold V+)

* * *

Below I took a new sample frame without ADC-7 (Supply voltage High Threshold V+):  
Zigbee IO Data Sample RX Indicator

7E 00 12 92 00 13 A2 00 40 B4 E3 54 55 FB 01 01 00 00 01 00 00 3A

```
- Start delimiter: 7E
- Length: 00 12 (18)
- Frame type: 92 (Zigbee IO Data Sample RX Indicator)
- 64-bit source address: 00 13 A2 00 40 B4 E3 54
- 16-bit source address: 55 FB
- Receive options: 01
- Number of samples: 01
- Digital channel mask: 00 00
- Analog channel mask: 01
- Analog sample: 00 00
- Checksum: 3A

```

So this give ADC-0=00 00  
and my multi meter gives 9.3mV

Thanks,  
Jasper

---

<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:** [January 29, 2015, 1:20pm UTC](https://forums.digi.com/t/xbee-adc-value-has-a-10mv-difference/14260/7 "2015-01-29T13:20:02Z")

</div>

Jasper,. the only thing I can think of that would cause this is if you had the lines switched and are actually providing a negative voltage. In that situation, the value would be 0.
