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

no-std lps22hb

A platform agnostic driver to interface with LPS22HB pressure sensor module

2 releases

0.0.2 Aug 15, 2021
0.0.1 Apr 17, 2021

#266 in Embedded development

MIT license

281 lines

Rust LPS22HB pressure sensor driver

Maintenance Intention

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

Inspired by and partially based on another STMicroelectronics MEMS driver.

This driver allows you to:

  • read pressure and temperature
  • check if sensor is reachable


This library is work in progress. Not all features are implemented yet. Contributions are welcome.


  • output data rate setting
  • interrupts configuration
  • FIFO configuration
  • reading reference pressure
  • calibration
  • reading data ready status
  • reading data overrun status

Some blog post

The device

The LPS22HB 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: LPS22HB


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.