/environmental_tracker

A conneceted IoT sensor for tracking environmental conditions, including temperature, humidity, and light levels.

Primary LanguagePythonMIT LicenseMIT

environmental_tracker

A conneceted IoT sensor for tracking environmental conditions, including temperature, humidity, and light levels.

Implemented with CircuitPython and Homebridge.

Configuration

The firmware makes use of CircuitPython's settings.toml file for all of deployment-specific information, including secrets like the WIFI SSID and password.

You'll need the following in your settings.toml for this to work:

CIRCUITPY_WIFI_SSID="Your network SSID"
CIRCUITPY_WIFI_PASSWORD="Your network password"
TIMEZONE="The timezone string for your city, e.g. America/New_York"
TIMEZONE_OFFSET="The offset for your timezone, e.g. -5 for EST/EDT"

HOMEBRIDGE_HOSTNAME="The hostname of your Homebridge instance"
HOMEBRIDGE_WEBHOOK_PORT="The port for webhooks configured in the plugin"

SENSOR_LOCATION="The name of the location you defined when you set up the sensors in the plugin"

You will need to set up three sensors in the Homebridge Webhooks plugin, one each for the temperature, humidity, and light level. The name of these sensors which gets used in the webhook URL will be the concatenation of the location name with a descriptive label. For example, if you make the location "backyard", the sensors need to be named:

  • backyard_temp
  • backyard_humidity
  • backyard_lux

Dependencies

The probe firmware depends on:

The display firmware depends on:

  • TBD

Homebridge is set up to use the Homebridge Webhooks plugin, which makes it trivially easy to set up the sensors on Apple's HomeKit. You can disable the Homebridge calls if you only want the probe to send its reading to the display.

Hardware

I implemented the probe using the following hardware:

I choose these components in part because I could easily assemble them using the STEMMA QT I2C interface. I also happened to have them on-hand. Other sensors with CircuitPython drivers could be swapped out pretty simply. For example, during the prototyping of the probe, I used a BH1750 light sensor before replacing it with the VEML7700.

Using different hardware

The probe and display are implemented in CircuitPython, so it should be fairly easy to swap out the hardware above. For example, you could use the no PSRAM version of the Feather ESP32-S3 for the probe without making any changes to the firmware code. Other CircuitPython-compatible boards that support WiFi are likely usable for the probe. The same should be true for the display, as long as the board has WiFi and either an integrate display or one added on that supports displayio. In this case, you might have to alter the display layout to fit the new screen.