Raspberry Pi powered heating controller (Part 4)

Heating PCB

It’s really happening!  The breadboard prototype has been running the heating and hot water for a week or so now, and so far nothing has caught on fire.  The relays are happy, they’re not getting warm or anything, the Pi is turning things on and off when it’s supposed to, the REST API is working, and I’ve knocked up a quick Web interface to switch things remotely.  Last night for the first time I switched the heating on from the sofa, because I was a little bit cold.

Great success!


I’ve turned the breadboard layout in to a PCB design and today at 09:11 UTC it was sent off for manufacture, I should have it back in a week.  All the other components are on their way and so next weekend I should be able to put everything together and solder it to the board.  With a bit of luck it will work first time.

I’m quite please with the board layout, it’s a fairly useful breakout board for the Raspberry Pi.  In the future I would like to re-work it with smaller traces so that it can fit directly on top of the Pi.

The software to drive everything is rather basic, but I will make it available via Github anyway, it might come in handy.  I will be working on this over the coming months, so it should improve soon.  You’ll need a MySQL server set up.  The schema for the database is included in the repo.  The whole thing has grown organically and so the naming and structure is poor, but it works.

Code:  https://github.com/8none1/heating

I’ve starting making some 1wire temperature sensors which I will place in various rooms and hook up back to the Pi via cat5.


I won’t be able to control individual radiators at the moment, but I can set a target temperature for a given room and rely on the TRVs to control the temperature in other rooms.

I’ll also be adding outside temperature sensors and looking to replace the main room stat with another Pi in the future.

In summary then, I should have the final thing built in the next couple of weeks.  More to follow when that happens.  I’m considering looking at moving the whole thing to a micro controller rather than a Pi, that would reduce the BOM quite considerably, and might even warrant a commercial product in the long run – a hackable heating controller.  Is this something people might be interested in?

Further Updates



    James Tulloch

    Hi Will,

    How did you attach the temperature sensors to the sources? Just taped to the outside of the tank? What about outside?



      Will Cooke

      The outside temperature ones are easy. I went up in to the loft and poked a waterproof sensor out of the bottom of the roof, where the guttering would be. For the tank sensors; my tank has a solid foam jacket, so I used a pencil to “drill” a whole through it until I got to the tank itself, then I used a bit of thermal compound that you use to attach heatsinks to CPUs, squirted in in to the bottom of the hole and pushed a temp. sensor in to it. It’s a hack, but it works fine!


    Have you considered going to the next step and turning the Pi controller into a ‘smart device’ by controlling the GPIO by voice from Amazon Alexa?

      Will Cooke

      Hi Les,

      Yes! I have integrated it with Alexa – and it was pretty easy actually. I needed a proxy on my home network that was exposed to the Internet so that Alexa can make REST calls to the heating controller.

      I’m at the point now where I don’t even have the heating on a timer anymore – I just command Alexa to switch it on and off as I need it. The hot water is still on a timer though.

      I’ve also hooked it up to Apple Homekit so that I can switch the heating on when I’m away from home. This is useful when we’re out for the day and can come home to a nice warm house.

      I’ve posted a bit about Alexa integrations on here.

Leave a Reply

Your email address will not be published. Required fields are marked *