Published using Google Docs
Wireless Arduino Tutorial
Updated automatically every 5 minutes

Out of the box, two Xbees are able to pair up and send data wirelessly. However, at this workshop, there will be more than one pair of Xbees, so you will have to configure them to send data over their own network.

The Boring Bit: Configuration

Download Moltosenso’s Iron: http://is.gd/xbeeTool 

This app would allow you to configure an Xbee module. Now to hook up your Xbee to your computer, use the Sparkfun Xbee Dongle:

Attach an Xbee module onto this board and make sure the shape of the Xbee matches the printed outline. Then plug the whole thing into your computer’s USB port:

Open Iron and press “Scan” at the bottom of the window. The Sparkfun board should be recognized as tty.usbserial. Make sure “Flow Control” is set to None:

Now press “Open Port” and you should see something like “XBEE PRO...” listed under “Detected Devices.” Click that and then click “Node Settings” near the top of the window. Now click whatever is listed under “Module Selection.” Under “Parameters” look for “ID” under “Networking & Security” and type in your unique number between 0 and 65535 in the text bar on the right:

Click “Set” and click “Write Permanently” and then return to “Port Setup” to close the port.

Now repeat this for the other Xbee module.

Now you’re ready to wirelessly communicate!

Simply Serial

Now to interface our Arduino with the Xbee. First let’s set up the code, upload the following sketch into your Arduino:

void setup(){

  Serial.begin(9600);

}

void loop(){

  Serial.println(“Hi!”);

}

As you noticed, all it takes to communicate wirelessly is printing a string over Serial! You’ve probably done this before when having the Arduino communicate with the computer via USB. Well the Xbees acts like a wireless USB connection. The cool thing is, not only can you communicate with computer wirelessly, but other Arduinos as well!

Back to the hardware world, hook up one Xbee Dongle to the computer and plug the Wireless Proto Shield into your Arduino and then plug in one of your Xbee module on top of the shield. Again, make sure the shape of the Xbee matches the outline printed on the board.

Power the Arduino and you should see a green light turn on the Xbee Dongle. That’s the RSSI light, it means your Xbees are paired and sending/recieving data wirelessly. Open the Serial Monitor in your Arduino app (make sure you have the correct port selected) and you should see “Hi!” flooding the window.

Now you’re ready to make some wireless gadgets!

Ideas!

Since all we’re doing is sending data as Strings, anything is possible. Here are some ideas to get your creative juice flowing:

To learn more: