If you have ever worked on a drone, weather station, or any altitude-aware IoT project, you know how critical accurate barometric pressure sensing is. The BMP388 from Bosch Sensortec is one of the most precise and reliable barometric pressure sensors available for makers and engineers alike. In this comprehensive guide, you will learn everything about the BMP388 — its architecture, key specs, wiring with Arduino, working code examples, calibration tips, and practical project ideas that push this sensor to its limits.
What is the BMP388?
The BMP388 is a digital barometric pressure sensor developed by Bosch Sensortec, designed for high-precision applications such as drones, indoor navigation, weather monitoring, and fitness devices. It measures atmospheric pressure in the range of 300 hPa to 1250 hPa and calculates altitude based on the barometric formula. The sensor supports both I2C and SPI communication interfaces, making it extremely flexible for various microcontroller platforms.
Compared to its predecessor, the BMP280, the BMP388 offers significantly lower noise, better long-term stability, and a more advanced FIFO buffer that can store up to 72 pressure/temperature frames — a game-changer for applications where continuous sampling is needed without keeping the MCU awake all the time.
The BMP388 is also pin-compatible with BMP390, so library support and breakout board form factors are consistent across the product line.
Key Specifications
| Parameter | Value |
|---|---|
| Pressure Range | 300 – 1250 hPa |
| Pressure Resolution | 0.016 Pa (RMS noise) |
| Temperature Range | -40°C to +85°C |
| Relative Accuracy | ±0.08 hPa (equivalent to ±0.66 m altitude) |
| Absolute Accuracy | ±0.5 hPa |
| Supply Voltage | 1.65 V – 3.6 V |
| Current Consumption | 2.74 µA (1 Hz, normal mode) |
| Interface | I2C (up to 3.4 MHz), SPI (up to 10 MHz) |
| FIFO Buffer | 512 bytes (up to 72 frames) |
| Package | LGA-10L (2.0 × 2.0 × 0.75 mm) |
BMP388 vs BMP280: What Changed?
Many hobbyists come from BMP280 and wonder if upgrading to the BMP388 is worthwhile. The short answer is: absolutely, especially for precision applications.
- Noise: BMP388 has 3x lower noise than BMP280 (0.016 Pa vs 0.05 Pa RMS). This directly translates to altitude resolution of about ±13 cm vs ±40 cm.
- Sampling Rate: BMP388 supports up to 200 Hz output data rate vs BMP280’s 157 Hz, with more flexible oversampling configurations.
- FIFO: BMP280 has no FIFO. BMP388’s 512-byte FIFO stores 72 frames of pressure + temperature data, enabling low-power burst sampling.
- IIR Filter: BMP388 has a more advanced IIR coefficient selection (1, 3, 7, 15, 31, 63, 127) vs BMP280’s more limited options.
- Interrupts: BMP388 has a dedicated INT pin with configurable data-ready, FIFO watermark, and FIFO full interrupts.
- Long-term Stability: BMP388 is rated for drift of less than 0.5 hPa over its lifetime, making it far more reliable for long-deployed weather stations.
BMP280 Barometric Pressure and Altitude Sensor I2C/SPI Module
Start with the BMP280 for basic pressure sensing projects — a cost-effective step before upgrading to BMP388 for precision applications.
Pinout and Interface Options
Most BMP388 breakout boards expose the following pins:
- VCC: Power supply (3.3V recommended; use voltage regulator if on 5V system)
- GND: Ground
- SDA/SDI: I2C data / SPI MOSI
- SCL/SCK: I2C clock / SPI clock
- CS: SPI chip select (pull HIGH for I2C mode)
- SDO/SA0: I2C address select (LOW = 0x76, HIGH = 0x77) / SPI MISO
- INT: Interrupt output (active-low or active-high, configurable)
The BMP388 chip itself runs at 1.65–3.6V. Most breakout boards include onboard voltage regulation and level shifting so you can safely connect them to both 3.3V and 5V Arduino boards. Always verify your specific breakout board’s datasheet before connecting.
Wiring BMP388 with Arduino
Here is the standard I2C wiring for connecting the BMP388 breakout board to an Arduino Uno or Nano:
| BMP388 Pin | Arduino Pin |
|---|---|
| VCC | 3.3V |
| GND | GND |
| SDA | A4 (SDA) |
| SCL | A5 (SCL) |
| CS | Not connected (or pull HIGH) |
| SDO | GND (for address 0x76) |
For SPI mode, connect SDA→MOSI, SCL→SCK, SDO→MISO, and CS to any digital pin. Set CS pin LOW before communication and HIGH after.
Arduino Code: Reading Pressure and Altitude
Install the Adafruit BMP3XX library from the Arduino Library Manager (also install Adafruit Unified Sensor and Adafruit BusIO as dependencies).
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP3XX.h>
#define SEALEVELPRESSURE_HPA (1013.25)
Adafruit_BMP3XX bmp;
void setup() {
Serial.begin(115200);
while (!Serial);
if (!bmp.begin_I2C()) {
Serial.println("BMP388 not found! Check wiring.");
while (1);
}
// Set oversampling and IIR filter
bmp.setTemperatureOversampling(BMP3_OVERSAMPLING_8X);
bmp.setPressureOversampling(BMP3_OVERSAMPLING_4X);
bmp.setIIRFilterCoeff(BMP3_IIR_FILTER_COEFF_3);
bmp.setOutputDataRate(BMP3_ODR_50_HZ);
Serial.println("BMP388 initialized!");
}
void loop() {
if (!bmp.performReading()) {
Serial.println("Failed to read BMP388");
return;
}
Serial.print("Temperature: ");
Serial.print(bmp.temperature);
Serial.println(" °C");
Serial.print("Pressure: ");
Serial.print(bmp.pressure / 100.0);
Serial.println(" hPa");
Serial.print("Altitude: ");
Serial.print(bmp.readAltitude(SEALEVELPRESSURE_HPA));
Serial.println(" m");
Serial.println("---");
delay(1000);
}
Upload this sketch, open Serial Monitor at 115200 baud, and you should see live pressure, temperature, and altitude readings. The key parameters to tune are oversampling levels (higher = more accurate but slower) and the IIR filter coefficient (smooths out short-term fluctuations).
How Altitude Calculation Works
The BMP388 does not directly measure altitude — it measures atmospheric pressure. Altitude is derived from the barometric formula, which relates pressure to height above sea level:
Altitude = 44330 × [1 – (P / P0)^(1/5.255)]
Where P is the measured pressure in hPa and P0 is the sea level pressure (typically 1013.25 hPa). The Adafruit library’s readAltitude(seaLevelPressure) method implements exactly this formula.
Why does sea level pressure matter? Because atmospheric pressure varies with weather conditions. On a stormy day, sea level pressure may drop to 990 hPa, which would make your sensor think you are 190 m higher than you actually are. For flight-critical applications, you must feed in the current METAR (meteorological aerodrome report) QNH value for your region.
For relative altitude measurements (e.g., drone hover height), record a baseline pressure reading at launch and compute altitude as the difference, eliminating the sea level pressure dependency entirely.
Calibration for Accurate Altitude
Out of the box, the BMP388 provides excellent factory calibration. However, for highest accuracy, consider the following steps:
- Warm-up time: Allow 2–5 minutes of operation after power-on before trusting readings, as the sensor needs to thermally stabilize.
- Self-heating compensation: The BMP388 has a small self-heating effect. Mount it away from heat sources (voltage regulators, motors) and add ventilation if possible.
- Reference altitude calibration: Place the sensor at a known altitude (e.g., ground floor = 0 m) and adjust your sea level pressure reference value until the sensor reads correctly.
- Temperature compensation: The BMP388 performs on-chip temperature compensation using its built-in temperature sensor and factory calibration coefficients stored in NVM. Do not attempt manual compensation unless you have access to a precision reference.
- Oversampling optimization: For a weather station reading every 60 seconds, use maximum oversampling (BMP3_OVERSAMPLING_32X) for best accuracy. For a drone at 100 Hz, use BMP3_OVERSAMPLING_2X to maintain speed.
Power Modes and Low-Power Operation
The BMP388 supports three main power modes:
- Sleep Mode: All circuits off except register access. Current ~2 µA. Use this between measurements in battery-powered applications.
- Forced Mode: MCU triggers a single measurement, sensor returns to sleep automatically. Ideal for ultra-low-power IoT nodes that sample every few minutes.
- Normal Mode: Continuous measurements at configured ODR. Best for real-time applications like drones.
Combined with the FIFO buffer, you can configure the BMP388 to sample at 25 Hz, store 72 frames, and only wake the MCU every ~3 seconds to read the buffer — drastically reducing average current consumption compared to polling every sample.
In forced mode at 1 Hz with default oversampling, total system current can be as low as 3.5 µA, making the BMP388 viable for years-long battery operation on a coin cell in simple weather loggers.
GY-BME280-3.3 Precision Altimeter Atmospheric Pressure Sensor Module
Need pressure + humidity + temperature in one chip? The BME280 is a great companion sensor for environmental monitoring projects alongside the BMP388.
Drone and Weather Station Projects
Drone Altitude Hold
The BMP388 is used in many open-source flight controllers (including Betaflight and ArduPilot) as the primary barometric altimeter. To implement basic altitude hold on a custom drone:
- Record ground pressure at arm/launch.
- Continuously compute relative altitude using the barometric formula.
- Feed altitude into a PID loop controlling throttle output.
- Use a low-pass IIR filter (coefficient 7–15) to reject pressure transients from propeller wash.
The BMP388’s 0.66 m relative accuracy means your drone can theoretically maintain altitude within ±1 m — sufficient for most photography and inspection applications.
Personal Weather Station
Combine the BMP388 with a DHT20 or SHT31 for humidity, an MQ-135 for air quality, and an ESP32 for Wi-Fi connectivity. Log data to a Raspberry Pi running InfluxDB + Grafana for a professional-grade home weather station. The BMP388’s long-term stability ensures your pressure trend graphs remain accurate over months without recalibration.
Hiking Altimeter Watch
Pair the BMP388 with a small OLED display and an Arduino Pro Mini. Power it with a 150 mAh LiPo using forced mode at 0.5 Hz — the system will run for weeks on a single charge. Log elevation gain/loss to an SD card for detailed post-hike analysis.
Troubleshooting Common Issues
- Sensor not found (I2C): Double-check SDA/SCL wiring. Run I2C scanner sketch to verify address (0x76 or 0x77 depending on SDO pin). Ensure 3.3V supply is stable.
- Altitude drifts over time: This is normal — atmospheric pressure changes with weather. Use relative altitude (reference at launch) for stable measurements.
- Noisy readings: Increase oversampling (4x→8x→16x) and increase IIR filter coefficient. Ensure sensor is mechanically isolated from vibration sources.
- Inconsistent readings at startup: Add a 100ms delay after power-on and before first measurement. The BMP388 needs a short startup time.
- SPI not working: Verify CS pin is correctly driven LOW during communication. Ensure SPI mode is 0,0 (CPOL=0, CPHA=0) in your SPI configuration.
Frequently Asked Questions
A: No. The BMP388 is rated for atmospheric pressure only (up to 1250 hPa) and is not waterproof. For underwater depth measurement, look for pressure sensors rated for liquid immersion with appropriate IP ratings.
A: The BMP390 is pin and software compatible with BMP388 but offers slightly improved noise performance (0.009 Pa vs 0.016 Pa) and is aimed at even more demanding applications. For most maker projects, BMP388 is sufficient and often more readily available.
A: Yes. Use the Adafruit CircuitPython BMP3XX library. Enable I2C on the Pi (raspi-config → Interface Options → I2C), then install the library via pip and connect SDA to GPIO2 (pin 3), SCL to GPIO3 (pin 5).
A: With proper calibration and current QNH reference, absolute altitude accuracy is typically ±1–2 m. Relative altitude (change from a reference point) is significantly better at ±0.5 m due to the sensor’s 0.08 hPa relative accuracy spec.
A: The BMP388 measures down to 300 hPa, which corresponds to approximately 9,000 m altitude. This covers most mountaineering applications. For stratospheric balloons (above 30 km), you need a sensor with lower minimum pressure capability.
Ready to Build Your Altitude Sensing Project?
Explore our full range of pressure sensors, temperature modules, and Arduino-compatible components at Zbotic — India’s trusted electronics store for makers, students, and engineers.
Add comment