adafruit_mprls

CircuitPython library to support Honeywell MPRLS digital pressure sensors

  • Author(s): ladyada

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_mprls.MPRLS(i2c_bus, *, addr=24, reset_pin=None, eoc_pin=None, psi_min=0, psi_max=25)

Driver base for the MPRLS pressure sensor

Parameters:
  • i2c_bus (I2C) – The I2C bus the MPRLS is connected to
  • addr (int) – The I2C device address. Defaults to 0x18
  • reset_pin (Pin) – Optional digitalio.pin for hardware resetting
  • eoc_pin (Pin) – Optional digitalio pin for getting End Of Conversion signal
  • psi_min (float) – The minimum pressure in PSI, defaults to 0
  • psi_max (float) – The maximum pressure in PSI, defaults to 25

Quickstart: Importing and using the MPRLS

Here is an example of using the MPRLS class. First you will need to import the libraries to use the sensor

import board
import adafruit_mprls

Once this is done you can define your board.I2C object and define your sensor object

i2c = board.I2C()  # uses board.SCL and board.SDA
mpr = adafruit_mprls.MPRLS(i2c, psi_min=0, psi_max=25)

Now you have access to the pressure attribute

pressure = mpr.pressure
pressure

The measured pressure, in hPa