Boiler power regulator

The Homebrew Forum

Help Support The Homebrew Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

curtiskenny

New Member
Joined
Mar 18, 2022
Messages
14
Reaction score
10
Location
Standish, Wigan
Last edited by a moderator:
Yes, some people have used similar ones and it’s probably the same board inside.
That ‘multi socket’ on the front isn’t UK safe and I wouldn’t trust it at 4kW.

Boxes like this aren’t intended for prolonged use: OK for controlling a drill while making a hole; but not for managing a 60min boil. Hence likely to get very hot and I suspect it might burn out pretty fast.

Be aware that the electrical safety of the construction of similar modules is said to be not great - see: Quick Review: Generic 4000W “SCR” Voltage Regulator, Dimmer, Motor Speed Controller
 
Last edited:
I use a REX C100 PID with an SSR to hold my Buffalo at 66C for BIAB mashing - an arduino/Pi would be more sophisticated but you'd probably still need a temperature probe to provide feedback.

You can flick an SSR on and off rapidly, unlike a relay, although they do get hot when switching >2kW so it'll need a good heatsink as well

Cheers
Simon
 
Thanks @The-Engineer-That-Brews

I do have a few Arduino minis sitting in a cupboard that I could experiment with.

Is there any guides/guidance on the best way to control the toggle time of the SSR?

Curtis
Hi Curtis - apologies, I've only just seen your reply and question about the switching rate.
It's important to note that if you re using a zero-crossing SSR (which you should, in order to reduce both RF interference and shock-loading of the heater element) then the minimum on-time is half a mains cycle (=10ms) so there's no point switching faster than 100Hz (i.e. the internal control circuitry will always stretch the on-time to this anyhow).
Equally you don't want to switch too slowly, otherwise the temperature of the heater element will vary too much during the cycle.
A good straightforward compromise is a 1Hz basic cycle time, and to adjust the length of the pulse within that time in units of 10ms. This gives you a 1% granularity of control, which is arguably far more accuracy than you actually need for the job :-)

Geeky Footnote
The above approach is absolutely fine. But ideally instead of adjusting the pulse duration we should change the average pulse density. This both reduces surge heating and improves our granularity of control.
I do that with a variation of the Bresenham algorithm. My code for it (in C, for the esp32c) is really simple, and looks like this:
Screenshot 2022-03-28 at 13.59.51.png

You want to define BRESENHAM_FRAME_LEN to be a reasonable prime number (I use 1009); and then call the above function from a timer interrupt every 1/50th of a sec.
To adjust the pulse density just use some other function to change the value of the global ones_count between zero (no power) and BRESENHAM_FRAME_LEN (full power).

Give me a shout if you want help with the Arduino code...
 
I use a REX C100 PID with an SSR to hold my Buffalo at 66C for BIAB mashing - an arduino/Pi would be more sophisticated but you'd probably still need a temperature probe to provide feedback.

You can flick an SSR on and off rapidly, unlike a relay, although they do get hot when switching >2kW so it'll need a good heatsink as well

Cheers
Simon
Good point. In fact it's not so much that they get hot when they are switching, as that they drop a small voltage in the ON state - so they dissipate heat when delivering current to the load.
Typical SSRs like the one I linked above drop about 1.7V - so at 13A load they dissipate 1.7V x 13A = 22W. This is comparable to the amount of power dissipated in a 5m mains lead, so it's nothing to worry about unduly; but as @simonind says, it's definitely worth mounting them on a heatsink (if nothing else it will extend the life of the device).

There's no need for a temperature sensor on a controller intended simply to reduce the vigour of the boil - it suffices just to set it to 70-80% power.

FWIW I've used these heatsinks with SSRs to control up to 32A boilers - they are excellent and easy to mount: WF210000 | Solid State Relay Heatsink for use with Single Phase Relay | RS Components. Obviously it goes without saying this needs to be outside the enclosure unless you're using a fan to draw in cool air.

Screenshot 2022-03-28 at 14.34.26.png


Here's one of my boxes showing how I mount the SSR and the heatsink (the silver thing on the left is a cheap mains PSU).

Screenshot 2022-03-28 at 14.39.09.png
 
Last edited:
Thanks @The-Engineer-That-Brews and @simonind your messages are both very useful.

Geeky Footnote
The above approach is absolutely fine. But ideally instead of adjusting the pulse duration we should change the average pulse density. This both reduces surge heating and improves our granularity of control.
I do that with a variation of the Bresenham algorithm. My code for it (in C, for the esp32c) is really simple, and looks like this:
View attachment 65600
You want to define BRESENHAM_FRAME_LEN to be a reasonable prime number (I use 1009); and then call the above function from a timer interrupt every 1/50th of a sec.
To adjust the pulse density just use some other function to change the value of the global ones_count between zero (no power) and BRESENHAM_FRAME_LEN (full power).

Give me a shout if you want help with the Arduino code...

Very interesting. I will try to find time to implement this at some point before buying the SSRs and enclosures.

Here's one of my boxes showing how I mount the SSR and the heatsink (the silver thing on the left is a cheap mains PSU).

View attachment 65605

Is this a 5V PSU similar to Regulated Switching Power Supply 3.3V 5V 9V 12V 18V 24V 36V 48V Universal DC PSU | eBay to power the Arduino/ESP?

Are you using IEC connectors for your power input/output?

Would love to see more of your setup if you've already posted it somewhere else?
 
Yep - those are the very ones :-)
In fact the PSU in the photo is a 12V one because I also control two pump motors from the box. Therefore I use one of these cheap adjustable DC-DC converters to take it down to 3.3V for the ESP.
I think that if I were making a single purpose box like a boiler power controller though, I'd probably just use an external plug-mounted PSU (aka 'wall-wort') as it would simply the construction.

Are you using IEC connectors for your power input/output?
Yep. IEC 60320 C13/C14.
Although technically from a UK perspective they are only rated to 10A (according to IEC 60320-1), the identical part is rated to 15A in the USA (according to the more recent UL/CSA 60320-1) so that's good enough for me.
I haven't experienced any problems with them (and my boiler is 3.3kW); but I do get good quality 're-wireable' ones and use them in conjunction with decent (1.5mm or 2.5mm) heat resistant cable.

Would love to see more of your setup if you've already posted it somewhere else?
Heh - I've posted various times about different parts of my setup but I guess you're mainly asking about that controller box?
The idea was to make a self-contained multipurpose box that I could use in various different roles: as a PID controller to manage the mash (HERMS heater, pumps, temp sensors etc), boil controller and also for things like managing my fermentation cabinet heater/chiller. In fact I made a couple of identical boxes because I'm normally managing a couple of different processes at the same time.
Normally for embedded designs I base the user interface on a 2 or 4-row LCD alphanumeric display and a 'turn/click knob' to move between different fields. But while this is great for a single-purpose box, it rapidly becomes a fiddle to use, and a bit restrictive, when you've got a lot of different parameters to manage. So this time I made the box 'headless' and used the WiFi capability of the ESP-32 to put all the user interface on a web-based javascript interface that I can access from my iPad. This is nice because it also allows me to chart the different temperatures during the mash:

Screenshot 2022-03-29 at 13.34.59.png



For the temperature sensors I use the little DS18B20 devices in stainless steel encapsulations - they are excellent: fully waterproof and easy to connect as many as you need via a one-wire bus.
1648557557130.png
 
Having said all that, I would recommend that you make yourself a single-purpose boiler control box.
I don't think you'll need a display on it at all, unless you want one. I'd just put a knob (variable resistor) on it to set the boil power; and read the position of that with one of the Arduino A/D ports. Then you can just run everything in a single control loop, and use a delay to get the cycle time close to 50Hz. That way you won't have to worry about timer interrupts etc (although they are a better way to go if you have sufficient experience).
I might put an external LED showing the SSR control voltage though - that's quite good for visual feedback on how much power you're delivering.
 
Thanks for the useful explanations. This all looks very do-able but might be slightly above what I'm willing to spend right now. I will try to get a few more brews under my belt then revisit the parts list later in the year.

Meanwhile I will probably make a start on the Arduino code - I have a CS/Software Engineering background but my C knowledge is quite sparse atm. I will try to go down the interrupt route if I can.
 
My advice is to step away from the Arduino IDE as it's good for learning but pretty pants for anything more production.
The chips on the Arduino boards are ATmega devices which are very well documented and are supported by the extremely well established (and free) 'AVR' compiler within the GCC / GNU toolchain.
I would strongly recommend getting going with the AVR approach rather than Arduino - it's worth the effort; especially if you are using 'proper' features like interrupts.

I can very highly recommend this book as a comprehensive step-by-step introduction to setting up the AVR/gcc toolchain and learning how to use the ATmega devices: Make: AVR Programming: Amazon.co.uk: Williams, Elliot: 9789351105220: Books - or if you prefer there are lots of guides online (e.g. Setting up AVR-GCC Toolchain on Linux and Mac OS X » maxEmbedded for Mac or Using the GNU AVR toolchain on Windows 10 for windoze).

HOWEVER. I must say that in comparison to newer (32 bit) stuff like the ESP-32 and Raspberry PICO the ATmega chips are looking very long in the tooth and a bit pricey for what they are. Personally I've stopped using them (although I still have a few dozen in my parts bin). The RPi PICO is my favourite device at the moment and I've contributed somewhat to the project myself; but you can't beat the ESP32 if you want WiFi capability.
 
I'd have a look at www.smartpid.com

I've just changed my All in one brew ( guten 70 ) to this. Has PID control for mash and HLT, takes either NTC 100k or DS18B20 temp probes and can control pumps stirrers etc.

But if you want to fiddle / build the above options look promising.
 
Back
Top