Adding I2C to the Raspberry Pi

Depending on the Raspbian distributikns, the instructions for adding the I2C tools to the Raspberry Pi differ a bit, but with these instructions I was able to add the I2C drivers and use some I2C devices without any problems.

In /etc/modules, add two lines to enable the I2C drivers during boot:

i2c-bmc2708

i2c-dev

 

Also install the i2c-tools and python-smbus packages:

apt-get install python-smbus

apt-get install i2c-tools

 

In /etc/modprobe.d/raspi-blacklist.conf, you might need to uncomment the line comment lines for the i2c-bmc2708 module. This depends a bit on your Raspbian version, I found that some versikns had this module blacklisted while others don't.

Now, use the command "i2cdetect 1" to show all devices connecter to the I2C bus.

Please note that you need to execute all this as root, or using sudo.