Streaming multiple Arduino boards using Xbee


In my project, I am wirelessly collecting data from up to 10 Arduino boards (sensor: I am using Xbee which has 1-to-1 communication with a sensor (therefore I have 10 sensors and 10 basestations). My application requires that I collect data from all sensors simultaneously and that the data be synchronized. I know that each board operates on it's on timer/clock and was trying to synchronize the data on the receiving end within Matlab but am running into a couple of issues. Has anyone streamed data from multiple sensor nodes and successfully managed to synchronize the data such that sample at time n for sensor 1 corresponds to the same sample in time for sensors 2, 3, 4, etc?

I am using Matlab and if anyone has some base code I can use to do this for the simplest case of 2 sensors, I can build upon it to fit my needs.


Thanks for your response. I am collecting the data sequentially as you described but was looking for something I guess a bit more robust. I do have an Xbee connected to each Arduino board (“senders”) and all of the “receivers” are connected to the CPU via a USB port.

In your suggestion of putting all sensors into receive mode so that you can write a command to “synchronize” each sensor, are you suggesting the coding on the Ardrino side? My application is to collect motion data. I’m sampling at 100 Hz which is double the rate needed to collect this kind of data so I don’t think the protocol has to be too terribly complicated and the synchronization too precise. I need to make sure; however, that in the event a packet from 1 or more sensors is dropped that I can delete that packet from all additional sensors and not screw up the data.

Here's an idea: Change your XBee network configuration so that you have 10 end-devices and 1 coordinator. Then you need 9 less XBees in your network. You can read the XBee datasheet & manual on how to do this.

Then have your coordinator broadcast a timestamp every N time units in order to synchronize the end-devices. Each end-device will pick up the timestamp and store it. Then whenever an end-device sends a sample, have it send the timestamp for that sample as well.

Again, I highly recommend the XBee datasheet and user manual.

Thanks @johnmchilton. I was given the impression by the person who built the sensors that the communication had to be one-to-one. I will take your advice and read the datasheet and user manual.

@KE7GKP, The streaming will be either continuous (up to 3 hours) or "bursts" (5-10 minute sessions of collecting data). I'll try these options and post an update. Thanks again for ya'll help.

the other way of doing it is to broadcast a "measure whatever it is you measure" NOW command then collect the data at your leisure

I guess it's the measuring that really needs to be synched, rather than the collection thereof

hello everyone,

just as an update, I was able to successfully set up the arduino + xbee nodes to stream continuously to 1 coordinator/basestation node. I have one followup question however. I would like to "trigger" the base station (xbee coordinator node) to start acquisition and stop acquisition. My idea to do this is to send a numeric code to the coordinator node to begin collecting data from the end nodes and send a different numeric code to end the acquisition. I think that this is what you all have been suggesting; however, I couldn't find where to implement such a thing. Is the coding on the Arduino side or on the Xbee side?

Thank you all,

Is the coding on the Arduino side or on the Xbee side?

Have you tried programming on an XBee? They are radios. They are configurable, but not programmable.

There are in fact programmable XBees available. They are called "XBee-Pro ZB (S2B)" (XBee-PRO Programmable Extended Range Embedded RF Modules) and have a 32 KB Flash/ 2KB RAM Freescale MC9S08QE application processor.


I have XBee Series 1 so I guess they are just configurable. Is there a setting that can be configured to allow for sending triggers? I have read the white paper for the Xbee and though they give basic instructions on configuring a PAN and give information on some of the settings, I don't quite understand them all as I'm not a big networking person.

No, they have no logic.


hello all,

So it seems that I can only stream from at most 3 end nodes to one coordinator node. Has anyone tried streaming multiple nodes more than 3 or have any intuition why this could be happening?

The parameters for the Coordinator node are: CH (Channel) - C ID (PAN ID) - 1900 DH (Destination Address High) - 0 DL (Destination Address Low) - FFFF MY (16bit source address) - 2000 CE (Coordinator Enable)- 1 A2 (Coordinator Association) - 7 ------ 1 (allow association), 1 (allow channel reassignment), 1 (allow panID reassignment) BD (Interface Data Rate) - 38400

The parameters for the End Nodes (6 of them) are: CH (Channel) - C ID (PAN ID) - 1900 DH (Destination Address High) - 0 DL (Destination Address Low) - 0 MY (16bit source address) - 100X where X is the sensor ID ---- i.e. Sensor 6 MY = 1006 CE (Coordinator Enable)- 0 A1 (End Device Association) - 6 ------ 0 (allow panID reassignment), 1 (allow channel reassignment), 1 (auto associate), 0 (poll coordinator on pin wake) BD (Interface Data Rate) - 38400

Are the End nodes configured wrong? Am I not setting a parameter that should be set (i.e. the sleep parameters etc.)

Thanks a bunch,