BMP180 and the Raspberry Pi Version 2

  

Looking at this board it looks like the power can be between 3 and 5 volts, but I suspect that the SDA and SCL are 3.3 volts. That makes it ideal for the Raspberry Pi, as long as you remember to power it from the 3.3 volt pin. I connected the +pin to pin 1 on the Pi, the Gnd to pin 9, the SDA pin to pin 3 and the SCL pin to pin 5. I followed the Adafruit page here and although this is for the BMP085 it works just as well with the BMP180. Once I had installed the library I ran the python example simpletest.py using this

cd /home/pi/Adafruit_Python_BMP/examples

sudo python simpletest.py

However, I noticed that I never got the same reading for height and that was not what I needed with my weather balloon project. I started looking around the Internet and found a number of sites that would give you the height above sea level if you provide the pressure and temperature at sea level, you can visit that site here. Unfortunately you need to provide pressure at sea level, but again the Internet helps. I found a local meteorological site that had an iPad app, this app showed the area around where I live (on the South Coast of England) and four weather stations all within a few miles of me. These stations updated their sea level pressure and sea level temperature every 10 minutes or so. However, you should be able to find local pressure on the Internet.

If I entered the sea level pressure from the website (and not that reported by the Adafruit library), I got my correct height. It must be that the library uses the standard sea level pressure of 101325pa. A little bit more detective work and I found that if you call

sensor.read_altitude()

It will use the standard sea level pressure, but if you add the correct sea level pressure between the brackets like so

sensor.read_altitude(103554)

it gave the correct answer. I will send the actual sea level pressure to the sub routine that handles the BMP180 and completely ignore the sea level value provided by the library.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s