Let's Make Robots!

Xbee ADC

Ok, so I'm working on a plan to bring my little brother's little Niko RC car (you know, these models that suddenly break down for no reason at all after three charges) back to life. The plan is:

  1. Yank out old electronics (fun job, done ^^)
  2. Test steering servo and current draw of drive motor
  3. Build new electronics

Basically, I'm going to refit the remote with two mini-joysticks and an xbee module. Now here's the thing: I've read that the xbee has onboard ADC's and I absolutely love this (no need for a microcontroller in the remote) but I can't seem to find a lot of info on how this whole system transmits it's data. With "transmitting it's data" I mean: what comes out at the receiving end and how can I read the ADC's output with my ARDUINO in the car (first time I'll be using arduino :D). Is there anyone here with any experience in this department?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

This link (see zigbee stuff near the bottom) has some arduino libraries for interfacing the zigbee API.  These two may each work:

  • xbee-arduino: an Arduino library for communicating with XBees in API (packet) mode. Supports I/O samples, TX/RX, AT Command, and Remote AT for both series 1 and 2 XBee radios
  • Arduino Xbee libraries, source and tutorials, supports all API command functions for series 1 and 2. (The above library looks solid as well, but I can't comment on the differences because of no experience with it. Posting in case there is not common overlap.)

What zigbee module are you using?  Something like this?  I suggest you check out the documentation for the user manual and datasheet on them- it looks well documented.

"UART Output:

When UART data is received the data is framed using our API structure. When the data is sent out the UART the data is automatically in API format, so the API doesn''''t need to be enabled. Notice how the data is listed from lesser ADC''''s to greater ADC''''s (ADC0 then ADC1 then ADC2 etc...). Below is an example of an API packet with ADC0 & ADC1 data:

7E 00 1C 83 56 78 22 00 05 06 00 00 00 03 FF 00 00 03 FF 00 00 03 FF 00 00 03 FF 00 00 03 FF 77



Where the UART API data stream can be broken down as:

7E
Start Delimiter
00 1C
Length Bytes
83
API Identifier Byte for 16bit A/D data (82 is for 64bit A/D data)
56 78
Source Address Bytes
22
RSSI Value Bytes
00
Option Byte
05
Sample Quantity Byte
06 00
00000110 00000000 Channel Indicator *
00 00
Sample Data ADC0 (min value for A/D is 00 00)
03 FF
Sample Data ADC1 (max value for A/D is 03 FF, indicating the value of ADC1 is Vref)
77
Check Sum

 

* bit field where the bits line up as (Ax=ADCx & Dx=DIOx):

 

MSB = 0x06
LSB = 0x00

 

0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0

 

NA
A5
A4
A3
A2
A1
A0
D8
D7
D6
D5
D4
D3
D2
D1
D0

"

----------------

I'm sorry but it just is not clear to me, can I read the ADC-value with the arduino, or should I let the xbee convert the ADC value into a PWM-value which is then read by the arduino via an analog input?

Well, yes, basically it's the same. I've read through the documentation but i's like chinese to me... I'll try to post an example of the ADC explanation, maybe you guys could translate it into understandable English for me :D