21 October 2012

Arduino UNO - XBee Setup

There are many XBee tutorials out there, but I could not find one that I could apply to my specific Arduino/Shield/Xbee configuration. While this particular configuration may not apply to you, perhaps it will send you in the right direction, so please read on.
Please note, that your XBee shield may require you to perform extra steps, so please do further reading before jumping in head first. I am not an expert, so don't blame me if you fry your board.

The following set of steps worked for me:


Step 1: Download and Install X-CTU

The easiest way to setup your XBee module is via the X-CTU software from Digi. It can be downloaded from their site here:  http://www.digi.com/support/productdetail?pid=3257

  • Select  the Diagnostics, Utilities and MIBs section


  • Download and install the XCTU 32-bit ver 5.2.7.5 installer (do a virus check after download)
  • Please note that this is for Windows platforms only !

  • FYI: We will run the software later



Step 2: Upload the bare-minimum script on your Arduino controller

I perform this step to prevent any previous projects from interfering. This may not be necessary, but I tend to do this before wiring up any of my new projects. This is the script I load onto the Arduino:

Bare Minimum Arduino Sketch:
1
2
3
4
5
6
7
void setup() {

}

void loop() {
  
}




Step 3: Connect the Shield to Arduino, and XBee to Shield.


  • Disconnect the Arduino UNO from the computer. 

  • Insert the XBee module into the Shield.
  • This is the XBee Shield and XBee module side by side




    This is the XBee module on the XBee Shield


  • The pins from the XBee module should slot into the respective headers on the Shield.


  • Connect the XBee shield to the Arduino

  • The pins from the XBee shield should slot into the respective headers on the Arduino board.



  • Move the little white switch in the corner to USB.

    • There are 2 options - USB mode and XBee mode.
    • We want USB mode which will allow the computer to communicate with the XBee module



Step 4: Connect Arduino to computer, and run the X-CTU Software


  • With the XBee module and Shield connected to the Arduino, and the Shield's white switch in USB mode;  connect the Arduino to the computer using a USB cable.
  • This Arduino board appears as COM7 on my computer.
  • Here is what the X-CTU software looks like when it loads up




  • Press the Test / Query button to see if the computer can talk to the XBee module.
    • If successful, you should see something like this:





  • If you accidentally leave the XBee shield in XBee mode, or if your computer fails to communicate with the XBee module, you may encounter these screens.


If you get a successful Test / Query, then move onto the next step.


Step 5: Read XBee Firmware settings:

We can now try to read the XBee firmware settings by
  • Selecting the Modem Configuration Tab

  • Select the Read button to read the XBee firmware settings


Step 6: Download older version of firmware if necessary

  • If you did not have any issues with the previous step, then continue to step 7, otherwise read on.
  • In my case, the software could not find the firmware file necessary to read the firmware settings.
  • In step 4, I could see that I had the XB24 Modem type, and 10E8 firmware version,

  • I tried downloading new versions, but this did not seem to work, as the computer could not detect any newer updates available. The problem I had, was that I needed an "older version" of firmware to communicate with the XBee module in order to read/write new settings to it.
  • I could not select the firmware version from the drop down boxes, which indicated that this particular firmware version was not installed on my computer. So here is what I did.
    • I went back to the Digi site and selected the Firmware update section.
    • This provided a link to an FTP site with "previous versions" of firmware.





  • I then selected the relevant firmware version from the list, and downloaded the zip file to a logical folder on my hard-drive.  There is no need to unzip the file, because the X-CTU software will look for a zipped file.



  • In the X-CTU software, in the Modem Configurations tab, select the "Download new versions button", and select File. Navigate to the zip-file just downloaded and select it. 


  • The software should tell you that it has updated successfully or something to that effect.
  • The modem type and version should now be an available option in the drop down boxes, however, we will continue where we left off (in step 5) and try an read the firmware settings from the XBee module, by pressing the Read button in the Modem Configurations tab on the X-CTU software.
  • It should look something like this:

TO BE CONTINUED.......

21 comments:

  1. hi..i thx for your post..Do you have part 2 of this? I cant find your 'to be continue' post =(

    ReplyDelete
    Replies
    1. Hi Eliza,

      Really sorry that I have not completed this. Have a few just like this one that I am trying to finish, and will get round to it eventually, when I find some time.

      Delete
  2. I don't know the reason why i still cant find the xbee when it is on the arduino shield for the xbee. And I try to use your way to update the firmware. And it doesn't work. I use the xbee S2 zigbee radio. Can you give me some suggestions?

    ReplyDelete
  3. Thanks a lot, I spent 2 months to connect XBee module by using Arduino. but In all cases I faced that " unable con connect ...". I found the solution here by change mode from XBee to USB.

    ReplyDelete
    Replies
    1. Hi Jalawi,
      Sometimes it is easy to overlook the easy stuff, when the problem is right in front of us. Happens to me often :)
      I bet you will never forget that trick again !

      Scott

      Delete
  4. I need the second part of this... D:

    ReplyDelete
    Replies
    1. Hi Anonymous.
      I will not get to this until after August. Am studying at the moment.

      Delete
  5. it's very interesting....plz update the second part!

    ReplyDelete
  6. This is the best Arduino XBee Shield tutorial I've found on the internet. pls finde some hours to complet it, you got already 5 stars for your work :)

    ReplyDelete
    Replies
    1. Thanks for your feedback.
      I wish I had the time. Not at the moment - life is a bit busy at the moment.
      But hopefully you are now partly on the right track :)

      Delete
  7. Yea I join the gang saying please find time to continue with these! JD

    ReplyDelete
  8. Good Job bro, Keep it up !

    ReplyDelete
  9. helo bro, do you have program arduino for xbee? i really need it, may you send me by email? adli20rahman@gmail.com . thanks a lot

    ReplyDelete
  10. Hi Adli,

    I don't have any code for Arduino XBee communication at the moment,
    But these sites may be useful:
    http://arduino.cc/en/Guide/ArduinoXbeeShield
    http://www.jeremyblum.com/2011/02/27/arduino-tutorial-9-wireless-communication/
    But - worth looking up info specific to the shield and XBee module you are using.

    ReplyDelete
  11. Hello there,
    what I must change to configured the XBee? i need more help.
    thank you.

    ReplyDelete
  12. hey i need to send data from Xbee explorer and receive it at Arduino and i'm facing a lot of troubles doing that. Please help me with it .
    thank you

    ReplyDelete
    Replies
    1. Unfortunately, I don't have an XBee explorer - and this type of help is best served within a forum.
      This blog does lend itself very well for that kind of stuff... please post your issue within the Arduino forum and you are likely to get better help than I could ever give.

      Delete
  13. nice tutorial, by the way do you know how to read XBee packet data with Arduino?

    ReplyDelete
    Replies
    1. As far as I know these will allow you to communicate in a manner as if you had a direct serial wire connection between Arduinos. I would just treat it like a Serial connection.

      Delete

Feel free to leave a comment about this tutorial below.
Any questions about your particular project should be asked in the ArduinoBasics forum.

Comments are moderated due to large amount of spam.