Pages

Wednesday, February 5, 2014

Adafruit makes a nice barometric pressure sensor (BMP180), but their tutorial is designed for the BMP085 and does not compile on Arduino 1.05

It has a built in temperature sensor, and we calculate our current altitude, which is not exact, and can fluctuate with the weather.

Here is how to make it work, and I've added a bunch of calculations for US units of measure. The 4 connections are in the code below. This is a 5v friendly board, and works with the UNO with no modifications.

/***************************************************
This is an example for the BMP085 Barometric Pressure & Temp Sensor

Designed specifically to work with the Adafruit BMP085 Breakout
----> https://www.adafruit.com/products/391

These displays use I2C to communicate, 2 pins are required to
interface
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!

Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/
//Modified by Steve Spence of http://arduinotronics.blogspot.com

// Connect VIN of the BMP180 sensor to 5.0V //Make sure you have a 5v sensor, otherwise use the 3.3v power pin on the Arduino

// you can get a more precise measurement of altitude
// if you know the current sea level pressure which will
// vary with weather and such. If it is 1015 millibars
// that is equal to 101500 Pascals.
// Serial.print("Real altitude = ");
// Serial.print(bmp.readAltitude(101500));
// Serial.println(" meters");