rWCHC is a project aimed at implementing a versatile weather-compensated central heating controller. The goal is to provide smart, accurate and optimal temperature control based on outdoor temperature variations, building structure and occupant habits, in order to maximize comfort and reduce power usage (minimize both the impact on the environment and the energy bill). The system is designed to be scalable and remote operable (via internet connection).

This project is composed of two parts: a custom-designed hardware module to perform the actual power control on heating appliances, and a software module which is meant to run on a Raspberry Pi host to perform all computations and enhanced logic control. The rPi host also provides power to the hardware module which doesn’t need an external power supply.

This project stemmed from my need for a reliable and highly configurable controller after having had a bad experience with a brand-name device.


This project falls under a different licensing scheme than the rest of this website. Please read this section carefully.

  • The hardware part (incl. firmware) of this project is currently all rights reserved.
  • The software part (excl. firmware) of this project is currently all rights reserved.

I am still considering suitable licensing schemes at this time.


The information and methods described herein are provided “AS-IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. Use the concepts, examples and information at your own risk. There may be errors and inaccuracies, that could be damaging to your devices. Proceed with caution, and although it is highly unlikely that accidents will happen because of following advice or procedures described in this document, the author does not take any responsibility for any damage claimed to be caused by doing so.

Design goals

My design goals are simple. The system should be:

  • Safe
  • Reliable
  • Versatile
  • Affordable
  • KISS design

This is reflected in the list of hardware and software features.

The system is geared toward a “set and forget” approach, only requiring some attention at initial setup time.


The hardware design guidelines reflect several constraints:

  • Safety: the hardware must be safe to use and have safe failure modes
  • Reliability: the hardware must have a long service life (hence favoring solid-state throughout the design)
  • Power budget: the hardware must be entirely powered from the rPi’s power rails, which have a limited capacity
  • Efficiency: the hardware must consume as little energy as possible, in both the logic section and the power control section
  • Robustness: the hardware must cope with interferences (including high energy transients), in particular coming from the mains
  • Flexibility: the hardware must be adaptable to a variety of installation configurations
  • Form factor: the hardware must be small to reduce production costs and associated costs (casing), yet easy to install

For the current prototype, the choice of THT with a limited number of SMT devices has been made for greater ease of assembly. This prototype uses common components (which are easy and cheap to procure), with the exceptions of a specific high performance analog switch, a level-shifter IC for interfacing with the rPi’s GPIOs, and a PIC microcontroller.

Hardware features

The current prototype hardware features:

  • Up to 15 freely assignable RTD 2-wire sensor inputs
  • Up to 12 freely assignable Triac output channels, single phase with a maximum current budget of 5A total (fuse protected)
  • Up to 2 freely assignable Relay output channels, potential free (rated 5A/250VAC max each)
  • 1 2x16 alphanumeric LCD display with PWM backlight control, fully R/W addressable
  • 2 freely assignable tactile switches
  • 1 piezo buzzer for audible feedback (switch click and alarm)
  • 1 raspberrypi-compatible header connector for interfacing with any model of Raspberry Pi
  • Automatic failsafe fallback in case of disconnection from the host controlling software
  • Host powered (no external power supply)


Here’s a compact two-sided through-hole prototype layout that fits on 150 x 100 mm PCB.



A daemon, written in C and documented inline via doxygen, controls the hardware. Most of the computation is done in integer arithmetics to reduce the load on the Raspberry Pi (and facilitate implementation on a scaled-down MCU if that ever becomes desirable).

In fact, while developed to manage the rWCHC hardware module from a Rasberry Pi, the control daemon is designed to be both hardware and platform independent:

  • A hardware abstraction layer allows for easy implementation of new hardware modules as “plugins”
  • The software’s only mandatory dependency is the C library

Software features

Presently, the following features are implemented (non-exhaustive list):

  • Weather-compensated operation, with virtually unlimited number of building models:
    • Building temperature behavior modelling via inertia time constant
    • Per-model outdoor temperature source
    • Per-model evaluation of frost or summer conditions
  • Virtually unlimited number of heating circuits with any of the following features:
    • Water-based circuits with radiators are supported
    • Per-circuit, independent target ambient temperature
    • Per-circuit building model assignment
    • Direct heating circuits
    • Mixed heating circuits, with 3-way mixing valve:
      • Support for multiple types of valve control algorithms: bang-bang, successive approximations, PI controller
      • Support for temperature deadzone in all algorithms
      • Support for actuator deadband in all algorithms
    • Support for multiple types of heating curves (linear and bilinear approximations are implemented)
    • Support for ambient temperature modelisation in the absence of an ambient sensor
    • Support for accelerated cooldown and boost warmup transitions
    • Support for water temperature rate of rise control
    • Support for optional circuit ambient temperature sensor
    • Support for optional circuit water return temperature sensor
    • Support for automatic circuit turn-off based on outdoor temperature evolution
    • Support for timed cooldown at turn-off
    • Support for min/max limits on circuit water temperature
  • Virtually unlimited number of DHWT (Domestic Hot Water Tanks) with any of the following features:
    • Support for boiler-integrated tanks
    • Support for automatic switch-over to (optional) integrated electric-heating
    • Support for single and dual sensor operation (top/bottom) with adaptive hysteresis strategies
    • Support for timed feedpump cooldown at untrip with temperature discharge protection
    • Support for 5 charge priority models (no priority, parallel or absolute; with heat request selection)
    • Support for forced manual charge
    • Support for charge duration cap
    • Support for DHW circulator pump
    • Support for min/max limits on DHW temperature
    • Support for maximum intake temperature limit
    • Support for periodic anti-legionella high heat charge
  • Type-agnostic heat source support (currently only boiler type implemented) with any of the following features:
    • Support for consumer shift (e.g. to accelerate warmup after a cold start or to evacuate excess heat)
    • Support for consumer reduction delay signal (signal consumers to delay heat request reduction)
    • Boiler type heat source implements:
      • Automatic frost protection in all operation modes
      • Support for burner minimum continuous on/off time to reduce wear
      • Support for adaptative trip/untrip hysteresis with low and high temperature limits
      • Support for automatic boiler “sleeping” turn-off based on last heat request time
      • Support for several automatic turn-off strategies
      • Support for boiler minimum and maximum temperature (with signalling to consumers)
      • Support for return water minimum temperature (with or without return mixing valve)
      • Support for consummer delay after burner run (to prevent overheating)
  • Support for automatic summer switch-over based on outdoor temperature evolution, with summer maintenance of pumps and valves
  • Support for pump cool down timeout
  • Support for several global operation modes (full off, comfort, eco, frost-free, manual…)
  • Virtually unlimited number of hardware controllers:
    • Hardware-agnostic input/output interface (adding support for new hardware is a simple matter of adding a driver for it)
    • Driver for current prototype hardware supports:
      • Communication over SPI bus
      • Multiple RTD temperature sensors variants (currently Pt1000 and Ni1000)
      • Support for per-sensor fixed temperature offset
      • Support for periodic self-calibration
      • Time accounting of all triac/relay operations (i.e. “on/off since, total on/off time, number of power cycles”, etc)
      • Basic user-hardware interaction:
        • Global operation mode change via tactile switch
        • Display of individual sensor temperature
  • Support for multiple data logging and stats backends, currently:
    • simple CSV files
    • rrdtool databases
  • Support for logging sensor/relay data as well as internal (computed) states and values (e.g. targets, modelized temperatures, etc)
  • Support for basic (weekly) scheduling (setting runmode – comfort, eco, etc – and anti-legionella DHWT charge)
  • Support for ISC-style configuration file format
  • Foundation of a simple D-Bus interface for remote control via a proof of concept web application
  • Foundation of a simple permanent storage interface for state persistence

Provisions in the software have been made to support the following additional features:

  • Support for individual (per circuit/DHWT/heat source) operation mode
  • Circuits:
    • Support for transition timing optimisation (anticipated cooldown, boost warmup timing…)
    • Support for zone valves
  • DHWT:
    • Support for DHWT cascade, with priority
  • Heat sources:
    • Support for virtually unlimited number of heat sources, with cascading and/or switch-over
    • Support for other types of heat sources (e.g. heat pumps or heat exchangers for district heating…)
    • Support for boilers with 2-stage burners
  • Support for solar heating
  • Support for multiple instances (chaining/cascading)
  • Support for full remote control
  • Support for smart scheduling

Also considered:

  • Support for air-based circuits
  • Support for cooling systems
  • Support for presence indicators (e.g. sensors or IFTTT) to learn the occupants habits
  • Support for HomeKit integration

Daemon files

The daemon is currently unreleased.

Proof-of-concept web application

A basic web interface has been developed in Python (relying on framework), it allows for setting various parameters. When using the rrdtool logging backend, a small CGI script is available to display historical graphs of various datapoints.

Picture of a completed unit

This prototype unit has 4 (“snubberless”) Triac channels and 2 Relay channels implemented and is fitted in a custom-made clear acrylic case.