Just getting started with XBee

Hey everyone.

I'm a total XBee noob. I just have a few questions, hopefully they're easy enough :sweat_smile:

First, how far do regular XBees actually go? I need them to go 240, absolute max 250, feet. However, there are some obstructions, even though it's outside. Do I need the high-power (pro) ones?

Second, do I need an adapter board of any kind? Or can I just plug it straight into the Arduino 3.3v and tx/rx sockets?

Third, I take it the main limitation of series 1 XBees is that they can only communicate with one other radio at a time. Is that true? (Wild assumption based on everything I've seen so far.)

If that's true, to make this project of mine happen I need series 2, even though it's apparently a lot more complicated. If I need series 2, can anyone point me to a tutorial of some kind?

Thanks guys!

Look at the xbee datasheet=>page 5 for specifications on xbee and xbee pro,it will also tell you the range. If you are using arduino 3.3 v then you wont need a adapter board.You can directly connect tx-DIN and rx-DOUT of arduino and xbee. I would recommend you to get a xbee explorer USB.You need this to configure your xbee using XCTU or any other terminal program. If you use xbee series 1 ,they are simply out of the box radio which do not need any configurations.Xbee series 1 will start talking as soon as they are connected on a network. Limitations of xbee series 1 is that they are not fully zigbee complaint .They will not do mesh networking.Point to point and point to multipoint networking are supported by xbee series 1.Xbee series 1 is simply 802.15.4 protocol. Series 2 are fully zigbee complaint.

Please read Building Wireless Networks by Robert Faludi-Oreilly.I am also not an expert but have done some projects on xbee and some readings .If you are very beginner, then you need to do lot of reading,searching online information and get some xbees(atleast 2) and start playing with them.Good Luck

The spec on the current S2 XBee ZB low power modules is 400ft/120m outdoor line-of-sight. Not sure what obstructions are involved, but I'd try the low power modules first. The 3.3V supply from an Arduino won't supply enough current for the Pro modules, in fact it's barely adequate for the low power modules. Do not connect an XBee directly to the RX/TX pins of an Arduino that runs on 5V (like the Uno). If you have an Arduino that runs on 3.3V (one example), then it's OK. The XBee operates at 3.3V, and with a 5V Arduino, these signals need level shifting, there are various adapters that do this.

I don't know anything about the S1 modules, I've only used the S2; and while I wouldn't call them complicated to use, like a lot of things, there is a little learning curve. If it were me, I'd go for the current hardware, why buy the old versions. The Faludi book is good, I would also recommend it; it is written for the S2 modules.

Another note on the range issue, there is the option of installing intermediate nodes if the range is too long. So if "A" and "B" are too far apart, put a module "C" configured as a router in between and it will forward the traffic. "C" doesn't even need to be connected to anything, just configured for the same network ID and powered up. Not sure if that's compatible with your design, but thought I'd mention it.

Have a look at my blog post, this is a simple two-node network that also uploads sensor data to the Pachube web site. You might not be interested in that part, but otherwise it should give a feel for what is needed to get data from point A to point B.

If you use xbee series 1 ,they are simply out of the box radio which do not need any configurations.Xbee series 1 will start talking as soon as they are connected on a network.

Talking, yes. Communicating, no.

ALL XBees, in spite of the BS on digi's site, need to be configured.

Or can I just plug it straight into the Arduino 3.3v and tx/rx sockets?

I'd be inclined to connect ground, too. Probably because the XBee won't work without it.

I need them to go 240, absolute max 250, feet.

A minimum of 240 feet and a maximum of 250 feet. That's a pretty narrow range.

Third, I take it the main limitation of series 1 XBees is that they can only communicate with one other radio at a time.

The series 1 radios are point-to-multipoint. A radio can be setup to broadcast to a single destination (DL) address or to multiple addresses. A radio can receive messages directed specifically to it or broadcast generally.

Depending on what you are trying to do, you may be able to use series 1 radios. You don't say what that is, so...

PaulS:

Or can I just plug it straight into the Arduino 3.3v and tx/rx sockets?

I'd be inclined to connect ground, too. Probably because the XBee won't work without it.

Of course. :sweat_smile:

PaulS:

I need them to go 240, absolute max 250, feet.

A minimum of 240 feet and a maximum of 250 feet. That's a pretty narrow range.

I meant a maximum of 240-250 feet. Sorry.

[quote author=Jack Christensen link=topic=61409.msg443851#msg443851 date=1305631963] The spec on the current S2 XBee ZB low power modules is 400ft/120m outdoor line-of-sight. Not sure what obstructions are involved, but I'd try the low power modules first. [/quote]

[quote author=Jack Christensen link=topic=61409.msg443851#msg443851 date=1305631963] Another note on the range issue, there is the option of installing intermediate nodes if the range is too long. So if "A" and "B" are too far apart, put a module "C" configured as a router in between and it will forward the traffic. "C" doesn't even need to be connected to anything, just configured for the same network ID and powered up. Not sure if that's compatible with your design, but thought I'd mention it. [/quote]

The obstructions include a house, and the property is on a hill. Here's a cruddy drawing (viewpoint from the side):

___ | -- House is about that tall. (2 stories) There is a good amount of room on both sides of it though. \ | _| \ ___

Do you think the signal will go from the bottom to the top (or vice versa), about 240 feet, on a diagonal, with the house in the way? (Of course, the fact that I can implement an intermediary may make that moot - thanks a bunch!)

arduinokid: I would recommend you to get a xbee explorer USB.You need this to configure your xbee using XCTU or any other terminal program.

Is that absolutely necessary? Can I program it through the Arduino?

[quote author=Jack Christensen link=topic=61409.msg443851#msg443851 date=1305631963] The 3.3V supply from an Arduino won't supply enough current for the Pro modules, in fact it's barely adequate for the low power modules. Do not connect an XBee directly to the RX/TX pins of an Arduino that runs on 5V (like the Uno). If you have an Arduino that runs on 3.3V (one example), then it's OK. The XBee operates at 3.3V, and with a 5V Arduino, these signals need level shifting, there are various adapters that do this.[/quote]

Is this good to hook it up to the Arduino? Or do I need something else?

PaulS: The series 1 radios are point-to-multipoint. A radio can be setup to broadcast to a single destination (DL) address or to multiple addresses. A radio can receive messages directed specifically to it or broadcast generally.

Depending on what you are trying to do, you may be able to use series 1 radios. You don't say what that is, so...

I'm trying to build a laser tag system, same thing that I brought up in the other thread. I figured this part of the forum would be better for XBee related questions.

This part of the project is the gun, or tagger. The XBee is there for communication between each gun. In order for the game to work, at least one gun has to be communicating with all of the others.

I think I'm going to get series 2, because of the mesh network capability. (Not dead set on that, of course.) Thanks everyone!

Fej42: Do you think the signal will go from the bottom to the top (or vice versa), about 240 feet, on a diagonal, with the house in the way?

Can't say for sure, I'd try it though. Going to the Pro models is significant both from a power and expense standpoint.

Fej42: Is that [XBee explorer USB] absolutely necessary? Can I program it through the Arduino?

The X-CTU program is needed to configure the XBees (it only runs on Windoze!), so a way is needed to connect the XBee to the PC. You can use either the USB explorer, or use a combination of the Sparkfun regulated explorer and an FTDI board (e.g. from Sparkfun or from Adafruit). This combination is essentially the same as the USB explorer. I went this way because having the FTDI breakout board is also useful for programming Arduino clones (and because I'm cheap and didn't want to spring for the USB Explorer XD ). I've also used Adafruit's XBee adapter. I like the Adafruit adapter a little better if you don't mind soldering. I like the circuit a little better, as far as how the level shifting is done. But I've used both and both seem to work just fine. If you go for the combination of the Sparkfun Regulated Explorer and the Sparkfun FTDI Basic Breakout, be aware that they do not mate together exactly, the RX and TX lines need to be turned around. I put together an adapter cable for this purpose and it works fine. Sorry, hope that wasn't too confusing.

Fej42: Is this good to hook it up to the Arduino? Or do I need something else?

Yep, that will work fine. Like I said, I've used those and also Adafruit's.

Fej42: I'm trying to build a laser tag system...

Are things going to be moving around? If so, the XBees may reconfigure the mesh or even dis-associate and re-associate. There could be delays involved with these that are longer than, well, getting shot :)

Regarding range: My experience with the low power series 2 modules is 50 feet with walls in the way. Yes, that's a heck of a lot less than the literature says, but that's been my experience. However, low power series 2 is the way to go in my opinion. Series 2 means you get the mesh capabilities and you can put intermediaries in strategic places to make sure the signal can travel wherever it needs to go. Last time I looked you could get three of the low power devices for the price of a high power one; that's a lot of extra coverage for the price.

Regarding configuring the XBee, I totally agree with the comments about a USB adapter of some type. Myself, I have both one of the direct to USB devices like http://www.sparkfun.com/products/8687 and the FTDI device https://www.adafruit.com/products/126. I'm a belt and suspenders kind of guy. I also use the adafruit device to hook up my XBees although, you absolutely can use the 3V supply from the arduino and connect direct to the ports. I did this for one of my devices that is dedicated purpose and doesn't get messed with much. The adafruit adapter device is great for putting an XBee in as an intermediary because you can mount it directly to a 5V wall wart and just plug it into the wall somewhere. The USB adapter is great for monitoring what is going on in the network when you're testing things. Just plug it in and watch what is going on through the terminal that is part of XCTU.

[quote author=Jack Christensen link=topic=61409.msg444490#msg444490 date=1305676304] Going to the Pro models is significant both from a power and expense standpoint. [/quote]

Well, that's important. I'm trying to make this as cheap as possible for now. Thanks!

[quote author=Jack Christensen link=topic=61409.msg444490#msg444490 date=1305676304] You can use either the USB explorer, or use a combination of the Sparkfun regulated explorer and an FTDI board (e.g. from Sparkfun or from Adafruit). This combination is essentially the same as the USB explorer. I went this way because having the FTDI breakout board is also useful for programming Arduino clones (and because I'm cheap and didn't want to spring for the USB Explorer XD ). I've also used Adafruit's XBee adapter. I like the Adafruit adapter a little better if you don't mind soldering. I like the circuit a little better, as far as how the level shifting is done. But I've used both and both seem to work just fine. If you go for the combination of the Sparkfun Regulated Explorer and the Sparkfun FTDI Basic Breakout, be aware that they do not mate together exactly, the RX and TX lines need to be turned around. I put together an adapter cable for this purpose and it works fine. Sorry, hope that wasn't too confusing. [/quote]

As I said, I'm trying to make this as cheap as possible. Might not be worth it though, I plan to just solder wires into the regulated explorer, and then eventually screw it into some sort of casing. (It is laser tag, it does need to look a little like a gun.) In other words, it won't exactly be able to mate easily with the FTDI board. Also, doesn't the regulated explorer just break out the pins and regulate input down to 3.3v? How can I use that with an FTDI board?

By the way, the case may be made out of metal. Is it okay to just have the XBee screwed into the inside of the case, with the wire antenna sticking out of a hole, or do I need an external antenna?

[quote author=Jack Christensen link=topic=61409.msg444490#msg444490 date=1305676304] Are things going to be moving around? If so, the XBees may reconfigure the mesh or even dis-associate and re-associate. There could be delays involved with these that are longer than, well, getting shot :) [/quote]

Yes, there is going to be a lot of movement. How long are those delays? It seems inevitable. (Also, when you say dis-associate and re-associate, do you mean disconnecting and reconnecting?)

I would be careful of sticking the whip antenna out of the case. If you break
that it could be difficult to repair. You may want to try cutting a window
in the case and using the chip antenna or using the external antenna that
has a co-ax connector.

I would also recommend a new O’Reilly book by Rob Faludi called “Wireless
Sensor Networks”. This is an excellent resource. Lot’s of details on the
XBee Series 2. “Making Things Talk” is another favorite of mine.

I just started selling an Arduino compatible board with a RTC and
XBee socket… The schematic and BOM are in the datasheet at
http://wiblocks.luciani.org/PICO/PICOBEE-index.html

(* jcl *)

What's the cheapest external antenna for XBee? Does anyone have any experience with XBee external antennas? As I've said, I'm trying to keep this on the cheap, so if the antenna + connecting wire is too expensive, I'll have to find another solution.

I exclusively use the wire antenna. It is a short piece of stiff braided wire coated with plastic and a little cap on the end. The cap will pull off but is easily put back with a little silicon glue. It is not very flexible and will work fine if it is folded back. You could put it under a piece of plastic, fold it back and glue it down. Or, put the xbee at the front of the gun and use the wire for the front sight. I haven't had any problems with them breaking or even trying to. I imagine you could rip them off but I'm not too willing to experiment with that.

I would be reluctant to put the xbee inside a metal enclosure, my skills at mounting things leaves a little bit to be desired. However, you may well be able to do it just fine.

When an XBee joins a network, it’s referred to as associating. The XBee has an Associate pin which can have an LED connected to it which indicates the XBee’s status with respect to the network. I’ve never attempted to measure the time to associate, as it’s not terribly critical for my applications, but my gut feel is that it can be on the order of a few seconds.

At this point, unless someone who has used XBees for exactly the same purpose (laser tag) steps up, I might be inclined to just pop for a couple and start experimenting. I wouldn’t expect to completely understand in advance exactly how (or whether) they might work in a very specific application; there is a lot of value in hands-on and in experiencing the learning curve for oneself. But I’d definitely be interested to know how they work in such an application.

I think I'm gonna play it safe and go for the external antenna. Just so I can move it around later if there's any problems.

Would this cable and this antenna work? Or is there a better solution?

Is there any (significant) signal loss in the transition between U.FL and RP-SMA? Also, are longer cables available? 4 inches seems a bit short.

Thanks a ton guys!

You can also get the whip antenna that has a U.FL. terminated cable attached. This will save you one connection and around $5 or so.

(* jcl *)

Were you placing these in a metal enclosure? If not, perhaps the chip antenna would work, you'd have to try it and see for your application.

jluciani: You can also get the whip antenna that has a U.FL. terminated cable attached. This will save you one connection and around $5 or so.

(* jcl *)

That sounds great, thanks! (Who sells them, though?)

jgalak: Were you placing these in a metal enclosure? If not, perhaps the chip antenna would work, you'd have to try it and see for your application.

It's most likely going in a metal enclosure. I'm thinking the chip antenna wouldn't work very vell. Thanks though.

The Antenna with U.FL. cable is a MaxStream part. I bought them from either Mouser or Digikey

(* jcl *)

Like this. Great, thanks!

That's the one. And there are 842 left in stock for your project ;)

(* jcl *)

I was just looking at the series 2 XBees from Sparkfun.

I noticed that the series 2 U.FL XBee doesn't look anything like the other series 2 XBees, in fact, it looks like the older series 2.5.

I've never shopped at Sparkfun before, so I just want to know - do they mix up pictures often? The part numbers seem to match up (I think), but I want to be sure.

Thanks everyone for all the help!