Project

Getting Started with the Bosch BMP180 Sensor

December 20, 2015 by Alex Udanis

Learn one of the ways to get started with the BMP180 sensor and learn a simple way to improve the data.

The Bosch BMP085 and BMP180 barometric pressure sensors are two small sensors that can measure minute changes in atmospheric pressure.  These sensors, like most barometric pressure sensors, can be used to monitor the weather.  A big benefit to Bosch’s sensors is they are also sensitive enough to measure changes in altitude. This high sensitivity is a double-edged sword though; with the extra sensitivity comes extra noise.  This tutorial will show you how to hook up a Bosch BMP085 or BMP180 breakout board, basic software to get started, and software to improve the data coming from the sensor.

This tutorial shows one of the ways to use this sensor with an Arduino.  There are several Arduino-compatible libraries that can be used with this sensor such as:

In addition to the wide variety of libraries, there are several breakout boards that will work with this tutorial. These include:

When choosing a breakout board for the BMP180, the critical specification is whether or not it can operate at 5v or 3v.  If the board is not 5v compatible, different wiring will be required. 

Parts Required:

 

  • Arduino UNO (other variants will most likely work, but small changes may be needed)
  • USB Cable for the Arduino. (Most likely a type B for an Arduino UNO.)
  • 4x Male Hookup wires
  • Small Breadboard
  • 5v Compatible BMP180 Sensor (Adafruit 1604 used on this project)

Software Required:

  • Arduino IDE (Version 1.6.6 used here)
  • Adafruit BMP085 Library (Sketch -> Include Library-> Manage Libraries->Search for “BMP085”)
  • The Arduino files used in this tutorial (download below)

Instructions:

  • Wire Up the Barometric Pressure sensor to the Arduino
    • Attach Vcc on the sensor breakout board to 5v on the Arduino
      • A red hook-up wire was used for this tutorial
      • Please ensure your breakout board is 5v Compatible
    • Attach GND on the sensor breakout board to GND on the Arduino
      • A brown hookup wire was used for this tutorial
    • Attach SCL on the breakout board to A5 on the Arduino
      • A yellow wire was used for this tutorial
    • Attach SDA on the breakout board to A4 on the Arduino
      • A white wire was used for this tutorial.
    • The wires should look similar to this:

 

  • Download the below files.

BMP180_Alex_Udanis.zip

  • Open the file AAC_BMP180_Part1

    • This is a very basic program to read the pressure from the sensor, convert it to altitude, and send over the serial port to the computer.  

    • Below, 1 minute's worth of data are plotted. 

As you can see from the plotted data, the sensor’s data fluctuates.  In the next step, we will smooth out the data to get more consistent results.

  • Open the file: AAC_BMP180_Part2
    • This program contains a little bit more functionality than the previous program.
    • This takes 1, 25, and 50 samples of data and obtains the average.
    • The data is then sent to the serial port in a .csv format so it can be plotted in Excel.

Looking at the chart below, the 50 sample average is shown in red, the 25 sample average is shown in blue, and the singular sample is shown in orange:

Looking at the data, the averaged samples show a more consistent result.

Conclusion

As you can see, with a little basic processing on the Bosch barometric pressure sensors, the data can be improved. This smoother data could provide better results in many applications such as drones or indoor location systems. This project used a simple moving average to smooth the data, but there are quite a few other smothing algorithms such as exponential smoothing and additive smoothing that could achieve similar (or better!) results.


Video

Give this project a try for yourself! Get the BOM.

4 Comments
  • K
    KEN UKWIZARD December 31, 2015

    I’m interested in the Bosch BMP085 and BMP180 for use with a LED readout circuit.
    Is it possible to locate one!?

    Arduino is not for me thanks.

    Like. Reply
    • P
      Phil-S December 31, 2015
      Without Arduino or MCU of any description, you are going to find this difficult. It's output is digital I2C that needs processing. There might be industrial indicators that will take an I2C input, but are going to cost a lot more than an MCU (Arduino Atmel 328 chip about $3 with bootloader). There are straightforward (Wire.h and LCD.h) libraries ready written for Arduino. LED's are going to be trickier than LCD and use more power. Once you get to grips with this one, there are countless other sensors that use the same system.
      Like. Reply
  • Bryan C. January 29, 2018

    This is a useful demo, thanks. I’m curious if one could be used to sense air movement from a speaker or small changes in the altitude of someones arm.  Are they THAT sensitive or would it be mostly the same noise you are already getting?

    Like. Reply