Making a Robot With Arduino Part 4: The ZigBee Setup
November 19, 2011 by sweemeng · Leave a Comment
For this project we use zigbee series 2, which is both a good thing and a bad thing.
The good thing is, it have more capability. The bad thing is, you rely on x-ctu to configure the zigbee. While it is easy, the problem is, most our member in the space, uses mac, or linux. x-ctu only support windows, to work on linux/mac, one need to configure it on wine. I suppose that it is possible for someone to program it with the serial command sequence. I didn’t see it online on how. There is plenty for the old zigbee though.
Now enough x-ctu rant. Yours truly do have a windows machine fortunately. First get the software here.
Now, I don’t have FTDI for zigbee, so I modify an arduino for it. Here I use a duemilove, just unplug the arduino microcontroller(the long IC). Notice the missing microcontroller? This is so that the usb will send the command to zigbee instead of the atmega microcontroller. Notice the toggle on the zigbee top right, that is the toggle switch for telling it to read from the serial interface. If you move all the toggle switch the the right, you telling it to take over as the arduino serial interface.
If you have a seeeduino, upload the following sketch.
void setup() { DDRB=0; DDRC=0; DDRD=0; } void loop() { }
Now start x-ctu, now test for the zigbee. Click on test
There is a few configuration for zigbee, we just use 2, one is the Coordinator, the other is the Router/End Device. Multiple router will connect to a coordinator. While we have only 2 zigbee, it really doesn’t matter for now. So I just put the Router on the robot.
First set one for Coordinator. First click on read. Under Modem XBee, select XB24-B, Function Set ZIGBEE COORDINATOR AT
Then we go down to NI, Node Identifier, click on it, there will be a set, click on it. Put a name, here I just put Coordinator. Once you done, click write on the top of the application. You are done.
We are done. For the Router, next do the same, but Change from COORDINATOR AT to ZIGBEE ROUTER/END DEVICE AT
Again set the name, like above, here I just set ROUTER =.=
We are done for zigbee, pretty easy with X-CTU, and the default just works. Now we can plug the router for the robot and coordinator to empty arduino. The arduino code already have the delay necessary for the zigbee command receive or send properly. On the robot, the toggle switch on the top right, all go to the right, now the robot thinks the zigbee is the serial interface.
Bonus Material:
You can do serial command on the zigbee, you can find out more here ftp://ftp1.digi.com/support/documentation/90000866_A.pdf
We use xbee shield from seeestudio with the zigbee. It is pretty good, except inside it says toggle the seeeduino to 3.3v when use. For other arduino, no such toggle exist. It is actually fine, because the shield actually already have a regulator to convert 5V into 3.3V. The robot which uses seeeduino, also run on 5V Because the motor driver.







