Configuring the Pi for I2C

The BMP085 and BMP180 are no longer made, please check out the BMP280 - we have Python code examples here https://learn.adafruit.com/adafruit-bmp280-barometric-pressure-plus-temperature-sensor-breakout
If you're using a Raspberry Pi, follow the steps below to configure it to use the I2C interface. If you're using a Beaglebone Black with its standard Debian distribution, you can skip this page and move on to the next step.

Before you can get started with I2C on the Pi, you'll need to run through a couple quick steps from the console.
Check out this tutorial for more details and follow it completely

http://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c

When you're done, run
Download: file
sudo i2cdetect -y 0 (if you are using a version 1 Raspberry Pi)
sudo i2cdetect -y 1 (if you are using a version 2 Raspberry Pi)        
This will search /dev/i2c-0 or /dev/i2c-1 for all address, and if an Adafruit BMP085 Breakout is properly connected it should show up at 0x77 as follows:
Once both of these packages have been installed, you have everything you need to get started accessing I2C and SMBus devices in Python.
This guide was first published on Aug 14, 2012. It was last updated on Aug 14, 2012. This page (Configuring the Pi for I2C) was last updated on Aug 21, 2019.