#embedded-hal-driver #pressure #sensor #mems #lps25

no-std lps25hb

A platform agnostic driver to interface with LPS25HB pressure sensor module

4 releases

0.1.0 Dec 8, 2021
0.0.4 Dec 4, 2021
0.0.3 Aug 16, 2021
0.0.2 Aug 15, 2021
0.0.1 Aug 15, 2021

#509 in Embedded development

Download history 8/week @ 2022-01-27 2/week @ 2022-02-03 2/week @ 2022-02-10 7/week @ 2022-02-17 5/week @ 2022-02-24 3/week @ 2022-03-03 12/week @ 2022-03-10 23/week @ 2022-03-17 1/week @ 2022-03-24 4/week @ 2022-03-31 4/week @ 2022-04-07 3/week @ 2022-04-14 2/week @ 2022-04-21 32/week @ 2022-04-28 27/week @ 2022-05-05 66/week @ 2022-05-12

128 downloads per month

MIT license

645 lines

Rust LPS25HB pressure sensor driver

Maintenance Intention

A platform agnostic Rust driver for the ST Microelectronics LPS25HB pressure sensor, based on the embedded-hal traits.

Inspired by and partially based on another STMicroelectronics driver.

This driver allows you to:

  • check if sensor is reachable
  • read pressure and temperature
  • set data rate
  • configure interrupts generation
  • configure FIFO


Basic functions work, see example. Almost all functions added, and should work fine, but many aren't tested yet.


This library is work in progress. Not all features are implemented yet. Currently only the I2C interface is implemented. Contributions are welcome.


  • add device ID check and power up in the new() function
  • add an example using FIFO and/or interrupt generation
  • add SPI interface and an example using it
  • add more documentation (main block in the lib.rs)

Some blog post

The device

The LPS25HB is an ultra-compact piezoresistive absolute pressure sensor which functions as a digital output barometer. The device comprises a sensing element and an IC interface which communicates through I2C or SPI from the sensing element to the application.

Datasheet: LPS25HB


To use this driver, import this crate and an embedded_hal implementation, then instantiate the device.

Please find additional examples using hardware in this repository: examples


For questions, issues, feature requests, and other changes, please file an issue in the github project.


Licensed under either of


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.