Optimizing Arduino+Xbee Setup by sending I2C over XBee?

Hi -

I have a setup I am interested optimizing (making smaller, portable).

I currently use 3 arduino unos, 2 accelerometers (spark fun, ITG3200/ADXL345), and 3 xbee S1s.

I have one master unit: The master unit consists of a single arduino uno, an Xbee, and a computer. This Xbee receives data from the slaves (described below) and then provides it to the arduino, which is then captured on the computer.

I have two slave units:

Each slave unit has an arduino uno that provides the I2C bus for an accelerometer. The data from the accelerometer is captured by the Arudino Uno and then the Uno outputs that data (using UART) to the slave Xbee for transmission to the master Xbee.

As you can imagine, this is a mess and not really portable - each arduino has to have a 5V power supply and then I have to have a bunch of breadboards to connect pins.

I thought it may be possible to use only one master Arduino (connected to the computer) and Xbee to transmit the I2C bus to the slave Xbees (connected to the accelerometers), and thus remove the additional two Arduinos, but can’t figure that out. I’m not exactly sure what I am doing wrong.

I setup DIO2 and DIO3 of the master (coordinator enabled) as Digital Input pins and gave it the SCL and SDA lines from the Arudino. Then I setup DIO2 and DIO3 of the slave XBees as Digital Output pins and connected them to the accelerometer, but nothing seems to be transmitted between the master and the slaves. I’ve probed around with a scope but nothing shows up on the slave DIO2 and DIO3 pins.

The association indicator lights are blinking, as they should be, on all three Xbees, so that does not seem to be the issue.

A few questions:

  • Is it actually possible to send I2C lines over Xbee? Can the Xbee actual handle the bandwidth (I2C SCL generated by the Arduino is 100kHz) .

  • Are the master’s DIO2 and DIO3 digital inputs automatically sent to the slave’s DIO2 and DIO3 ports (is the mapping 1-1)? Or do I have to set additional setting other than just the input/output for each pin?

Thanks in advance!

I2C direct over Xbee? I’d say no. I2C is an elaborate protocol and rather fast bit times.

You’ll need some small micro that has I2C and a serial link to the XBee, and XBee API code.

Your program would handle the I2C data, reformat it and send it to the Xbee, perhaps using one of the XBee API libraries.

Hi -

Yes, I know I2C is elaborate. But I have found an alternative route. I am using a smaller arduino (promini) instead.

Question - I have data coming from the slave XBee to the Master Xbee. I can see both sets of data (from two different slave XBees) on the XCTU terminal of the Master XBee.

However, I can not get that input into the Arduino. When I read the serial line, I get numbers that do not match the XCTU terminal numbers. Note - I have confirmed (by sending tests strings) that the Master Xbee is seeing exactly what the Slave Xbee transmits and that shows up on the Master’s XCTU terminal.

Is your problem that you need help getting two Xbees to talk regardless of I2C and data?

Going back to your first post here, the concept of using DIO2,3 to send I2C stumps me. The DIO pins are for rarely changing data. I2C is often KHz or MHz.

What’s your concept?