ENVPRO Unit

ENV Pro Unit is an environmental sensor that utilizes the BME688 sensor solution, supporting the measurement of various environmental parameters such as volatile organic compounds (VOCs), indoor air quality (IAQ), temperature, humidity, and atmospheric pressure. It features a compact size, wide operating range, simple communication interface (I2C), excellent performance, and low power consumption, making it suitable for weather stations, indoor environmental monitoring, and air quality detection applications.

Support the following products:

ENVPROUnit

Micropython Example:

 1# SPDX-FileCopyrightText: 2024 M5Stack Technology CO LTD
 2#
 3# SPDX-License-Identifier: MIT
 4
 5import os, sys, io
 6import M5
 7from M5 import *
 8from hardware import *
 9from unit import ENVPROUnit
10import time
11
12
13title0 = None
14label0 = None
15label1 = None
16label2 = None
17i2c0 = None
18envpro_0 = None
19co2_0 = None
20
21
22def setup():
23    global title0, label0, label1, label2, i2c0, envpro_0, co2_0
24
25    M5.begin()
26    Widgets.fillScreen(0x222222)
27    title0 = Widgets.Title(
28        "ENVProUnit CoreS3 Example", 3, 0xFFFFFF, 0x0000FF, Widgets.FONTS.DejaVu18
29    )
30    label0 = Widgets.Label("label0", 0, 58, 1.0, 0xFFFFFF, 0x222222, Widgets.FONTS.DejaVu18)
31    label1 = Widgets.Label("label1", 0, 109, 1.0, 0xFFFFFF, 0x222222, Widgets.FONTS.DejaVu18)
32    label2 = Widgets.Label("label2", 0, 160, 1.0, 0xFFFFFF, 0x222222, Widgets.FONTS.DejaVu18)
33
34    i2c0 = I2C(0, scl=Pin(1), sda=Pin(2), freq=100000)
35    envpro_0 = ENVPROUnit(i2c0)
36
37
38def loop():
39    global title0, label0, label1, label2, i2c0, envpro_0, co2_0
40    M5.update()
41    label0.setText(str((str("Pressure:") + str((envpro_0.get_pressure())))))
42    label1.setText(str((str("Humidity:") + str((envpro_0.get_humidity())))))
43    label2.setText(str((str("Temperature:") + str((envpro_0.get_temperature())))))
44    time.sleep(1)
45
46
47if __name__ == "__main__":
48    try:
49        setup()
50        while True:
51            loop()
52    except (Exception, KeyboardInterrupt) as e:
53        try:
54            from utility import print_error_msg
55
56            print_error_msg(e)
57        except ImportError:
58            print("please update to latest firmware")

UIFLOW2 Example:

example.png

envpro_cores3_example.m5f2

class ENVPROUnit

Constructors

class ENVPROUnit(i2c, address)

Initialize the ENVPROUnit with an I2C object and an optional address.

Parameters:
  • i2c – The I2C interface or PAHUBUnit instance to communicate with the ENV PRO sensor.

  • address (int) – The I2C address of the ENV PRO sensor. Defaults to 0x77.

UIFLOW2:

init.png

Methods

ENVPROUnit.get_over_sampling_rate(env)

Retrieve the oversampling rate for the specified environment parameter.

Parameters:

env – The environment parameter (TEMPERATURE, PRESSURE, HUMIDITY).

UIFLOW2:

get_over_sampling_rate.png

ENVPROUnit.set_over_sampling_rate(env, rate)

Set the oversampling rate for the specified environment parameter.

Parameters:
  • env – The environment parameter (TEMPERATURE, PRESSURE, HUMIDITY).

  • rate – The oversampling rate to be set.

UIFLOW2:

set_over_sampling_rate.png

ENVPROUnit.get_iir_filter_coefficient()

Retrieve the IIR filter coefficient.

UIFLOW2:

get_iir_filter_coefficient.png

ENVPROUnit.set_iir_filter_coefficient(value)

Set the IIR filter coefficient.

Parameters:

value – The IIR filter coefficient to be set.

UIFLOW2:

set_iir_filter_coefficient.png

ENVPROUnit.get_temperature()

Retrieve the measured temperature.

UIFLOW2:

get_temperature.png

ENVPROUnit.get_humidity()

Retrieve the measured humidity.

UIFLOW2:

get_humidity.png

ENVPROUnit.get_pressure()

Retrieve the measured pressure.

UIFLOW2:

get_pressure.png

ENVPROUnit.get_gas_resistance()

Retrieve the measured gas resistance.

UIFLOW2:

get_gas_resistance.png

ENVPROUnit.get_altitude()

Retrieve the calculated altitude based on pressure readings.

Note: Altitude is calculated based on the difference between barometric pressure and sea level pressure

UIFLOW2:

get_altitude.png

Constants

ENVPROUnit.TEMPERATURE
ENVPROUnit.PRESSURE
ENVPROUnit.HUMIDITY