Home Temperature Monitoring

mf_logo_rgb_tm

I’ve created this webpage as reference information for my presentation at the 2018 Maker Faire.

Here in Atlantic Canada we have a very long heating season, from sometime in October to at least the end of April. In the coldest months if the heating system shuts down for some reason then the water pipes in your residence can freeze and cause significant damage if the situation isn't dealt with as soon as possible. In fact most home insurance policies require someone to check your residence at least every 48 hours when you are away. Even though I do arrange that when away I decided a few years ago that I wanted to be more proactive and monitor the temperature in the house and send an alarm message if the temperature drops. A perfect do-it-yourself application of Internet of Things technology!

At the time I started on this project our house was heated with a air-to-air heat pump system (forced air) that was about 20 years old. The backup heating was provided by an electric furnace which fortunately was not required very often as it is very inefficient and costly to operate. The heat pump on the other hand is very effective in our climate and also provides cooling in the summer. Both systems however are inoperable during a power failure.

I knew that I was going to have to replace the whole heating system eventually but I wanted to get as much time out of it as possible. That made temperature monitoring even more critical!

This was right around the time that the ESP8266 wifi module was becoming popular and I decided to try Sparkfun’s ESP8266 Thing as the brains of the temperature monitor. I wasn’t too sure however how I was going to do the monitoring and how to send an alarm to my cell phone when the temperature dropped. I decided to figure that out later.

I searched around for the temperature sensor itself and decided to go with a thermistor type. The Seeedstudio Grove sensor looked like it would do the job as I didn’t need much accuracy.

Temp1a.jpeg

This worked well although a little difficult to calibrate. Later I switched to the ESPresso Lite V2.0 because it was less expensive and the DHT22 sensor because it comes already calibrated and provides humidity measurement as well.

Temp2b.jpeg

Both of these are in active use. The original one measures the temperature at the outlet of heat register to monitor operation of the furnace and the DHT22 based one monitors the ambient temperature inside the house on the middle level. Because the heating system is a forced air type these two sensors provide all the coverage that is necessary.

How I achieved the Monitoring and Alarm Functions

I wanted the temperature data to be in the cloud so I could look at it from anywhere, especially while travelling. I also wanted something that was free 🙂

At first I tried using Sparkfun’s public Phant server (now defunct) to host the data but I really wanted to be able to see a graph of the temperature versus time because in my experience that is the most effective way to observe a trend and see a problem. Then I discovered Adafruit’s io.adafruit.com. This is a MQTT based server that provides users with 10 free data streams (MQTT topics) and 5 free Dashboards which include various kinds of graphs and charts. The data is retained for 30 days and then discarded. This was exactly what I needed and my introduction to working with MQTT!

The Adafruit website contains lots of examples on how to connect Internet enabled devices including the ESP8266 to the server. With a very small amount of code which was pretty much copy and paste I had the basic system up and running. All I had to do was login to the website every day and check the temperature plot.

tempgraph


But I really wanted to something that would monitor the temperature and send a message to my cellphone if the temperature dropped below a certain limit. Ultimately I ended up using a small Python program on a Raspberry Pi to access the Adafruit MQTT server periodically, check the temperature and send an alarm to my cellphone if required. For the alarm function is used the Pushover service which is easy to access from the Pi and free for text based messages.

This is a very simple setup and has proven to be very valuable.

External Links

Note that I purchase a lot of my electronic components from the Robotshop who have a wide selection for hobbyists and provide great service. I have no association with them other than being a happy customer.

Grove temperature sensor: https://www.robotshop.com/ca/en/seeedstudio-grove-temperature-sensor.htmlhttps://www.robotshop.com/ca/en/seeedstudio-grove-temperature-sensor.html

ESP8266 Thing: https://www.robotshop.com/ca/en/esp8266-thing-breakout-board.html

DHT22 Temperature and Humidity Sensor: https://www.robotshop.com/ca/en/humidity-temperature-sensor-dht22.html

ESPresso Lite V2.0: 

Adafruit’s MQTT service: https://io.adafruit.com