It’s been some time since I actually wrote a blog post. Mostly because I have had nothing original to write, and partially because school keeps me busy. Let’s change that!
I figured I would do a proper writeup on one of my summer projects – the Rubustat.
While I enjoy programming and enjoyed making this project immensely, I make no claims that I am good at programming. High level Pythoners may wish to look away. However, the only way to get better is practice, right?
While at home for the summer, the existing thermostat in the house was acting up. It wouldn’t keep programmed settings, the display was a cheap LCD that was losing contrast, and it was generally an annoyance. Having ordered a couple Pis earlier in the summer (because why not, it’s a $40 computer!), I quickly began researching the potential of a Raspberry Pi thermostat.
Of course, someone already did it.
As is typically the case on the internet, someone had already implemented my idea, and was selling products. Nich Fugal had done exactly what I planned – hooked up an RPi to his thermostat. Handily enough, he offers the schematics and parts list he used! He also makes and sells pre-made boards for easy solder-and-go purposes!
However, I found his software implementation lacking, but admittedly functional.
The controller board (left) and thermometer (right) crammed into the GPIO ribbon cable I soldered the connector on the PCB backwards. Oops!
While Nich did most of the hard work hardware wise, I knew I could improve the software. While I am by no means a web developer, I am halfway handy with Python, and Flask fulfilled my purposes well enough. Let’s go through my amateur-at-best design process!
Being a huge fan of lazy portmanteaus, I knew it had to be something raspberry related. The genus of the common raspberry is Rubus, so the name “Rubustat” practically made itself.
The daemon was originally based on a straight copy of Nich’s software. However, I found it to be a tad unstable, and used more external bash calls than I liked. While his use of outdoor temperature to determine heating vs cooling is clever, the primary user of the end product (my dad) preferred more manual control.
After some extended debugging, I found that it was difficult to cleanly kill off my daemon (which at this point was a endless while loop). I instead opted to use a daemon class written by Sander Marechal which worked better. To fully stabilize/debug the daemon, I had to add stale PID checks.
For more detail: Rubustat – the Raspberry Pi Thermostat