Skip to content

kriswiner/LPS28DFW

Repository files navigation

LPS28DFW

ST water-resistant barometer with interrupt and 128 data-sample FIFO

Basic sketch for a pressure monitoring device with SPI flash memory for logging, combo accel/gyro for motion sensing, a watchdog accel for wake-on-motion functionality and two combination barometer/temperature sensors, one on the main pcba and one on a daughter board all managed by an STM32WB5MMG (BLE-enabled CM4F) host module.

The sketch demonstrates how to configure the two LPS28DFW barometers (each on the same I2C bus but with different I2C addresses) including selecting the full range (1260 hPa or 4096 hPa), data rate (4 - 200 Hz), averaging, low-pass filtering, etc. The sketch demonstrates how to enable the interrupt and configure it to detect data ready, FIFO full, and various error conditions. The sketch demonstrates how to read the pressure and temperature data from the two independent sensors, properly scale it and output the data onto the Serial monitor. In addition to reading the instantaneous pressure and temperature, the sketch demonstrates how to set up the FIFO, configure the interrupt to detect when the watermark is reached, and then read the FIFO and output the (averaged) FIFO pressure data.

The sketch assumes that each LPS28DFW barometer is to be configured identically, but the parameterization used in the sketch can easily be modified to select different configurations for each barometer depending on the application.

The sketch is well-commented and shows the user how to use most of the capabilities of this barometer. The sketch should serve a a good starting point to customize for most applications. The repository is not strictly in an Arduino library format. However, by placing all of the files into a single folder, the main sketch can be compiled and run within the Arduino IDE.

Releases

No releases published

Packages

No packages published

Languages