Moteino controls gas boiler by simulating an i2c RAM

Started by joelucid, March 07, 2023, 06:21:43 AM

joelucid

Check this out:

Given the surge in European gas prices I've been working on a controller for our heating system - an old gas boiler. The idea is to use hr20 digital radiator thermostats, modify firmware to integrate into my 433mhz home automation network and then optimize boiler flow temperature to be just enough to heat the room with largest heating needs with fully opened thermostat valve.

Purchased a CAN bus module from the boiler manufacturer which then allowed hooking up an esp32 with a can bus module to read the boiler state and send commands. However the boiler often had data connectivity issues with with the module. And here in downtown Berlin 2.4 ghz wifi is so crowded that it doesn't work reliably.

So finally I had had it. I reverse engineered the bus module and found it has a i2c ram which is used to communicate with the boiler in a two i2c masters setup (both write their state into the ram and read the other side's). Hooked up my Saleae Logic and debugged the protocol.

I then dug up an old moteino and taught it to simulate the i2c ram and read/write boiler/controller status directly from/into simulated ram, eliminating the boiler CAN bus module altogether. Now the communication is flawless (even running the moteino at 8mhz for historic rfm69 boot loader reasons) and I send the data to/from controller via reliable 433mhz instead of buggy 2.4 ghz wifi!



Something to be said for the reliability and good documentation of the 328p peripherals! The esp32 I2c slave implementation is very insufficient and interrupt latency is terrible in comparison.

Here the system is in action (as of yet it controls flow temperature according to the needs of the main living space):



Haven't been in the forums for a long time - but I still use my Moteinos!

Felix

Beautiful classy solution of upgrading and reusing reliable retro hardware along with a good ol' Moteino, which again and again TRUMPs ESP in the wireless comms and low power department.

Reminds me of my similar-in-some-ways doorbell mote solution, which by the way has worked untouched and flawlessly since 2015.

Willkommen zur