Let's Make Robots! | RobotShop

Serial vs I2C communication

Hi, please, can you tell me difference between I2C and Serial communication and which is the best for communication Raspberry Pi 2 with Arduino (T'Rex Controller). Thanks

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

 

   A good reading about I2C and Serial:

 - https://learn.sparkfun.com/tutorials/i2c

 - https://learn.sparkfun.com/tutorials/serial-communication

 The main difference between I2C and Serial, is that Serial is a point to point connection and I2C is a bus which support many devices, each with own address. 

 I2C have better speed than Serial, but Serial support longer wires, depends what your needs are.

Given the core of TRex is an Arduino and if you plan to update/test the TRex firmware frequently, I'd go with I2C between RPi and TRex.

If you connect RPi and TRex over serial, you have to disconnect them each time you upload firmware to TRex.

-=S=-

 

I have been experimenting with i2c as an interface between an Arduino and an RPi and have had some success. I started looking here:

http://blog.oscarliang.net/raspberry-pi-arduino-connected-i2c/

Just be careful as although Oscars blogs were very helpful some of the info such as setting up the Pi are out of date, I rectified these problems by asking several questions in the RPi Forums such as this one:

https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=114214

If I can help in any wal I will (collaborative learning).

Good luck