Connecting several arduinos via xbee

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
mmcgraw
 
Posts: 2
Joined: Wed Jun 15, 2011 7:17 pm

Connecting several arduinos via xbee

Post by mmcgraw »

Hello, I'm a software developer who is new to Arduino, and electronics in general. I have a project idea that would require a variable number of Arduinos to communicate wirelessly, in relatively close proximity (same building). There will be no connection to a PC required to run the application, though of course I understand one will be needed to upload the sketches to the Arduinos, and (as I've read elsewhere) configure the Xbees initially. Apologies in advance for the basic questions - I've done enough reading now to jump to a bunch of conclusions, but I thought it best to check my assumptions and get some informed input. Hopefully the answers might help other newbies with questions similar to mine....

I understand there are a variety of Xbee models, that fall into Series 1 and 2. I also see other bits of Xbee-related hardware that seem to be recommended on various sites :

Xbee "breakout boards"
Xbee Shield (http://arduino.cc/en/Main/ArduinoXbeeShield)
Xbee adaptor (http://www.adafruit.com/products/126)

I think I understand that a breakout board is really just an extension of the Xbee's physical connections, to make it easier to work with, for those of us with medium to large sized hands. But I'm fuzzy on the difference between the last two- is the Adafruit Xbee adaptor analogous to the Xbee Shield? Or are they different? Do I need both?

After doing some requisite Googling, and tutorial-reading, I've been lead here, and I'm gathering (correct me if I'm wrong) that, to each Arduino I'd like to have join my local, wireless peer-to-peer network of Arduinos, I could connect 1 Xbee module via 1 Xbee adaptor. I'd also need the FTDI cable (http://www.adafruit.com/products/70) to manage the xbee configuration initially. Is this correct? I'm gathering if I were really adventurous, I could do without the adaptors, but I suspect connecting Xbee modules directly to an Arduino would involve effectively building an adaptor around them anyway, which is beyond me.

Assuming I had these things, and various Arduinos of my chosen flavour, I understand I could upload a sketch into each that would, for example, wirelessly discover the other Arduinos within Xbee range (technically, I suspect the Xbees are doing the discovering), and then begin communicating. In other words, I understand the Xbees have a networking protocol that will work "out of the box", provided they're configured to work that way (which is what the cable is for), and once they're connected, they should be (relatively) painless to code to.

Finally, I would like the arduinos to use a mesh protocol, so the network of Arduinos can be physically arranged in a flexible way (i.e. no centrally-positioned "controller" unit). I presume this simply means I should choose the Xbee modules (I'm currently going off of the model sheet here: http://ladyada.net/make/xbee/modules.html) that list "mesh" as their network type. Will going this route present any additional challenges, or do the modules, once configured correctly, just sort that stuff out themselves under the hood?

Am I mostly understanding all this correctly? :-)

Thanks very much for your time!

Mike McGraw

User avatar
jchristensen
 
Posts: 111
Joined: Mon Jan 03, 2011 11:45 am

Re: Connecting several arduinos via xbee

Post by jchristensen »

Yes indeed, sounds like you've got a lot of the basics sussed out. The shield/breakout/adapter is needed for a couple reasons. One, physical: XBees use pins with 2mm spacing which makes prototyping a bit of a challenge because they won't plug into solderless breadboards which have 0.1 inch spacing. Two, electrical: XBees run on 3.3V, and while a 5V Arduino Uno has a modest 3.3V supply that can just run a low-power XBee, the signal levels also need to be shifted. A "breakout board" may only address the physical aspect, which would be OK if your chosen Arduino runs on 3.3V as well, but an "adapter" should be used with 5V Arduinos. And a shield is just an adapter made with the physical dimensions and connections to plug directly into an Arduino (Uno or similar).

Yes you will want an FTDI cable or other FTDI adapter to configure the XBees, I can recommend Adafruit's FTDI Friend.

Every XBee network needs exactly one unit configured as the "network coordinator", the other nodes are routers or end devices. End devices can power down (sleep), routers are always on so will normally be mains-connected. I'm a big fan of S2, actually have not used the S1 modules. I've said before, I don't see any reason not to use the S2, might as well have the latest and greatest. They do the mesh networking, and you are correct, all the network formation and repair (if a node goes down, the network can route around it) just happens automatically.

A few suggestions.
1. Get some Arduino and start playing, so that you're fairly comfortable before adding XBees to the mix.
2. Then add two (or more) XBees, and consider Robert Faludi's book. I liked this book, it got me up to speed in a hurry.

Hope this helps. I'd also offer my modest blog post demonstrating a two-node network that can be easily expanded.

Good luck, let us know how it goes. Hope you have fun. Arduinos and XBees are both amazing devices, put them together and you can do some pretty slick stuff.

mmcgraw
 
Posts: 2
Joined: Wed Jun 15, 2011 7:17 pm

Re: Connecting several arduinos via xbee

Post by mmcgraw »

Thank you for the very helpful reply! I'll definitely follow up on those links. My ARDX kit arrived yesterday - I can tell this will be a heck of a lot of fun. I'll post any progress as it happens...

User avatar
BCCT
 
Posts: 3
Joined: Thu Sep 25, 2014 4:44 pm

Re: Connecting several arduinos via xbee

Post by BCCT »

Hello, did you get multiple ardunios working together through the use of XBees? I am working on a project where an accelerometer on one arduino will signal a second arduino to run a command, only it hinges on the ability to do so wirelessly. Any recommendations are appreciated.

User avatar
BCCT
 
Posts: 3
Joined: Thu Sep 25, 2014 4:44 pm

Re: Connecting several arduinos via xbee

Post by BCCT »

Hello, did you get multiple ardunios working together through the use of XBees? I am working on a project where an accelerometer on one arduino will signal a second arduino to run a command, only it hinges on the ability to do so wirelessly. Any recommendations are appreciated.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”