SPA06-003 for MicroPython
MIT-licensed I²C driver for the Goertek SPA06-003 pressure and temperature sensor, as used in the M5Stack Unit DoF10↗ (opens in a new tab). No dependencies beyond stock MicroPython.
mpremote mip install github:mattytrentini/micropython-spa06-003
On a network-connected device, use mip.install("github:mattytrentini/micropython-spa06-003").
Pass an initialized machine.I2C or machine.SoftI2C bus. The default address
is 0x76 (Unit DoF10); use address=0x77 if the sensor is wired for it.
Power the unit before creating the driver.
from spa06_003 import SPA06_003
sensor = SPA06_003(i2c)
temperature_c, pressure_hpa = sensor.read()
print("{:.2f} °C, {:.2f} hPa".format(temperature_c, pressure_hpa))
read() waits for a new temperature conversion and then an 8× oversampled
pressure conversion. It applies the sensor's factory calibration, including
SPA06-003's c31 and c40 pressure terms. This is not a driver for SPL06-001
or DPS310. Initialization and conversion waits are bounded.