XBee is a wireless module that supports Zigbee protocol, allowing the development of microcontroller networks.
The datasheet is in the following link
Materials
To get your first xbee tutorial working, you'll need the following materials
- USB Explorer Dongle
- XBee interface
- Two XBee radios
You'll need a way to program the XBee chip. Either of the following options will work 
https://www.sparkfun.com/products/9819
https://www.sparkfun.com/products/8687
If you decide to get the second product, make sure you have a micro USB cord

https://www.sparkfun.com/products/9819
https://www.sparkfun.com/products/8687
If you decide to get the second product, make sure you have a micro USB cord
Either of the following product should work
Just make sure that you also include headers! The can be found at the following url
https://www.sparkfun.com/products/9280
https://www.sparkfun.com/products/9280
You'll need to get two XBee radios since they use a P2P protocol to communicate. You'll also want to consider if you'll use Series 1 or Series 2. You'll also want to consider if you want to get a XBee PRO. For more details on the differences between these two, look at the following link
It is highly recommended to start off with the Series 1 model since the Series 2 models is supposed to be much harder to configure.
Testing your XBee
Plug one of your XBees into the USB Explorer Dongle. Make sure that you get your orientation right, otherwise you could brick your XBee. The correct orientation is outlined on the USB Explorer Dongle
You'll then need to program your XBee from your computer. I'd recommend using X-CTU for a start.
Before using the X-CTU program, make sure that one of your XBees is plugged into the USB Dongle Explorer in the proper orientation and the USB Dongle is connected to the computer.
Then highlight the modem configuration tab, it should look like as follows
Click Read to read all of the specs for the device. Make sure to set the ID, DL, and MY flags. ID is the PAN ID, which is the ID of the entire network that your XBees are operating in. The DL is the destination address, which is the address of the other XBee radio. The MY is the address of the XBee currently plugged into the radio. Because I'm using only a Series 1 XBee radio, there can only be 2 XBees in each network. In my case, I set ID=1111, DL=1000 and MY=1001.
When you are done configuring the values, make sure that you press Write to finalize your changes. Then unplug your XBee and plug in your other XBee. Follow the same procedure except switch around DL and MY. In my case, I let ID=1111, DL=1001 and MY=1000
Once you have your XBee Radios configured, leave one of your XBee radios in the USB Explorer Dongle into the computer and plug in the other XBee radio into the Arduino shield. Make sure that the 3.3V and GND pins are connected to their corresponding pins in the Arduino. Then have a wire connecting the DIN and DOUT pins on the Arduino shield. To test to see if everything is working, highlight the Terminal tab in X-CTU tab and type some gibberish on the keyboard. If you set everything up correctly, then you should get something like this.
RGB code
Getting this example to work uses pretty much the same setup as the previous tutorial. Instead of wiring the DIN and DOUT pins together, wire the DIN and DOUT pins to the RX and TX pins of the Arduino. Make sure you don't mix up these pins.
The source code can be found at the following link under "Cable Replacement"
Good luck!
Troubleshooting
If your input is not being properly echoed back on the screen
1) Check your wiring. Make sure that none of the pins are bent.
2) Double check your XBee orientation - it should align with the outline marked in the shield
3) Double check your addresses to make sure that none of the addresses are the same
Comments
Post a Comment