WTherm, a DIY smart thermostat that aims to provide ease of use and save energy at the same time. This is the story behind my high school thesis research. Read the final report here, or continue to learn more.

This article has been copied over from my old blog, niekproductions.com. Please excuse any mistakes.

About a year ago, my father asked me if I would be able to develop a room thermostat that could be controlled remotely through a web interface. That way, he could make sure that the central heating was on and the house was at a nice temperature when he got home from work. After a couple of weeks, I had a semi-working product based on an arduino. The arduino used a RF receiver to wirelessly receive the room temperature from a sensor and it used a relay to open and close our central heating valve. An ENC28J60 ethernet module was used to respond to simple HTTP requests from a web interface.

WTherm pre-alpha

Pre-alpha WTherm (relay not pictured)

Now this solution worked, but wasn’t very reliable. It had frequent issues receiving the temperature and the arduino suffered from brown-outs often. The arduino also lacked sufficient memory to serve a decent-looking webpage.

For these reasons, I swapped out the arduino for a Raspberry Pi. Though it was slow at times, at least it was able to host a decent webpage. The source code can be found on GitHub.

WTherm alpha

WTherm alpha

Finally, I had a reliable solution (except the SD card curruption, but I’ll get into that later). The WTherm remained like this for a while.

Now, here’s where it gets interesting. A mandatory exercise during the last year of high school in the Netherlands is completing a thesis research. For my research, I decided to expand the WTherm and develop a smart thermostat.

First, let’s start with my definition of ‘smart’. This is how I defined my objective in the report:

The objective of this project is to design and develop a smart thermostat that saves heat by predicting or calculating the time it takes a room to heat up to a certain temperature. The thermostat must use this calculation to precisely follow a weekly schedule that can be programmed through a web interface.
 

Basically, I wanted to create a thermostat that would have a web interface where you can program a schedule. If you program the schedule to 20°C at 8:00 in the morning, the thermostat will calculate how long it will take to reach that temperature and start just in time to reach 20°C at eight in the morning. Additionally, this saves energy compared to a conventional room thermostat. I’ll explain how this works later.

I divided my research into three separate parts:

  • Predicting the heating time
  • Constructing the thermostat
  • Calculating the energy savings

1. Predicting the heating time

The fundamental function of the thermostat is to calculate the amount of time it will take the room to reach a certain temperature. In order to do this, I looked at the heat flow in this system and came up with a general formula that describes the temperature change over time:

Differential equation

Differential equation

In this equation, P is the power of the central heating system, Ct the heat transfer coëfficient (the amount of heat that is transferred through the walls) and C is the room’s thermal capacity. This formula can applied to any house, as long as you’re able to determine these variables. For my method, please refer to the report.

2. Constructing the thermostat

This part deals with the physical construction of the thermostat.

First of all, I moved away from the Raspberry Pi to a Banana Pi. The thermostat logs the temperature every five minutes, which corrupted the Raspberry’s SD card. With a Banana Pi, I’m able to write to an external SATA drive instead. Furthermore, the Banana Pi is a bit faster.

The full code and installation instructions are available in my GitHub repository.

3. Calculating the energy savings

In the last part of my research, I compared the finished WTherm to a conventional room thermostat. Imagine a situation in which a household would like the temperature to be 20◦C at 9:00 every morning. They set a traditional clock thermostat to start heating 1 hour before 9 o’clock. If we look at the formula from part 1, we’ll be able to notice that the outside temperate has a significant impact on the heating time. Since the temperature can bounce around quite a bit, it might take less than an hour to heat up the room. Now my thermostat would take this into account and adjust the heating schedule to switch on the central heating a bit later, while the conventional room thermostat would have started heating the room earlier. This is how the WTherm is able to save on energy.

For a non-functional demo of the web interface, visit niekproductions.com/wtherm. (edit: retired)

This concludes a very condensed summary of my research, please consider reading the full report. Feedback would be much appreciated.