Electronic – arduino – I2C bus and Arduino Uno

arduinoi2c

I'm not really sure if this is the correct place but here we go.

I'm in the process of creating a robot for Uni and the hardest part for me is the hardware side of it, specifically the electronics. Thus this issue.

I'm attempting to connect my I2C bus up to my Arduino Uno, I've wried all of the devices I wish to have to my I2C bus and now have got two cables running to/ from it. 1 is the one that goes down to my motor control unit and the other is power. From there I now need to have a connection that runs from the Arduino to the I2C bus so I can just poll around the sensors and read data. Does anyone have any info on this.

I was thinking having 4 wires. 1 for power, 1 for ground, then the other two coming off to other pins on the Arduino. Does this sound about right or not? I'm really at a loss for this one as it's not my strong point.

enter image description here
enter image description here

Best Answer

When using I2C you must remember to put a pull-up resistor (something like 3.3kohm or 4.7kohm will work) from each line to power. I2C has the ability to communicate to multiple devices on each line using device addresses, so you will have to check what the device address of the xbee is in it's data sheet. Here is the I2C reference page for Arduino which will come in handy:

http://arduino.cc/en/reference/wire

Edit:

I just recalled that Xbee does not support I2C directly, but instead uses UART for communication. Simply use the Tx and Rx pins on both your Arduino and Xbee. No pullups are required for UART. Here is the UART arduino page: http://arduino.cc/en/reference/serial