Tag Archives: i2c

Enable I2C on rPi

1-
sudo nano /etc/modules

2-
To the bottom
snd-bcm2835
i2c-bcm2708
i2c-dev

3-
If so check blacklist file. It depends on your board type
sudo nano /etc/modprobe.d/raspi-blacklist.conf

Comment out following lines as follows;
#blacklist spi-bcm2708
#blacklist i2c-bcm2708

4-
sudo apt-get install python-smbus
sudo apt-get install i2c-tools

5-
sudo nano /boot/config.txt
Add these line at the bottom of the file
dtparam=i2c1=on
dtparam=i2c_arm=on

sudo raspi-config

->Advanced options->enable i2c

6-
Do not forget to reboot
sudo reboot

7-
Check whether it works or not
sudo i2cdetect -y 0 (for a Revision 1 board like mine)
or
sudo i2cdetect -y 1 (for a Revision 2 board)

8-
then you should see output showing any I2C devices that are attached and their addresses

0 1 2 3 4 5 6 7 8 9 a b c d e f
00: — — — — — — — — — — — — —
10: — — — — — — — — — — — — — — — —
20: — — — — — — — — — — — — — — — —
30: — — — — — — — — — — — — — — — —
40: — — — — — — — — — — — — — — — —
50: — — — — — — — — — — — — — — — —
60: — — — — — — — — 68 — — — — — — —
70: — — — — — — — —