Close
0%
0%

OpenTherm interface

Hardware to interface with an OpenTherm enabled boiler

Similar projects worth following

Condensation gas boilers are considerably more efficient when they run at a lower exhaust temperature. This makes ON/OFF thermostats a bad choice, because they tend to run for shorter periods of time at maximum power output.

My boiler supports power modulation through the OpenTherm protocol and since I have already converted my old ON/OFF thermostat to what's basically a pretty interface, it seems that using power modulation to save gas is the next logical step. 

An OpenTherm interface needs to be made, and a PID controller would need to be implemented in software to find a good balance between comfort (fast temperature reach + no abrupt swings) and economy (lowest possible gas combustion exhaust temperature).

Why yet another OpenTherm interface?

Great open projects like the great OTGW in which this is largely based, are meant as gateways/mitm, intercepting messages between a real thermostat and a boiler.

OTGW has a "standalone" mode which is probably useful for what I am trying to do, but the PIC code is written in assembly. It's been 20 years since I wrote a single line of that, and that alone is a good reason no to get into it. I think OTGW is great but not if you want to change anything on how it operates.

This will be an OpenTherm/+ master-only device that will continuously cycle through a fixed sequence of messages, to achieve a clear seat of features/goals:

  • Query and report relevant status and sensor data (pressures, output, temperatures).
  • Receive from the serial, and continuously apply to the boiler:
    • whether to enable the central heating or not.
    • the central heating set-point.
    • the maximum relative modulation the boiler should use.
  • A simple fail-safe mechanism that turns the boiler off when there is no serial commands in a long while.

That's it. It will sit there looping and doing that, forever.

The complexity of controlling the set point values in a sensible way (PID, door/window opens,outside temperature compensation, etc.) will be done on a more suitable platform and not in the MCU.

  • WInter is comming

    Ivan Stepaniuk11/24/2020 at 11:08 4 comments

    So, cold temperatures are already here. I had not really touched the Node-RED PID controller after I lowered the derivative factor. It seems to be working properly. There is some overshot when adjusting the setpoint that could be corrected for, but the boiler clearly has it's own PID.


    This is the current grafana output, including the gas consumption, but that is not very useful in this case because it also counts the shower (on for around 10 minutes at 9:45). The gas consumption is a rolling average and has some delay.

    Note that both graphs have two Y axis. "ouside" and the gas m³/h are on the right side. The green spiky plot on the bottom is the heating circuit water temperature. It's LOW, which is the whole point; running it low to maximize the condensation boiler efficiency.

  • Tuning the PID controller

    Ivan Stepaniuk04/16/2020 at 22:20 0 comments

    Looking at the OpenTherm 2.2 spec, the only one I can find online, there is two ways to get a gas boiler to modulate it' s power output.

    The first one, and the one I thought I was going to use, consists of setting the target water temperature to the maximum, and then using OpenTherm message id 14, "maximum relative modulation level setting" to limit the boiler's burn.

    Unfortunately, my boiler responds with "invalid message id" for that one, so it's apparently not supported in the firmware. This leaves me with the second option which should be also fine; dynamically controlling the water temperature set point.

    Some more experimentation will be needed, I am using Node-RED for the PID and the graphs. I am not sure if I am going to trust it with the PID loop permanently, but this is an excellent way to get insights and tune the PID loop.

    Some experiments
    Some experiments

    The boiler uses it's own PID to throttle back when it's about to reach the target water temperature. |n on-off mode, that target does not change (it's the temperature dialed in on the boiler's front panel).

    My goal is to reduce the target temperature so the boiler works at lower water return temperature, which boosts the condensation improving efficiency.

  • Basic firmware working, talking to the boiler

    Ivan Stepaniuk04/16/2020 at 00:23 0 comments

    I have found several useful projects implementing OpenTherm communications the inter-pipes:

    I am basing my code on the last one, Jiří Praus' library is more "manual" and more "C" style but it seems to be the best starting point.

    My code currently loops through 7 message types:

    • Read STATUS
    • Read SLAVE_CONFIG
    • Read MODULATION_LEVEL
    • Read CH_WATER_PRESSURE
    • Read BOILER_FLOW_WATER_TEMP
    • Read MAX_CH_SETPOINT
    • Write CH_SETPOINT

    And then repeats, reporting the current status. It also accepts a couple commands via the UART.

    The code is on github.

  • Hardware complete for now

    Ivan Stepaniuk04/15/2020 at 01:28 0 comments

    The interface is complete, I wanted to use a generic STM32 (bluepill) micro but also had an ESP8266EX, wemos D1 mini (clone)  and an OpenTherm library that was already working with that. I did not wanted to fiddle setting the 3 required hardware timers that the library is using so that settled it.

    The circuit is quite clever, based on the schematics for the OTGW, I only changed some resistor values to match the optos that I had lying around (4N28) and the fact that this micro GPIO is 3.3 volts, and not 5 volts like the PIC on the original. The big RJ connector is not connected, I might use it for power if I go the WiFi route instead of serial. I'm not sure if I trust the heating to my WiFi router, thought. Maybe not.

    Here is an excellent description of this circuits's workings:
    https://electronics.stackexchange.com/questions/466720/how-does-this-circuit-work-opentherm

View all 4 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates