Home Sensor Project Pt. 1


It's not uncommon to have some semblance of the changing environment within our own homes. If we're not already wired up to a smart thermostat, or just obsessively checking it as we walk past, we can usually rely upon our senses to tell us "oof it's chilly in here" or "good lord all of my mucus membranes have solidified into painful crust where did we store the humidifier???"

Typically I might wonder these things if my comfort is affected or my energy bill comes in on the chunky side, but for the most part it is a reactive musing. Why was the heater running so hard? Why did my nose dry out in the middle of the night? I'm not saying there are plenty of intuitive answers to these questions, but nothing beats hard data gathering!


I recently completed a course on Software Stacks for Climate Technology offered through Terra.do. I love building software and want to steer my career in a direction that has a more direct impact on solving wicked problems in the Climate space. (That's pretty broad admittedly, but engaging in more education and expanding my network of like minded folk is another way to narrow my focus. )

In addition to a quality overviews of the space and hands-on energy modeling with open source data sets, there was a strong IoT component to the class, guiding participants through a set up involving a microcontroller, a sensor array, and some python code to start pushing data to a PostgreSQL database. This was sort of the "atoms" end of the "Bits VS Atoms" idea, more or less.

Tinkering with IoT has been a back-burner item for me for a long time, and this nudge helped me into the groove. The capstone of the class was a final project and, feeling energized by my cool new microcontroller toys, I started work on a project to combine the steady flow of sensor data with my own observations and see what kinds of correlations I can discover!

Project Overview

Without getting into serious detail (I'll break it up into separate posts) here's more or less the challenge set out for me with a one-week window between pitching the final project and demonstrating my MVP:

Gathering Sensor Data

This was more or less up and running from the boilerplate provided in the class materials, however I did need to work towards migrating my data and eventually pushing new updates to my own SupaBase DB instead of a shared classroom instance.

Gathering Activity Data

Sensor data gathers effortlessly via HTTP POST calls from the Wifi enabled microcontroller (that is as long as I kept it powered on and running without errors!). Activity data had to be manual though, and ideally the most bone-head simple UI I could conceive of.

In addition to a separate DB for activity records, I spun up a quick mobile-first UI with Vite.js that enables a single easy action: "Log Activity". I wanted to be able to catch any action on the fly, like "Starting to Cook Dinner" or "Opened the Door for the Cat" or like, a really farty evening (from the really beany dinner).

Logging timestamp and duration was a basic first pass at this entry, but I elaborated on my approach to that and will detail it more in the future.

Combined Data Visualization

The whole point of this application is to make correlations between indoor activities and indoor environment factors, so the final challenge to make the MVP complete was to find a way to display trend lines for sensor data (Temp, Humidity %, for starters) and highlighted areas showing activities and their durations ("Does making stew add humidity to the air?")

I could, and will, dive deeply into each of these aspects, because there have been a lot of interesting lessons and unique considerations so far that I have had to figure out on the fly. There's also a huge backlog of neat ideas I have on how to expand functionality and fun / ease of use.

Above all else it's a wonderful full stack problem solving extravaganza, and I'm excited to bore you with the details. Check back for updates and deep dives on how I keep this project moving towards greater refinement, and eventually even share some of the unexpected insights I've learned about my home's indoor environment!