The 7Semi BMP58x Arduino Library is a lightweight, register-level driver for the Bosch Sensortec BMP58x barometric pressure sensor. It supports both I2C and SPI communication on Arduino-core platforms. The library also exposes advanced features such as oversampling control, output data rate, IIR filtering, interrupts, FIFO, out-of-range detection, and user NVM access.
- Supports I2C and SPI
- Configurable:
- Oversampling (OSR)
- Output Data Rate (ODR)
- IIR filtering
- FIFO
- Interrupts (DRDY, FIFO, OOR)
- Out-of-Range (OOR) window
- User NVM read/write
- Optional custom I2C / SPI pins on ESP32
| BMP58x Pin | MCU Pin | Notes |
|---|---|---|
| VDD | 3.3V | 3.3V only (do NOT use 5V) |
| GND | GND | Common ground |
| SDI | SDA | I²C data |
| SCK | SCL | I²C clock |
| INT | GPIO (optional) | Required only for interrupts |
| BMP58x Pin | MCU Pin | Notes |
|---|---|---|
| VDD | 3.3V | 3.3V only |
| GND | GND | Common ground |
| SCK | SPI SCK | Clock |
| SDI | SPI MOSI | Master → sensor |
| SDO | SPI MISO | Sensor → master |
| CS | GPIO | Chip Select (active-low) |
| INT | GPIO (optional) | Interrupt output |
SPI Notes
- SPI mode MODE0 required
- Dummy byte is required after address (handled by library)
- CS must stay LOW during the entire transaction
Notes
SPI mode: MODE0
Start with 1 MHz SPI clock
Keep SPI wires short for reliability
- Open Arduino IDE
- Go to Library Manager
- Search for 7Semi BMP58x
- Install
- Download this repository as ZIP
- Arduino IDE → Sketch → Include Library → Add .ZIP Library
float tempC;
bmp.readTemperatureC(tempC);
Serial.println(tempC);
Returns temperature in degrees Celsius.
float pressure;
bmp.readPressurePa(pressure);
Serial.println(pressure);
Returns pressure in Pascals (Pa).
float tempC;
float pressure;
bmp.readTemperaturePressure(tempC, pressure);Reads both values in one burst measurement.
float altitude;
bmp.readAltitudeM(1013.25, altitude);Returns altitude in meters using sea level pressure reference.
bmp.setOSR(OSR::OSR_8, OSR::OSR_8);Data Rate:
OSR::OSR_1
OSR::OSR_2
OSR::OSR_4
OSR::OSR_8
OSR::OSR_16
OSR::OSR_32
OSR::OSR_64
OSR::OSR_128
Output Data Rate
bmp.setODR(ODR::ODR_10_Hz, PowerMode::Normal);Controls how often the sensor produces new data.
bmp.setIIR(IIRCoeff::IIRCoeff_7, IIRCoeff::IIRCoeff_7);Smooths pressure and temperature readings.
Configure FIFO
bmp.configureFIFO(FIFOFrame::PressTemp, 0, 10, FIFOMode::StreamToFIFO);Stores sensor measurements in an internal buffer.
uint8_t count = bmp.getFIFOCount();Returns number of frames currently stored in FIFO.
FIFORead frame = bmp.readFIFOFrame();Returns temperature and pressure stored in FIFO.
Configure Interrupt Pin
bmp.configureInterruptPin(true, true, false, true);bmp.setInterruptSources(true, false, false, false);
-
ata Ready
-
FIFO Full
-
FIFO Threshold
-
Pressure Out of Range
InterruptStatus status = bmp.readInterruptStatus();
Returns interrupt flags.bmp.setOORWindow(101325, 50, 3);
Triggers interrupt if pressure moves outside the defined range.
Read NVM Status
NVMStatus status = bmp.readNVMStatus();
Returns NVM ready/error flags.
uint16_t value;
bmp.readNVMUserRow(0x20, value);Reads user programmable memory.
bmp.writeNVMUserRow(0x20, 1234);
Writes value to user NVM memory.
#include <Wire.h>
#include "7Semi_BMP58x.h"
BMP58x_7Semi bmp;
void setup() {
Serial.begin(115200);
if (!bmp.beginI2C(Wire, 0x46, 400000)) {
Serial.println("BMP58x not found!");
while (1);
}
}
void loop() {
float tC, pPa;
if (bmp.readTemperaturePressure(tC, pPa)) {
Serial.print("T = ");
Serial.print(tC, 2);
Serial.print(" C, P = ");
Serial.print(pPa, 2);
Serial.println(" Pa");
}
delay(200);
}