Testing the ZigBee Telemetry Link

We bench tested the XBee 802.15.4 OEM Modules to verify that they would perform as required and also to provide a platform for experimentation and gaining operational experience. The test setup consisted of the following parts:

qty description manufacturer part
2 XBee 802.15.4 OEM RF Module with Chip Antenna   Digi International   XB24-ACI-001
2 XBee USB Adapters Parallax 32400  
2 Mini-USB cables (for above)
1 2 KΩ 10-turn potentiometer
1 47 KΩ 1/8 W resistor
1 5 µF 10 V capacitor
1 prototyping board
1 digital volt meter (DVM)
1 oscilloscope
1 computer with USB support

There are several manufacturers and models available for Developer and USB Adapter boards. I consider the Parallax 32400 to be the best for this purpose because it is small, simple, and inexpensive. (It does, however, require some assembly and soldering.) It can be used readily with a breadboard because of the standard 0.100" spacing on the pins. It includes a regulator that can power the module from USB or from a separate 5 Volt supply.

Test Configuration

The basic test configuration consists of two XBee modules, one acting as data source (called XB1), and one acting as data sink (called XB2). The analog input of the XB1 module will be connected to a potentiometer and digital multimeter to provide an adjustable analog signal source. The analog output of the XB2 module will be connected to a simple RC filter and an oscilloscope to display the recreated analog signal. The signal voltage from the potentiometer will be digitized by the XB1 module, transmitted over the radio, converted back to analog by the XB2 module, and then displayed on the oscilloscope.

Analog to Digital (AD) Conversion Inputs

The XBee 802.15.4 OEM RF Modules each have six inputs that may be individually configured as an analog input or other function. When configured as an analog input, the module periodically samples the voltage at the pin and converts it to a 10-bit unsigned integer. The integer may be transmitted over the radio to other modules. The pins that service the analog inputs on the XBee modules are shared with other functions. The usage of each pin must be configured by sending a configuration command to the module to select which function a particular pin is to be used for. These configuration commands are generally done once and then saved in non-volatile memory in the module. This table shows the available analog inputs, the possible alternate uses for each pin, and the appropriate command to configure each pin as an analog input:

pin signal alternate uses configuration command
20 AD0 DI0, DO0 AT D0 2
19 AD1 DI1, DO1 AT D1 2
18 AD2 DI2, DO2 AT D2 2
17 AD3 DI3, DO3 AT D3 2
11 AD4 DI4, DO4 AT D4 2
15 AD5 DI5, DO5, AssocInd AT D5 2
16 DI6, DO6, ¬RTS  
12 DI7, DO7, ¬CTS, TxEna, ¬TxEna   

The pin that would be AD6 (pin 16) is documented in the pin assignment table of the product manual as ¬RTS/AD6/DIO6, however, it is shown as not being an option to configure this pin for analog input in the description of the D6 command. It appears that listing the pin as AD6 is an error and in fact it can not be configured as an analog input. The suspicion is confirmed by experiment: sending an AT D6 2 command to configure pin 16 as an analog input returns ERROR.

VREF Input Pin 

The VREF input (pin 14) tells the XBee module what voltage to consider as full scale in the analog to digital conversion process. The modules allow VREF to be any voltage between 2.08 Volts and the VCC supply (typically 3.3 Volts). In our test circuit, we will tie VREF to VCC so an analog input of 0.00 Volts should produce a digital output of 0x000, an analog input of 3.30 Volts should produce a digital output of 0x3FF, and linearly in between.

A note about VREF: the Digi International Product Manual talks about two reference voltages to control the behavior of the analog to digital converter, VREFH and VREFL, but there is only the VREF pin on the module. We were not able to find any description of how these signals map to one another, so we did some experimentation and concluded that VREFH is taken from the VREF input pin, and VREFL is tied to the GND pin. All of our experimental observations were consistent with this assumption. Please see the Digi International Product Manual for details of the analog to digital converter electrical characteristics.

AD0 Input Pin

In the following test circuit we use a precision potentiometer as a voltage divider to create an analog signal that we supply to the AD0 input (pin 20) of the XBee module. We use a digital volt meter (DVM) to monitor the AD0 voltage. This schematic shows the test circuit connected to AD0, with the digital volt meter probe point, DVM.

AD0 test harness schematic

Pulse Width Modulation (PWM) Outputs

The XBee 802.15.4 OEM RF Modules each have two analog outputs in the form of digital outputs that can be configured as Pulse Width Modulated (PWM) analog signals. PWM is a technique to create a desired analog voltage by turning a digital output on and off, varying the percentage of time (called the duty cycle) that the output is on, so as to produce the desired average voltage over time. In the case of the XBee modules we tested, the PWM outputs turn on and off at 15.625 kHz, or once every 64 µS. (Actually if the duty cycle is 0%, the output stays off, and if the duty cycle is 100%, the output stays on.)

PWM0 Output Pin

In the following test circuit we measure the PWM0 signal using an oscilloscope and a simple RC-network to filter out the pulses. CH1 is the raw PWM0 signal (pin 20) from the XBee module. CH2 is the PWM0 signal filtered by an RC-network consisting of a 47 kΩ series resistor, and a 5 µF parallel capacitor. This schematic shows the test circuit connected to PWM0, with the two oscilloscope probe points, CH1 and CH2:

PWM0 test harness schematic

The PWM signal switches between GND (0 Volts) and VCC (3.3 Volts) at 15.625 kHz, or one pulse every 64 µS. The XBee module automatically varies the percentage of time that the PWM0 signal remains high during each pulse cycle such that the average (mean) voltage on the PWM0 pin equals the desired analog signal level. In the snapshot, below, the oscilloscope shows the width of the pulse on the CH1 probe as 22 µS. If we calculate the duty cycle: 22 µS × 15.625 kHz = 34% duty cycle, then the expected average voltage: 34% × 3.3 V = 1.13 V, we see that the measured average of 1.06 V is reasonably close. Still looking at the oscilloscope snapshot, we see that the output of the RC-network at probe CH2 measures 1.03 V, which is also reasonably close to the expected 1.13 V value. The signal has about 400 mV peak-to-peak of noise. Closer examination (not shown) of the CH2 signal indicates that the noise is high frequency, possibly picked up from the CPU and radio, rather than 15.625 kHz ripple leaking through the filter, so we do not expect the noise to be a concern in the final circuit that will be constructed with shorter wire leads and more carefully chosen components. 

Tektronix screen shot