I just got home from 5-day vacation in Siesta Key where my family and I frolicked in the the slightly warmer climate than what we are used to in Ann Arbor Michigan. The entire eastern half of the nation was under a polar vortex so our balmy Floridian host was much cooler than expected. Back home, however, the temperature dropped as low as -28 degrees Fahrenheit (-33 degrees Celsius).
This wouldn’t normally cause me any anxiety if it were not for my 22 year old furnace. I couldn’t help but worry that it would fail, causing my pipes to freeze followed by all sorts of damage. I knew I wouldn’t be comfortable leaving my home without feeling confident that my furnace was keeping up.
Spark Core + Thermistor
I dove into my basement to scrounge for parts and I built myself an “Internet of Things” thing to monitor the temperature inside my home. It was really easy and it only took me 30 minutes. I had an unused Spark Core and a Tinkerkit Thermistor lying around, so I used them. Any thermistor would have worked, but that is the one I found in my lab.
I hooked up ground, power, and signal (to Analog 7) and got coding. I found some conversion code for this Tinkerkit module on the Johnny-Five project, and I ported it over to C. The Spark.io builder made it easy for me to send the following code to my Spark Core:
|
|
That was it. From there, the “temperature” variable was exposed to the web. The value was available from a simple URL: https://api.spark.io/v1/devices/MY_DEVICE_ID/temperature?access_token=MY_ACCESS_TOKEN
|
|
Cool (or warm?)! But I don’t really feel like reading JSON on my vacation.
CodePen to Host a Simple UI
I didn’t want to go through the hassle of creating a tiny site and publishing it just to read this value. This is why I like CodePen and their ilk. I can write up a quick little code snippet (note that I’m using ES6), and I’m good to go.
|
|
|
|
Now I can go to the “full-page” view of the site from my phone. The UI was only hacked together so it is crude (remember, this entire project only took 30 minutes to hack together), but it works!
But I really don’t want to be checking my phone every 5 minutes.
Setting Up Phone Alerts
I really like IFTTT. It stands for “If This Then That”. I published a recipe that says: “If [the temperature goes below 55 degrees] then [send an alert to my phone]”.
I had to put the device in my freezer, but I received an alert on my phone that the temperature dropped below 55 degrees!
Did My Furnace Fail?
No, it did not. BUT, I was never worried about it on vacation because I always knew that it was holding up. In fact, on the last day of our vacation, the temperature jumped from 65 degrees to 70 degrees. At first I was confused, but then I learned that our house cleaners had come that morning and they bumped the temperature up in anticipation of our arrival home!
This is why I love living in the future. We have some amazing abstractions here. I can focus on the details that matter to me and I let the infrastructure do the rest for me. This is the kind of thing we’ll be seeing more and more of going forward as the “Internet of Things” becomes more ubiquitous.