hex705

the first creature to discover water was likely not a fish

Communicating with Xbees

with one comment

This is a quick post — will clarify ASAP.

This post will cover a set up for communicating between two Arduinos with Xbee radios.  it is not the only solution but it is a start.  I will also describe how to organize a piece that enables a remote Arduino to communicates with processing via xBees.

I am assuming that you have configured your radios to talk to each other.

Connections for Serial Communication

When communicating between Arduinos with Xbees we need a different circuit than we used to configure the radio.  If you removed your Arduino chip to configure the radios you will need to replace it for the following to work.  Make sure you put the chip in the right way — notched end goes towards the edge of the board (I think that makes sense looking at the board, let me know).

The circuit is simple.  Power the xBee with 3.3V from the Arduino.  Next, for serial communication you need to connect two wires.  Connect Arduino RX (PIN 0) to xBee TX (labeled Dout on the xBee breakout board).  Connect Arduino Tx (PIN 1) to xBee Rx (labeled Din on the xBee breakout board).  If you have your xBee and Arduino facing the same ways as I do, your communication wires will cross over each other.  That is what you want.  (NOTE: this is different that the wiring used to configure the XBees).

Arduino talking to Xbee

Arduino talking to Xbee

Radio Connections Close-up!

Radio Connections Close-up!

A NOTE ON CODING

Important: You will need to disconnect one end of the serial communication wires you just connected EACH time you change the code in your Arduino.  Once the code uploads you can RECONNECT the serial communication wires.

The Whole System

Here is an example that uses xBee radios as a communication bridge between two Arduinos.  You will need:

  • 2 xBee radios
  • 2 Arduinos
  • 2 LEDs
  • 1 button (switch)
  • wires, and some 1k and 10k resistors.
  • sample CODE.

The system requires the sending radio to have the serial communication connections above as well as a digital switch (button) connected to PIN 2 and an LED connected to PIN 3. The receiving side has an xBee connected as above and an LED connected to the receiving Arduino on PIN 2.

xbeesendbtnled

Send Circuits

Recieve Circuits

Recieve Circuits

When working this system will sense button presses, turn on the local LED and send a message via xBees to the remote Arduino. The remote Arduino receives the message and reflects the button state with its LED.

This is a one way system. I will post a two-way system later today.

Ya, But I want to Talk to Processing

If you want to talk to processing from a remote arduino then you have two choices.  Once use the system above — and receive serial from an arduino connected to the computer.

OR

Set up a slightly different system.  I think this is an easier solution — but you may disagree.  Use xBees to replace the cable you are using for communication. (NOTE: you will still need the cable to program your arduino — this is for once you have code in place.  Using radios to code is another story).

The system should be developed and debugged with the programming cable first with radios introduced at the end.  So I will assume you have some code that allows your arduino to talk to processing already — maybe a sensor reading or similar.

Once that is working, remove the programming cable and connect an xBee to your Arduino as above in THIS post.  At the computer side where processing is running connect an xBee as if you were about to configure it (ie with a FTDI breakout or a dechipped Arduino).

If you tell processing to look at the port where you just connected an xBee you should be receiving data — just as you were with the cable.

If I need more HELP?!

As always this is coved in Tom Igoe’s Making Things Talk.

Advertisements

Written by hex705

November 30, 2008 at 10:34 am

One Response

Subscribe to comments with RSS.

  1. thanks for sharing the pictures….

    arduino kits australia

    March 18, 2016 at 5:06 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: