Kunkune

BMP390 Arduino Guide: Pressure, Temperature and Altitude

BMP390 Arduino Guide: Pressure, Temperature and Altitude

By Kunkune | Published: 2026-11-03

Category: How-to Guides

Wire a BMP390 barometric pressure sensor to Arduino over I2C, read pressure and temperature, and convert pressure to approximate altitude with a clear checkpoint at each step.

Quick answer

Connect the BMP390 to your Arduino over I2C, confirm it appears on the bus, then read pressure and temperature before converting pressure to approximate altitude. The conversion is only as good as the reference pressure you supply, so treat altitude as an estimate.

Why altitude needs a reference pressure

The sensor reports pressure and temperature directly; approximate altitude is a calculation you perform. The standard barometric formula compares measured pressure to a sea-level reference pressure. If you leave the reference at a default value while local weather shifts, the altitude reading will drift even when the sensor has not moved.

For relative changes, such as detecting a floor change or a sealed enclosure being opened, you can record a baseline pressure at a known position and compare later readings to it. That avoids depending on an absolute sea-level value.

I2C wiring and address checkpoints

The BMP390 uses I2C, so wiring is short: power, ground, and the two signal lines. The most common failures are swapped signal lines, a missing common ground, and using a board whose logic level does not match the sensor. Check those before changing code.

Step-by-step BMP390 setup and altitude calculation

  1. Wire the sensor to the Arduino: Connect the sensor's power and ground to the Arduino, then connect SDA to SDA and SCL to SCL. On most Arduino boards SDA is A4 and SCL is A5, but check your specific board because some models use different pins. Common mistake: crossing SDA and SCL, which usually makes the sensor invisible on the bus. Verify the board's I2C pinout before powering up.
  2. Confirm the sensor appears on the I2C bus: Upload a simple I2C scanner sketch and open the serial monitor. The scanner should report the BMP390's address. If nothing appears, recheck wiring and power before touching the library code. Checkpoint: a missing address is a wiring or power problem, not a calculation problem. Do not proceed to pressure readings until the address is detected.
  3. Install a compatible BMP390 library and read pressure and temperature: Use a library that explicitly supports the BMP390, then run its basic example to print pressure and temperature. Watch for plausible values: room temperature should be near ambient, and pressure should be in the range you expect for your elevation. Common mistake: using a BMP180 or BMP280 example that does not match the sensor. Confirm the library names the BMP390, not just the BMP series.
  4. Choose a reference pressure for altitude: Decide whether you need absolute altitude or relative change. For absolute altitude, supply a local sea-level reference pressure from a reliable weather source and update it when conditions change. For relative change, record the pressure at a known baseline and compare later readings to it. Common mistake: leaving a hard-coded sea-level value in place for weeks. State which reference you are using so the altitude number has meaning.
  5. Apply the barometric formula and sanity-check the result: Convert pressure to altitude with the standard barometric formula using your reference pressure. Compare the result with a known elevation or with the relative change you expect. If the number is far off, check units (pascals versus hectopascals) and the reference value before adjusting the formula. Common mistake: mixing pressure units between the sensor reading and the formula. A unit mismatch produces a large, consistent error rather than random noise.

Product facts

  • BMP390 Precision Barometric Pressure, Temperature, Approximate Altitude Sensor: BMP390 Precision Barometric Pressure, Temperature, Approximate Altitude Sensor It provides the pressure and temperature readings this tutorial converts into an approximate altitude, so you do not need separate sensors for the basic measurement.
    BMP390 Precision Barometric Pressure, Temperature, Approximate Altitude Sensor
    BMP390 Precision Barometric Pressure, Temperature, Approximate Altitude Sensor

Shop Related Products

BMP390 Precision Barometric Pressure, Temperature, Approximate Altitude Sensor

BMP390 Precision Barometric Pressure, Temperature, Approximate Altitude Sensor

$9.17 $13.90

Shop Now