CircuitPython module for the MPL3115A2 barometric pressure & temperature sensor. See examples/ for a demo of the usage.

  • Author(s): Tony DiCola
class adafruit_mpl3115a2.MPL3115A2(i2c, *, address=96)

Instance of the MPL3115A2 sensor. Must specify the following parameters when creating an instance of this device: - i2c: The I2C bus connected to the sensor.

In addition you can specify the following optional keyword arguments: - address: The I2C address of the device if it’s different from the default.


Read the altitude as calculated based on the sensor pressure and previously configured pressure at sea-level. This will return a value in meters. Set the sea-level pressure by updating the sealevel_pressure property first to get a more accurate altitude value.


Read the barometric pressure detected by the sensor in Pascals.


Read and write the pressure at sea-level used to calculate altitude. You must look this up from a local weather or meteorlogical report for the best accuracy. This is a value in Pascals.


Read the temperature as measured by the sensor in degrees Celsius.