Home Learning Pi and BMP180 sensor

Pi and BMP180 sensor

by shedboy71

The BMP180 is the new digital barometric pressure sensor of Bosch Sensortec, with a very high performance, which enables applications in advanced mobile devices, such as smart phones, tablet PCs and sports devices. It follows the BMP085 and brings many improvements, like the smaller size and the expansion of digital interfaces.

The BMP180 comes as a fully calibrated, ready-to-use sensor module without the need for additional external circuitry. Pressure and temperature data are provided as 16 bit values, which, together with the stored calibration data, are used for temperature compensation on the external microcontroller. Data transfer can be performed via I2C or SPI interfaces.

Here is what the sensor looks like in a convenient breakout form

BMP180 Pressure Sensor

BMP180 Pressure Sensor

Here is a schematic of the device connected to your Raspberry PI

Pi and BMP180 schematic

Pi and BMP180 schematic


Again all of the work has been done by the good folks at Adafruit, so I won’t claim any of this as my own.
Here are the steps to install the library, this assumes you have python installed, GIT installed

[codesyntax lang=”bash”]

git clone https://github.com/adafruit/Adafruit_Python_BMP.git
cd Adafruit_Python_BMP
sudo python setup.py install


To run the example do the following
[codesyntax lang=”bash”]

cd examples
sudo python simpletest.py



This is the code for the simpletest example, if you don’t want a particular value returned just remove it or comment it out

[codesyntax lang=”python”]

import Adafruit_BMP.BMP085 as BMP085
sensor = BMP085.BMP085()

print 'Temp = {0:0.2f} *C'.format(sensor.read_temperature())
print 'Pressure = {0:0.2f} Pa'.format(sensor.read_pressure())
print 'Altitude = {0:0.2f} m'.format(sensor.read_altitude())
print 'Sealevel Pressure = {0:0.2f} Pa'.format(sensor.read_sealevel_pressure())


Here were my results

Pi and BMP180

Pi and BMP180


I used a site called http://elevationmap.net/ and checked out my house to see how accurate the altitude was – the site said 98m so as you can see a couple of metres out which is not too bad I suppose


BMP180 Digital Barometric Pressure Sensor Module

You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More