In this tutorial we will use two xBee (series 1) modules with the Arduino uno board. We will configure them to act as a receiver and transmitter to control the brightness of an LED wirelessly by using one potentiometer.
The xBee - series 1 - modules take the 802.15.4 stack (the basis for Zigbee) and wrap it into a simple to use serial command set. These modules allow a very reliable and simple communication between micro controllers, computers or other systems by using just a serial port!
They can communicate up to 300 Ft (~100m), they have 2.4GHz frequency , use the 802.15.4 protocol and have data rate up to 250kbps. They have also a 1mW wire antenna on them. They supports Point to point and multi-point networks.
You can see the result of this tutorial on the below video :
So, let's get started!
Download the XCTU software from here.
Run the program and connect the XBee Explorer USB board with your computer.
Click on the "Discover devices" icon to add your xBee in the XCTU software.
Now click on it (first image above) and set the CH field to e.g. "C" and the ID field to e.g. "1001". These values must be the same to all xBee modules to communicate with each other. Now as this xBee will be our transmitter, set the CE field as "Coordinator". If the baud rate isn't set to 9600bps, change it to this value.
Now click the "Write" button to save the changes in your xBee module.
Disconnect the xBee explorer board from your computer and connect the other xBee module on it.
Connect the explorer board with your computer again and follow the same procedure (second image above) but this time set the CE field as "End device".
Finally the configuration for our xBees must be:
For xBee transmitter:
For xBee receiver:
Here's the "xBee Transmitter" code, embedded using Codebender!
Try downloading the Codebender plugin and clicking on the "Run on Arduino" button to program your Arduino board with this sketch. And that's it, you've programmed your Arduino uno board with this sketch!
And here's the "xbee Receiver" code, connect the second Arduino uno board with your computer and press the "Run on Arduino " button.