The safest way to automate a gas or electric boiler is to wire the relay in parallel with its room-thermostat input. Then the ESP32 can only request heat; if it hangs, the boiler’s own limiter and thermostat keep working. Before anything else, read the boiler manual: some inputs are a dry contact, some carry 24 V or even 230 V, and some boilers use OpenTherm instead, which a plain relay cannot drive.
Control logic
DS18B20 probes need a 4.7 kΩ pull-up and a waterproof housing. Strap one to the supply pipe with insulation on top, and keep in mind that the pipe wall lags the water by a minute or two. Use a hysteresis of about half a degree and a minimum on-time and off-time of several minutes, so the boiler does not short-cycle.
Log the room and the supply temperature. A graph shows in a week whether the boiler is oversized.
If a probe fails, the sketch should fall back to "no request" and send a message.
This is a comfort controller. Safety devices of the boiler must stay exactly as the manufacturer made them.
Ukraine: we buy and sell these parts ourselves, order them on this site.
Some links are affiliate links: we may earn a commission at no extra cost to you.
Related ideas
⛔ High risk
Mains 220–230 V can kill. Work with the power off, use certified isolated modules in an enclosure, fuse the line, and ask a qualified electrician if you are not sure.
Comments
No comments yet. Share your experience or ask a question.