Enabling the I2C ports on the Raspberry Pi running Raspbian

The I2C ports are not enabled on the Raspberry Pi/Raspbian by default. Not too hard to get them working though (instructions derived from the Adafruit post here).

Details after the jump…

Add the following two lines to /etc/modules:

i2c-bcm2708
i2c-dev

Then comment out the following line in /etc/modprobe.d/raspi-blacklist.conf:

# blacklist i2c-bcm2708

Restart the Raspberry Pi and /dev/i2c-0 and /dev/i2c-1 should appear. It’s also useful to install the I2C tools:

sudo apt-get install i2c-tools

Then:

sudo i2cdetect -y 1

will detect any devices on /dev/i2c-1.

Advertisements

One thought on “Enabling the I2C ports on the Raspberry Pi running Raspbian

  1. Pingback: Raspberry Pi I2C udev rules | Richard's Tech Notes

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s