MicroPython MS5611 Library

ms5611

MicroPython Driver for the TE MS5611 Pressure and Temperature Sensor

  • Author(s): Jose D. Montoya

class micropython_ms5611.ms5611.MS5611(i2c, address: int = 0x77)[source]

Driver for the MS5611 Sensor connected over I2C.

Parameters:
i2c : I2C

The I2C bus the MS5611 is connected to.

address : int

The I2C device address. Defaults to 0x77

Raises:

RuntimeError – if the sensor is not found

Quickstart: Importing and using the device

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

from machine import Pin, I2C
from micropython_ms5611 import ms5611

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

i2c = I2C(1, sda=Pin(2), scl=Pin(3))
ms = ms5611.MS5611(i2c)

Now you have access to the attributes

temp = ms.temperature
press = ms.pressure
property measurements : tuple[float, float]

Temperature and Pressure

property pressure_oversample_rate : str

Sensor pressure_oversample_rate

Mode

Value

ms5611.PRESS_OSR_256

0

ms5611.PRESS_OSR_512

1

ms5611.PRESS_OSR_1024

2

ms5611.PRESS_OSR_2048

3

ms5611.PRESS_OSR_4096

4

property temperature_oversample_rate : str

Sensor temperature_oversample_rate

Mode

Value

ms5611.TEMP_OSR_256

0

ms5611.TEMP_OSR_512

1

ms5611.TEMP_OSR_1024

2

ms5611.TEMP_OSR_2048

3

ms5611.TEMP_OSR_4096

4