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
Here is a schematic of the device connected to your Raspberry PI
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
[/codesyntax]
To run the example do the following
[codesyntax lang=”bash”]
cd examples sudo python simpletest.py
[/codesyntax]
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
[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())
[/codesyntax]
Here were my results
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