Random Nerd Tutorials

Guide for BMP180 Barometric Sensor with Arduino


This post is about how to use the BMP180 barometric sensor with the Arduino. It is also applicable for other similar barometric sensors.

Introducing the BMP180 barometric sensor

The BMP180 barometric sensor (model GY-68) is the one in  the following figure (front and back view). It is a very small module with 1mm x 1.1mm (0.039in x 0.043in).


It measures the absolute pressure of the air around it. It has a measuring range from 300 to 1100hPa with an accuracy down to 0.02 hPa. It can also measure altitude and temperature.

The BMP180 barometric sensor communicates via I2C interface. This means that it communicates with the Arduino using just 2 pins.

Where to buy?

This sensor is very cheap. You can buy one for approximately $3. Find the best price on Maker Advisor.

You can use the preceding links or go directly to MakerAdvisor.com/tools to find all the parts for your projects at the best price!

Pin wiring

Wiring the sensor to the Arduino is pretty straightforward:

Pin Wiring to Arduino Uno
Vin 5V


Wire your sensor to the Arduino as shown in the schematics below.



To control the BMP180 barometric sensor, you need to install the SFE_BMP180 Library.

Installing the SFE_BMP180 Library

  1. Click here to download the SFE_BMP180 library. You should have a .zip folder in your Downloads folder
  2. Unzip the .zip folder and you should get BMP180_Breakout_Arduino_Library-master folder
  3. Rename your folder from BMP180_Breakout_Arduino_Library-master to BMP180_Breakout_Arduino_Library 
  4. Move the BMP180_Breakout_Arduino_Library folder to your Arduino IDE installation libraries folder
  5. Finally, re-open your Arduino IDE

Go to File > Examples >SparkfunBMP180 > SFE_BMP180_example.

This example is very well commented and explained on how the sensor reads the pressure, temperature and computes the altitude.


Set the altitude

Before uploading the code, you need to set up your current altitude. Go to elevationmap.net, insert your address and check your altitude’s location. Set your altitude in the code. The place where you should write your altitude is commented.



After uploading the code, open your serial monitor at a baud rate of 9600.

You’ll be able to see your sensor readings.


Wrapping up

The BMP180 is an interesting sensor to be used in your own weather station.

Because the pressure changes with the altitude, this sensor is also able to compute the altitude.

If you would like to build a complete weather station, here’s some recommended guides:

What other sensors do you found useful in a weather station?Let me know in the comments section below.

Thanks for reading

Learn ESP32 with Arduino IDE

This is our complete guide to program the ESP32 with Arduino IDE, including projects, tips, and tricks! The registrations are open, so SIGN UP NOW »

Recommended Resources

Home Automation using ESP8266 »
Build IoT projects and home automation gadgets with the ESP8266 Wi-Fi module.

Build a Home Automation System »
Learn how to build a automation system using open-source hardware and software from scratch.

Arduino Step-by-Step Projects »
Build 25 cool Arduino projects with our course even with no prior experience!

Leave a Comment:

Add Your Reply

Enroll in our Electronics and Programming Courses:

ESP32, ESP8266, Arduino and much more.