You are here: start » networkedobjects » xbeeworkshop

Xbee Post Workshop of Robert Faludi (Nov 11 2006)

So before going ahead and building my box with xbee, I built two arduinos on a breadboard and put two xbees on them to see where I am going from there.

img_9204.jpg

The wiring was pretty straightforward. Thanks to Rob Faludi we ordered breakup boards for xbees which makes everything easier. It is way much easier to placethem on a breadboard since the spacing is adjusted according to it with those breakup boards. Xbees have 10 pins on each side, if we are looking it from the front the vcc is top left and the ground is bottom left. They are low power devices and they want 3.3v of juice.

The rx and tx are left 2nd and 3rd pin. For the first test, I took the chip out of my arduino in order to use the usb to serial chip on the board and wired up two 22gauges from rx to rx and tx to tx of xbee. (The wiring is reversed since we don't have chip on the arduino board and reversing the connections. One problem I encountered was the common ground problem. Just make sure the serialtousb and the xbee are sharing the same ground.

So xbees have AT commands too. Here's the manual you are looking for.

So there are couple of things you have to do when you open up a serial connection to zigbee. First off, you might want to set an ID for the xbee module. This will make sure your data transfer is not interfering with others if you find an unique number for your id.

ATIDyournumber is how you set it. ATBD4 sets the baudrate to 19200 ATBD3 sets the baudrate to 9600

For a note, Zterm is pretty good at screening things. There are couple of tweaks you can do as well.

zterm go to connection> take local echo on Xon/Xoff off datarate to 9600 or whatever you are using.

terminal options autoline feed on.

Setting up those, you can see what you are typing and what you are getting on separate lines which comes handy at certain points.

After you are finished with setup, it is time to program our chip to send some values over zigbee to another one. For that I use Robert Faludi's code which he prepared for the workshop. They are well written and commented so I am linking them here:

So the code is straightforward. One Xbee is set up as a sender and the other one as a receiver. The sender is constantly checking out pin12 to see if the switch is closed or not, when it is closed it is sending the value “1” to the other xbee and when it is open it is sending “0”.

Couple of things about the wiring. In this setup, I didn't use any onboard usbtoserial adapter. Instead I kept on using arduino as my usbtoserial adapter and I program my chips on the breadboard through the arduino's serial rx/tx. So if you look ath the pictures closely, you are going to see that, there is to serials coming into to the rx/tx pins of atmel8.

Also I made sure to power the arduino externally and hook up power from there to the board to make sure the board and the breadboard are sharing the same ground. This worked perfectly.

img_9206.jpg

This page last modified on 2006/11/18 00:23.