Enabling i2c on Raspbian

Add the following to /etc/modules:

i2c-bcm2708
i2c-dev

Install i2c-tools:

sudo apt-get install i2ctools

Edit /etc/modprobe.d/raspi-blacklist.conf and remove/comment out these two lines:

blacklist spi-bcm2708
blacklist i2c-bcm2708

Detect your ic2 interface with:

sudo i2cdetect -y 1 #1 = Pi model B

If you get this error:

Error: Could not open file '/dev/i2c-1' or `/dev/i2c/1': No such file or directory

Then run this first and you should be good to go:

sudo modprobe i2c-dev

More info here.