ESP32 and BMP085 example

This sensor is obsolete now and has been replaced by newer ones but if you still have them lying about then this is how to connect them up to an ESP32

The BMP085 is a high-precision, ultra-low power barometric pressure sensor for use in advanced mobile applications. With a range of 300 hPa to 1100 hPa, an absolute accuracy of 2.5 hPa, and a noise level of down to 0.03 hPa (which is equivalent to an altitude change of merely 0.25 m) the BMP085 offers superior performance.




esp32 and bmp085
esp32 and bmp085


Install the Adafruit BMP085 library via the Arduino IDE


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

Designed specifically to work with the Adafruit BMP085 Breakout

These displays use I2C to communicate, 2 pins are required to
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

// Connect VCC of the BMP085 sensor to 3.3V (NOT 5.0V!)
// Connect GND to Ground
// Connect SCL to i2c clock – on ‘168/’328 Arduino Uno/Duemilanove/etc thats Analog 5
// Connect SDA to i2c data – on ‘168/’328 Arduino Uno/Duemilanove/etc thats Analog 4
// EOC is not used, it signifies an end of conversion
// XCLR is a reset pin, also not used here

Adafruit_BMP085 bmp;

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

void loop() {
Serial.print(“Temperature = “);
Serial.println(” *C”);

Serial.print(“Pressure = “);
Serial.println(” Pa”);

// Calculate altitude assuming ‘standard’ barometric
// pressure of 1013.25 millibar = 101325 Pascal
Serial.print(“Altitude = “);
Serial.println(” meters”);

Serial.print(“Pressure at sealevel (calculated) = “);
Serial.println(” Pa”);



Open the serial monitor and you should see something like this

Temperature = 24.00 *C
Pressure = 101779 Pa
Altitude = -37.32 meters
Pressure at sealevel (calculated) = 101776 Pa

Temperature = 25.00 *C
Pressure = 101772 Pa
Altitude = -37.32 meters
Pressure at sealevel (calculated) = 101774 Pa



Previous articleESP32 performing a software reset
Next articleESP32 and Bargraph display example