Skip to content

[driver] bmp581 pressure sensor#1339

Merged
salkinium merged 8 commits intomodm-io:developfrom
joelsa:feature/bmp581
Mar 6, 2026
Merged

[driver] bmp581 pressure sensor#1339
salkinium merged 8 commits intomodm-io:developfrom
joelsa:feature/bmp581

Conversation

@joelsa
Copy link
Contributor

@joelsa joelsa commented Mar 3, 2026

Driver for the Bosch Sensortec BMP581 pressure and temperature sensor.

Example code outputs:

Temperature: 40.796 C
Pressure: 96074.19 Pa (960.74 hPa)
Altitude: 446.6 m (approx)

I am actually on 530 m, nearest weather station reports:

grafik

963 hPa at 515 m corresponds to 961 hPa on 530 m, which is basically what the sensor is reading. Absolute pressure accuracy is specified with ±0.5 hPa at 25 °C and ±1.0 hPa (max) over 0–65 °C. Unfortunately my PCB actually gets 40 °C hot, so that reading is correct as well.

Tested the sensor at different output data rates and in both polling and interrupt modes. Could test only in I2C mode and only on STM32 because that's how my board is wired up.

Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Just some minor nitpicks.

joelsa added 2 commits March 5, 2026 20:48
use std::atomic_bool in example
better sign-extension for both pressure and temperature
support blocking usage on smol mcus
remove deprecated nested layers
replace buffer accesses with something more modern
Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@salkinium salkinium enabled auto-merge (squash) March 6, 2026 20:16
@salkinium salkinium merged commit d0fcb0d into modm-io:develop Mar 6, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants