1
\$\begingroup\$

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

\$\endgroup\$
2
\$\begingroup\$

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

\$\endgroup\$
5
  • \$\begingroup\$ Hi, I'm having an issue actually wiring the i2c to the arduino. I know I have my power and ground, but am not sure where to take them of from the I2C as I'm working on someone else's start and they have not documented it \$\endgroup\$
    – Kyle93
    Feb 14 '14 at 16:17
  • \$\begingroup\$ So you have this robot with multiple peripherals that you wish to control with an arduino? Are you powering the arduino with the same battery that the rest of the robot is powered off of? and you said there are I2C (SDA and SCL) lines existent on the robot already? \$\endgroup\$ Feb 14 '14 at 21:21
  • \$\begingroup\$ Yes, Yes and yes. I've got everything wired up, just wondering what wired I would take off on the arduino. I've taken 5v, gnd and then is it just dependent of what pins I said in my code. \$\endgroup\$
    – Kyle93
    Feb 17 '14 at 16:29
  • \$\begingroup\$ Alright, I see your confusion now. Although they are not labeled on the board, pin A4 is SDA and A5 is SCL. Again, you should refer to the 'Wire' reference page on arduino's site which I linked above. It may also be helpful to look at some of the example code in the arudino IDE under the wire category to see how to set up I2C. \$\endgroup\$ Feb 17 '14 at 19:11
  • \$\begingroup\$ Thanks, I will make sure I take a look at it and thanks for your help! \$\endgroup\$
    – Kyle93
    Feb 21 '14 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.