You are on page 1of 14

BMP 180 Pressure Sensor

Tutorial

By: Sabrina Jones


Harold Washington College (City Colleges of Chicago)
Overview of BMP Pressure Sensor board

BMP180 Barometric Pressure/Temperature/Altitude Sensor- 5V read,y (2017),


(https://www.adafruit.com/product/1603)

The BMP Pressure Sensor is a replacement for the BMP085 but it also entirely identical
to the original. Having either sensor will suffice as a low-cost method for measuring
barometric pressure and temperature.

Typical uses for this sensor could include, but are not limited to:
The fritzing image below was obtained from the Arduino website located here:
(https://learn.adafruit.com/assets/484). This fritzing image will better help the with the
wiring of the BMP180 board.

Connecting to the Arduino:


SDA, SCL, 3.3V, GND are the pins
that will be used for this tutorial. A
description of the pins can be seen in
the fritzing schematic below. The
voltage (red) is connected the 3.3volt
power pin on the Arduino. The
ground (black) can be connected to
either GND pin. The SDA is
connected to the A4 analog pin while
the SCL is connected to the A5
analog pin.

Arduino BMP180 Sensor


GND GND
3V3 3vo
A4 SDA
A5 SCL
The Fritzing Image created below is using a BMP085 Pressure Sensor rather than the
BMP180 version presented in this tutorial for Fritzing purposes. The BMP085 sensor is
similar in capabilities and hardware. The same schematic applies:


Arduino IDE
Google Arduino IDE and select the first link provided. The subsequent page should look
like this:

Select which computer operating system the computer you will be programming on is
using and click on the Just Download link and follow the instructions to install.

Arduino Libraries
Arduino libraries are a great way to share code. They take a desired action and create
simple functions to allow for this task. The Arduino IDE already comes with a number of
libraries and sketches. One can also write the code from scratch or download the libraries
and import them to use them within a sketch.

For this particular sensor the libraries can be found at Adafruit.com and search for Bosch
BMP180 Breakout Board. This should bring you to a page like the one shown below.
The schematic of the sensor as well as directions to connect the sensor to an Arduino
board are given on this site.
To download the necessary libraries and code you will use Github. Github is a site that
offers source code and the ability to download other programmers code or contribute
your own.

To conveniently download the files directly from Github Adafruit offers a link.

Once you click on the link your computer will begin to download the zip file.

Once the zip has been downloaded you should be able to go in your download files and
select the uncompressed file labeled Adafruit_BMP085_Unified-master.
To include the libraries in the Arduino IDE for use you must add the ZIP.

You then select the file from your downloads and restart the IDE.

In the Arduino IDE, go to:


File > Examples > BMP180_altitude_example > SFE_BMP180 _example

Once the file is open it will start your Arduino IDE and present you with a sketch.
After adding the library/zip file to your Arduino libraries the sensor is ready to go.
To upload your sketch to begin outputting data from the sensor you must connect youre
Arduino board to your computer (with the sensor connected correctly as the previous
diagram presented). To connect the Arduino to your computer you will need a standard
USB 2.0 cable type A to type B.

You must select the port for a USB modem and then upload your code and open the serial
monitor on the upper right-hand corner to view your data output.
BMP180 Pressure Sensor Program Code
Code Breakdown

Indicated Libraries

This section is the part that indicates which libraries will be used that can be downloaded
from the Adafruit website on the sensors page.


Setup: of Loop for Sensor Readings

This is the part where the sensor will begin taking readings on a continuous loop every
indicated milliseconds. This section is making sure that the data output is categorized for
each RGB photodiode. This way you can get the readings for each separately. Loop()
indicates that this will be continuous and the data will be printed to the Serial Monitor,
there will be a delay, and then the loop will begin again.
The delay() is in milliseconds and therefore 5,000 milliseconds, the default delay, is 2
seconds worth between loops.
When you are ready to begin taking measurements just click Upload and once the lower
left of the screen says Done uploading, you are ready to open you Serial Monitor and
view your data at the correct baud setting.

Your data should look something like this:

Youve successfully completed the wiring and setup for the BMP180 Pressure Sensor.