But… what is XBee…
Yes… you’re right, first things first. XBees are small wireless modules which implement, depending on the model, several RF protocols, the “major” one being ZigBee (thus the name !) You can find details here on Digi’s website.
Take care, there are several modules. I’ll be using XBee ZB Series 2 modules. You’ll find an XBee RF modules comparison here. As there are quite a few sites describing XBees , I won’t get into details in this post but rather refer to Sparkfun’s XBee buying guide which is covering XBee, ZigBee and Bumblebee 🙂
XBee & SoftwareSerial
Using XBee module with an Arduino is quite well documented… but examples often use the hardware UART making it not simple to program or debug because the UART is shared by the Arduino IDE and XBee chip.
So I thought I use SofwareSerial instead just as I did for one of my Wifridge version.
I used an XBee breakout board from www.droids.it I bought from Lextronic. It is handy as you can use it with 2.52mm pitch headers (XBee won’t fit directly into a breadboard !) and it has 2 operation LEDs.
Connection is quite straightforward :
- 3.3V on Vin
- GND on… GND
- Tx on pin 7
- Rx on pin 8
Rx and Tx pins can easily be changed in the program anyway.
Then, upload an AT firmware onto XBee module, upload this program onto the Arduino… and you should get something like that on your Serial Monitor into Arduino IDE :
XBee config :
Getting in CMD mode.OK
You now have an XBee module talking to an Arduino using Software Serial port, leaving the hardware one for debugging and programming !