Go Down

Topic: Xbee interface (Read 894 times) previous topic - next topic



I expect two xbee shields to be delivered today. I already have the xbees.

One thing I am worried about is I don't really know how to send signals through them. Does anyone have expirience with them? Do you just send serial commands or is it far more complex than that. The xbees are two series 1 wire antennas.

Anyway it would be helpful if someone could help me get a simple Serial link established, (maybe an example)

Thanks in advance.


I expect two xbee shields to be delivered today.

Which ones?

I already have the xbees.

Again, which ones?

One thing I am worried about is I don't really know how to send signals through them.

How to send signals to them depends on what kind of signals you are talking about, and how the XBees are configured and connected.

If the TX pin of the XBee is connected to the TX pin of the Arduino, and the RX pins are connected, sending data to the XBee is simple - use Serial.print(). Getting data from the XBee is equally simple - use Serial.read().

If the XBee TX and RX pins are connected to other pins, use NewSoftSerial (pre 1.0) or SoftwareSerial (1.0 or later), or Serial1, Serial2, or Serial3 if you have a Mega and the XBee is connected to another hardware serial port.
The art of getting good answers lies in asking good questions.


ZigBee is a really cool standard and the best advice I can give you is to read this book - Building Wireless Sensor Networks with ZigBee, XBee, Arduino, and Processing - published by O'Reilly - it contains most of what you will need to know to get started, including command and API modes with hardware and code examples.


The O'Reilly book is excellent.

The answers to some of your questions depend on whether you are you are using Series 1 or Series 2 XBees.

If series 2, there is some setup you will need to do.  I found the usb xbee explorer to be invaluable for this, but the Oreilly book (and even its on-line previews) contains instructions on how to use the ftdi chip in the arduino to access the needed pins.

If series 1, the devices will talk among themselves right out of the box, most likely. 

Basically, once set up in default "transparent" mode, the bits that go onto one xbee come out the other and vice versa.

There are several flavors of shield.  Sparkfun has one that is the size of the Arduino.  There is another one that is smaller with the xbee offset.

One thing to pay attention to is that if the XBee is sitting on the serial chip on the Arduino, you cannot program the Arduino.  There is a switch on the Sparkfun shield that lets you change pin assignments (slide toward the USB cable to move the xbee to different pins), so that is easier than pulling the shield from the board.

Hope this gets you started.

Go Up