2023-05-12-1957


Sensor Log Testing for Data.MFE API

Working on a live sensor to use for testing the data.madefor.earth site.

The test configuration will use the ESP32-S3 and the #sensor/SCD41 to publish AirQuality(AQI) data from my room.

# SPDX-FileCopyrightText: 2020 by Bryan Siepert, written for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense
import time
import board
import adafruit_scd4x

i2c = board.STEMMA_I2C()  # For using the built-in STEMMA QT connector on a microcontroller
scd4x = adafruit_scd4x.SCD4X(i2c)
#print("Serial number:", [hex(i) for i in scd4x.serial_number])

scd4x.start_periodic_measurement()
#print("Waiting for first measurement....")

while True:
    if scd4x.data_ready:
        print("CO2: %d ppm" % scd4x.CO2)
        print("Temperature: %0.1f *C" % scd4x.temperature)
        print("Humidity: %0.1f %%" % scd4x.relative_humidity)
        print()
    time.sleep(0.5)

References: