

I²C Activation
Since the BMP180 sensor works via the I²C bus, it must be enabled first, because it is deactivated by default (if you have already done so, you can jump to the next chapter).
We first process the following file:
sudo nano /etc/modules
At the end of the file these two lines are added:
i2c-bcm2708
i2c-dev
With CTRL + O and CTRL + X we save and exit.
Now we can comment out the blacklist entries (in some versions the file does not exist, then just go to the next command):
sudo nano /etc/modprobe.d/raspi-blacklist.conf
Here we can use a hash # to comment out the corresponding entries.
#blacklist spi-bcm2708
#blacklist i2c-bcm2708
In addition, Raspbian versions from 2015 onwards require activation of the Devietree. This can be done in the configuration:
sudo raspi-config
Under “Advanced Options” you activate the automatic loading of the I2C bus. Restart your Raspberry.
Now we install three more needed tools:
sudo apt-get install python-smbus i2c-tools git
Then you can by means of
i2cdetect -y 1
test if everything worked. A device should be displayed. For me it looks like this:
pi@raspberrypi ~ $ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- 77
BMP180 Software
The easiest way to address the sensor is to take an existing library that already has all the functions. Adafruit offers such a library, with examples also to other sensors.
We clone the repository of Adafruit (git must be installed).
git clone https://github.com/adafruit/Adafruit-Ra ... n-Code.git
cd Adafruit-Raspberry-Pi-Python-Code/
git checkout 9ff733d59242a02f7ccd0222001ce80f6090a978
cd Adafruit_BMP085
Then we can already do the first test:
sudo python Adafruit_BMP085_example.py
The script will provide an output similar to this one:
Temperature: 25.70 C
Pressure: 1007.08 hPa
Altitude: 50.83