BMP180 Barometric Pressure Sensor

The BMP180 is a high-precision digital barometric pressure and temperature sensor, designed for applications such as weather monitoring, altitude measurement, and GPS enhancement. It operates via the I²C protocol, ensuring seamless integration with embedded systems.

BMP180 Barometric Pressure Sensor image
BMP180 · I2C
I2C
Interface
4pins
Connections
1.8-3.6V
Supply
±0.12 hPa
Accuracy
-40 to +85 °C
Operating temp
On this page

BMP180 pinout

4 pins · I2C

The BMP180 uses I²C communication for temperature and pressure sensing:

View:
BMP180 Barometric Pressure Sensor pinout
PinTypeDescriptionNotes
VINPowerPower input3.3V or 5V compatible
GNDPowerGround connection
SDACommunicationI²C data lineConnect to ESP32 GPIO21
SCLCommunicationI²C clock lineConnect to ESP32 GPIO22
  • I²C Only: No SPI support

  • I²C Address: Fixed at 0x77

  • Temperature: -40°C to +85°C

  • Pressure: 300-1100 hPa

  • Altitude: Calculate from pressure readings

  • Power: 3.3V or 5V compatible

  • Successor: BMP280 offers better accuracy

  • Applications: Weather monitoring, altitude tracking

Wiring the BMP180 to ESP32

4 connections · all required

To interface the BMP180 with an ESP32 using I²C:

BMP180 Barometric Pressure Sensor wiring with ESP32
BMP180 pinESP32 pinPurpose
VIN3.3VPower supply
GNDGNDGround
SDAGPIO21I²C data line
SCLGPIO22I²C clock line
  • I²C Address: Fixed at 0x77

  • Power: Use 3.3V for ESP32

  • Simple: Only 4 wires needed

  • Legacy: Consider BMP280 for new projects

  • Reliable: Proven design for basic applications

BMP180 code examples

5 platforms
Platform:

BMP180 Arduino example

Copy
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP085_U.h>

Adafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085);

void setup() {
  Serial.begin(115200);
  if (!bmp.begin()) {
    Serial.println("Could not find a valid BMP180 sensor, check wiring!");
    while (1);
  }
}

void loop() {
  sensors_event_t event;
  bmp.getEvent(&event);
  if (event.pressure) {
    Serial.print("Pressure: ");
    Serial.print(event.pressure);
    Serial.println(" hPa");
  }
  float temperature;
  bmp.getTemperature(&temperature);
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" *C");
  delay(2000);
}

This Arduino code initializes the BMP180 sensor using the Adafruit BMP180 library. It reads and prints atmospheric pressure and temperature values every two seconds.

BMP180 ESP-IDF example

Copy
// Requires the esp-idf-lib BMP180 driver from the ESP Component Registry:
//   idf.py add-dependency "esp-idf-lib/bmp180^1.0.7"

#include <stdio.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "bmp180.h"

#define SDA_GPIO GPIO_NUM_21
#define SCL_GPIO GPIO_NUM_22

void app_main(void)
{
    ESP_ERROR_CHECK(i2cdev_init());

    bmp180_dev_t dev;
    memset(&dev, 0, sizeof(bmp180_dev_t));
    ESP_ERROR_CHECK(bmp180_init_desc(&dev, 0, SDA_GPIO, SCL_GPIO));
    ESP_ERROR_CHECK(bmp180_init(&dev));

    while (1) {
        float temperature;
        uint32_t pressure;
        if (bmp180_measure(&dev, &temperature, &pressure, BMP180_MODE_STANDARD) == ESP_OK)
            printf("Temp %.1f C, Press %lu Pa\n", temperature, (unsigned long)pressure);
        else
            printf("Could not read data from sensor\n");
        vTaskDelay(pdMS_TO_TICKS(2000));
    }
}

ESP-IDF ships no BMP180 driver of its own, so this example uses the maintained esp-idf-lib BMP180 driver from the ESP Component Registry. Install it into your project first with idf.py add-dependency "esp-idf-lib/bmp180^1.0.7", then build as usual.

bmp180_measure() runs one complete blocking measurement and returns temperature in Celsius and pressure in Pascal. BMP180_MODE_STANDARD balances speed and noise; use BMP180_MODE_ULTRA_HIGH_RESOLUTION for the finest pressure resolution. The same driver also works with the older, protocol-compatible BMP085.

BMP180 ESPHome example

Copy
i2c:
  sda: GPIO21
  scl: GPIO22

sensor:
  - platform: bmp085  # the bmp085 platform also drives the BMP180
    temperature:
      name: "BMP180 Temperature"
    pressure:
      name: "BMP180 Pressure"
    address: 0x77

ESPHome's bmp085 platform drives the whole BMP085/BMP180 family (the two chips are protocol-compatible) at address 0x77 on the default I2C pins.

BMP180 PlatformIO example

Copy
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
lib_deps =
    adafruit/Adafruit BMP085 Unified @ ^1.1.3
    adafruit/Adafruit Unified Sensor @ ^1.1.15
src/main.cppCopy
#include <Arduino.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP085_U.h>

Adafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085);

void setup() {
  Serial.begin(115200);
  if (!bmp.begin()) {
    Serial.println("Could not find a valid BMP180 sensor, check wiring!");
    while (1);
  }
}

void loop() {
  sensors_event_t event;
  bmp.getEvent(&event);
  if (event.pressure) {
    Serial.print("Pressure: ");
    Serial.print(event.pressure);
    Serial.println(" hPa");
  }
  float temperature;
  bmp.getTemperature(&temperature);
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" *C");
  delay(2000);
}

This PlatformIO code integrates the BMP180 sensor to read temperature and pressure values, printing them every two seconds.

BMP180 MicroPython example

Copy
# Requires driver: bmp180.py from https://github.com/micropython-IMU/micropython-bmp180
# Copy it to the board: mpremote cp bmp180.py :
from time import sleep
from machine import I2C, Pin
from bmp180 import BMP180

# Initialize I2C (SDA=GPIO21, SCL=GPIO22)
i2c = I2C(0, scl=Pin(22), sda=Pin(21))

bmp = BMP180(i2c)
bmp.oversample_sett = 2

while True:
    print("Temperature: {:.1f} C".format(bmp.temperature))
    print("Pressure: {:.1f} hPa".format(bmp.pressure / 100))
    sleep(2)

The example uses bmp180.py from micropython-IMU/micropython-bmp180 (copy it to the board with mpremote). oversample_sett selects the accuracy/speed trade-off (0-3), and the driver exposes temperature (Celsius) and pressure (Pascal, divided by 100 for hPa) on the default I2C pins.

BMP180 specifications

From the datasheet
Interface
I²C
Pressure Range
300 hPa to 1100 hPa
Temperature Range
-40°C to +85°C
Operating Voltage
1.8V to 3.6V
Resolution
0.01 hPa
Accuracy
±0.12 hPa
Power Consumption
3 µA in sleep mode
Output
Temperature and Pressure (Digital)
Package Dimensions
3.6 mm × 3.8 mm × 0.93 mm
Weight
1.0 g

About the BMP180

The BMP180 is Bosch’s direct successor to the BMP085, and the two are protocol-identical: same I2C address (0x77), same register layout, same commands, so any BMP085 library or driver runs the BMP180 unmodified. What changed was the package - Bosch shrank the die and improved power efficiency, giving the BMP180 a smaller footprint and better energy consumption than the chip it replaced.

That compatibility is now more historical than practical: Bosch discontinued the BMP180 itself years ago, the same fate that already befell the BMP085 it replaced - distributor listings show it obsolete with no current production. If you are picking a part for a new build rather than repairing one on an existing board, there is little reason to reach for either chip today.

BMP280 is what most current tutorials and breakout boards use in the BMP180’s place - smaller still, lower noise, and it adds SPI - though Bosch has since discontinued that raw chip too, pointing new designs at the BMP390. For a part still in full production, BME280 adds a humidity channel on top and remains active.

BMP180 troubleshooting

3 common issues

Library Not Found Error

›

Issue: The Arduino IDE cannot find the required BMP180 library.

Solution: Ensure that you have installed the Adafruit BMP180 library from the Arduino Library Manager. Restart the Arduino IDE after installation.

Sensor Initialization Failure

›

Issue: The BMP180 sensor fails to initialize, and the error message Could not find a valid BMP180 sensor appears.

Solution: Verify the wiring connections and ensure the sensor is receiving power. Use an I²C scanner to detect the sensor's address.

Incorrect Readings

›

Issue: The sensor outputs incorrect temperature or pressure readings.

Solution: Check the reference sea-level pressure value and recalibrate the sensor if necessary.

Resources