Pi and BMP180 sensor

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

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

cd examples
sudo python simpletest.py

Code

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

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

Link

BMP180 Digital Barometric Pressure Sensor Module

SHARE
Previous articlePi and PIR example
Next articleRaspberry PI and 74hc595 python example