Nicholas Skinner

Freelance website and web application developer

Building A Web Accessible Heating / Hot Water Programmer (Home Automation)

Heating CabinetI recently got round to completing a central heating / hot water automation project I had been meaning to do for a few years but previously issues over cabling, heat (i.e. possible damage to electronics), hardware choice, and various other installation issues had caused me not to do it until now.


  • Two channel (heating and hot water) support.
  • Temporary Override (ignore schedule for 30 min – 1 day), both overriding on, but also off.
  • Permanent Override (ignore schedule).
  • Web based interface for changing schedule / override settings.
  • Schedule support for any combination of weekdays.
  • Schedule support for one off custom schedules on specific dates only.
  • Setting date/time via NTP (with automatic support for time zones, and daylight savings – built into Linux server).
  • Support for override control via Cisco 7960 phones (already located around house / managed by Asterisk).
  • Wireless from control unit to programmer (linked to network).
  • Self contained system – does not require separate PC server running 24/7.


Honeywell In Parallel WiringIn terms of hardware the system is comprised of:

  1. A relay box containing two opto-isolated 230V 3A relays with CMOS level control.
  2. A control box with Synapse RF Engine installed in Synapse Evaluation board connected to several lights/switches allowing for local control over on/off, override settings, and visual indication of on/off status (evaluation board is connected directly to relay box).
  3. An ACME System Fox G20 Board (Atmel ARM processor, running Debian Linux), linked to another Synapse RF Engine, the controller behind the whole system, connected to wired network.

I chose to install the relay box it in parallel with the existing timer clock. During normal use the existing timer will be turned to its ‘permanent override: off’ setting, this means that if the custom system were to fail it’s a simple case of powering it down, and going back to using the regular programmer.

Relay Box

Relay BoxIn terms of mounting the relay PCB in the box I chose to use to use some nuts and bolts, hot gluing the bolt to the base. I also put some small rubber feet on the board to keep it more secure. This allows the relay board to still be removed from the box if required at a later stage.

I secured cables going into the boxes with cable ties (one on the outside and one on the inside), not the most professional solution but having used various cable grips before none of which seemed particularly secure (prone to popping out again), and being time consuming to fit therefore this time I opted for a simpler solution.

Control Box

Controller PCB ViewThe control box had limited space this meant things fit nicely without moving but I also used some stick on cable holders to hold the PCB steady, and placed a blank PCB in the box to separate the switches from the Synapse Evaluation board preventing the possibility of shorts.

I used a standard labeller with stick on labels for marking controls on the box, this did not lead to as professional a finish as I would have liked however I could not immediately think of a better options without paying out for a possibly costly custom enclosure.

In terms of wiring in the control box, it is fairly straight forward, a TS7809 [pinouts] to regulate the 12V PSU to 9V, switches connected directly from ground to GPIO pins (for pinouts see Python file), LEDs each connected to GPIOs via transistors [wiring diagram].


Fox G20

Web Interface ScreenshotThe Fox G20 runs a PHP schedule application which sends signals to the control box LEDs / relays, and also receives button press events for override support. It does this via a serial / wireless link (using Synapse modules) to the control box.

The Fox G20 was chosen since it offers (in software terms) something very similar to a regular Linux PC – support for web server, PHP, Cron jobs, RTC (with backup battery), serial ports, Ethernet, hard drive (memory card) all in a small form factor (web server, PHP, cron support were even already installed on the purchased memory card), meaning that time consuming / fiddly cross compiling etc was not required as they might with other hardware.

Getting the Fox G20 out of the box I was immediately very impressed with it and was able to get up and running within minutes, only thing that was not immediately clear was the root password (netusg20) but this was quickly located after a search of the wiki.

[Download: PHP Schedule Application inc. Cron service]

Fox G20 – Synapse RF Engine

Fox G20 ElectronicsThe Python script on the Synapse RF Engine simple connects the serial port to the transparent wireless connection.

[Download: Python Software]

Control Box – Synapse RF Engine

The Python script on the Synapse RF Engine mounted in the control box is responsible for sending out message over wireless serial when buttons are pressed, and processing messages turning them into GPIO on/off events to control the relays/LEDs.

[Download: Python Software]

Custom Build

A few of the decisions to build my own system include:

  • Cost of commercial solution.
  • Easily extendable as required (ability to just code new features in PHP).
  • Support for control via Cisco 7960 phones (at any location in the house) – phones that support XML browser via “services” menu.
  • Implementation of all existing features of current system easing user adoption (for other members of the household).
  • Ability to make system wireless, but also separate from existing servers (independent system).
  • Network support for NTP / timezones / daylight savings time.
  • Key components that may be damaged by heat (unavoidable due to location) easily replaceable (e.g. just slot in new Synapse Module, purchase new power adapter).
  • Easy to make remotely accessible (just code authentication support).

Implementation Notes

  • PHP was not particularly designed to be used as a long running process (which is how it is necessarily used on the Fox G20 to receive data from the serial port. For that reason I wrote a separate script called by Cron to check it is running, or if not start it back up again. This causes a slight usability issue with the physical control box in that it may be unresponsive for up to 60 seconds (if the PHP process stops, and is pending a restart) however in practice this seems to happen only once every 5 hours, and the control box is rarely used anyway so it would be unlucky for a user to try and use it during that time. It does not cause any issues with the schedule since any on/off events that happened when it was not running will be processed when it starts back up again.
  • I could have simplified things by having the Fox G20 board with WiFi module directly in the control box (removing the need for the Synapse modules) however did not do this due to possible issues with heat (cost of replacement), ease of access, and ease of hardware / software implementation (there does not seem to be a particularly simple/optimal way of supporting momentary push buttons in an event driven way, with the Fox G20 whereas there is with the Synapse).
  • Fox G20 PackagingI chose to implement support for permanent overrides on the control box via momentary/non locking toggle switches. These are not ideal as they do not offer the user any feedback on the current state directly, however it seemed like the best option due to already using up most of the GPIOs on the Synapse Engine, and increased built time, especially when they are a rarely used feature. I chose to use non locking switches such that the permanent override setting could be changed via the web interface, but another option may have been to use locking toggle switches and remove permanent override control from the web interface.
  • The Fox G20 PSU is supplied with a Euro plug, even if ordered in the UK, I therefore purchased a Euro to UK plug adapter, but another option would have been ordering a new 5V 1A PSU.
  • Currently the system is still relying on the existing hard wired thermostat. Synapse recently brought out a new motion/light/temperature sensor which I may add in support for in the future. The motion sensor could potentially be used to automatically turn off the system (disregarding the schedule) if no one is in the house resulting in cost savings. To switch over I would simply set the existing thermostat to a high temperature such that it is always on, allowing the Synapse sensor to have priority.
  • I only tested the blue LEDs initially which was a mistake since after implementation I found that the green LEDs were barely visible (I did not realise the greens require greater current), this meant the addition of some extra lower value resistors on the PCB that I had not originally planned for. Even so the green LEDs still ended up being significantly less bright than the blues however measuring current with a meter any lower resistor values (leading to a higher current) may have been out of spec possibly damaging / reducing the life of the LED. The reduced brightness is not ideal from a user point of view however is acceptable as the box is mounted inside a darkened cabinet.

Parts List

x2 Momentary Toggle Switch FH03D
x1 2.1DC Socket JK09K
x1 ABS Box (Control) LH22Y
x2 Green LED Momentary Push Switch N08AR
x2 Blue LED Momentary Push Switch N09AR
x1 12V DC PSU N12GN
x1 9V Regulator (TS7809CZ) N37CA
x1 ABS Box (Relays) N59FK
x3 2 Core 3A Mains Cable XR47B
x2 4 Core Alarm White XR89W
x4 2N2222A Transistor Maplin
x1 FOX Board G20 Starter Kit COMBO-2
x2 Synapse RF150 Module RF150PC6
x1 Synapse Evaluation Board SN171GG-NR
x1 Euro to UK plug adapter Pulsat

FOX G20 / Synapse – Pinouts

Synapse Pin G20 Pin
5 (UART 0 RX) J6.5 (USART 1 TX)
6 (UART 0 TX) J6.4 (USART 1 RX)
21 (VCC) J6.1 (3.3V)
24 (GND) J6.40 (GND)

Further Information: FOX G20 – serial ports, FOX G20 – pinout

The FOX G20 has a 3.3V output that can be used to directly power the Synapse Module.

Further Resources

Update 2011-07-06: The Synapse “motion/light/temperature sensor” is part of the “closed” system, it can not be independently controlled via Python.

9 Responses to “Building A Web Accessible Heating / Hot Water Programmer (Home Automation)”

  1. DIY Central Heating and Hot Water Control System - Hacked Gadgets - DIY Tech Blog Says:

    […] Skinner shares how he developed his DIY Central Heating and Hot Water Control System with […]

  2. ElectroNick Says:

    Congrats on the successful implementation!

    I’m sorry if I missed it in the description of the project, but what type of water heater is it, electric or gas?

    It probably would not be applicable to gas heaters that rely heavily (and for a good reason) on mechanical components for control, but electric heaters these days come with pretty sophisticated controls that have several types of energy saving settings, including tracking hot water usage during different times of the day. Additionally, probably even more important for DIY projects, they usually have all the high-current, high-voltage circuitry needed for heater hookups. So, I’m wondering if you’ve considered adding Web controls as a retrofit to an existing (and pretty recent) water heater controller either to speed up the project or as an extra safety assurance (’cause these controllers are certified)?

  3. admin Says:


    Thank you for the comment.

    It is what I understand to be a called a “traditional” UK gas central heating / hot water system. The boiler heats a tank of water, as opposed to the new type of gas boilers “combination boilers” whereby the water is heated on demand (such that there is no need for a timing system, at least on the hot water side). Not sure if it is strictly a “Honeywell Y Plan” system, but if not its very close

    >electric heaters these days come with pretty sophisticated controls that have several types of energy saving settings, including tracking hot water usage during different times of the day.

    Can not say this is something I have come across, but on our system there are no really energy saving features, unless you count the thermostats (in my experience this is fairly common, however may be different for new build properties).

    In terms of high voltage the most I was dealing with was 230V 3A, mostly used for switching valves / powering a pump (this figure was from the fuse on the plug of the existing system), therefore per relay at most it would be 1.5A), my relays are therefore 1.5A overrated.

    In terms of the safety side of things in general, the relays used were purchased in the UK and CE certified, they are also housed in a separate box to the low power controller, and opto-isolated. I would have likely wired in the connection from the relays to the existing system myself, however (since we had a plumber changing our tank which had a leak) in the end he did it (without raising any objections). My assumption is that he was a fully certified plumber and would not have done it if it was against code.

    For anyone else considering the project, worth noting that in terms of the law in the UK it is my understanding that under the (fairly new) regulations that outlaw some DIY electrical work, there is a specific exception under “Part P” for fitting heating programmers (which I believe my system would be classified as). However I would advise anyone considering it double checks this.

    >retrofit to an existing (and pretty recent) water heater controller

    As mentioned (admittedly briefly) in the post, my “programmer” / “system” was installed in parallel to the existing Honeywell Programmer (which basically turns on/off 230V down two wires, one heating, one hot water on the specified user entered schedule) the complexities of wiring in thermostats, pumps, boiler etc was already done. Had it not been then this may not have been a project I would have completed since wrongly wiring a thermostat, particularly on a hot water tank could certainly have some safety implications.

  4. Blog » Blog Archive » Building A Web Accessible Heating / Hot Water Programmer Says:

    […] A Web Accessible Heating / Hot Water Programmer – [Link] Tags: Heating, Web Filed in Control | 1 views No Comments […]

  5. DIY Web Interface Control System for Central Heating and Hot Water! Says:

    […] interface.  But for those of you who don’t want to wait for that, you can make your own like Nicholas did, a DIY web interface control system for your central heating and hot water made possible by a linux […]

  6. andy mackay Says:

    this is such an obvious idea (and i am not saying that to take anything away most brilliant ideas are obvious), that i a really surprised that the big boys don’t have something like this. i can’t belive that all central heating systems are still programed and controlled via therostats and fiddly wee consoles on the front of the units. it makes much more sense to have a web server built in so you could access it from a browser, a-la a router or printer, if they had had this in phinius fogg’s day he could have turned his gas off from tibuktu and he wouldn’t have such a large bill on his return.

  7. admin Says:

    @andy mackay

    I certainly looked around for existing off the shelf systems as well that fit my requirements however could not really find any with comparable features in a reasonable cost range, the main reason for building my own.

  8. gc Says:

    This is a really great project and one I’m thinking of attempting. The one question I have is around the connection to the exsiting timer. Could you supply more details on how this was achieved … any photos of the connections?

  9. admin Says:


    Unfortunately I did not take any at the time, so best I can do is the circuit diagram above. It is not however particularly complicated. In terms of my Honeywell timer it has two parts, the backplate and the main unit that clips into the backplate.

    From memory the backplate has screw terminals labelled “N, L, 1, 2, 3, 4″ which match the circuit diagram so its mainly just a case adding in the wires to the relay in parallel to “L”, and “3”, then “L” and “4” (however as mentioned this is not something I did myself so you may want to double check).

Leave a Reply