Big poopies, little data; tracking diaper changes with IoT Button
When Miles was a newborn our pediatrician regularly asked us how many times he’s been gong potty per-day. It turns out when you’re sleep deprived and up at random times throughout the night its all a bit of a blur.
The Feed/Change/Sleep loop can be super taxing and it becomes hard to recall who did what when…. We decided to set up some metrics so we’d have concrete answers to all the potty related questions.
Tracking the movements
We could have used a trusty pen and paper to record the diaper changes, but what fun would that be?! Instead we grabbed an AWS IoT Button and set it up above Miles’ changing table.
The button has three click types
LONG. We mapped them to the following diaper change scenarios:
We’ll use the terms “Number One” and “Number Two” to describe the desired outcomes of the diaper change. Until you become a parent it’s hard to fathom what can go wrong during a diaper change… internally we refer to these as S.O.S. scenarios; here we’ve labeled them as “Unexpected Outcome” (will spare you the gory details).
The goal was to have a low cost, low maintenance way of collecting and storing all the diaper change events. The IoT Getting Started walks through the steps of setting up the button and creating rules for storage of data.
We landed on the following data pipeline:
The IoT Button emits the following JSON click data:
There were few additional attributes needed to make the data easier to work with (a uniq identifier and UTC timestamp). Luckily the IoT Rule Engine exposes a number of SQL functions that allow us to append additional meta-data before storing to S3.
It’s still early days in the data collection process, but it’s been a fun little project to hack on between nursing, naps, and diaper changes.
Will be interesting to see if any trends emerge over the following weeks.