I’ve been working on a beer brewing controller for a little over a year now and I’ve decided to start putting my ideas down online. This post is a summary of my ideas and issues to date. I’ll have more details in future posts.
My Back Story:
I have a degree as an electronic technician and work in the industrial automation field as a technician so I’m very comfortable working with electricity, PLCs, computers, and stuff. Naturally, when I wanted to upgrade my brewing setup I wanted to switch to electric. TheElectricBrewery.com was a big inspiration for how I wanted my system to work.
The Original Idea:
As luck would have it, I happened to be in the local supply store one day and they had their yearly scratch and dent sale going on. After finding two slightly used 10 gallon Tall Boy pots for almost half off I decided it was a sign to start the upgrade.
WARNING: electricity can kill you and/or burn your house down so find someone who knows what they are doing if you don’t.
I started my upgrade by installing a 220V spa sub-panel in my garage. For whatever reason, I can buy a whole sub-panel with GFI breaker cheaper than I can buy a standalone GFI breaker where I live. I also bought a Tri-clamp enclosures and 5500W element for one of my “new” dented pots. NOTE they do make a few different styles of tri-clamp enclosures now so you might want to shop around.
Once I had my wiring done, I decided to test the element with a 2 pole 30A switch. My hope was that I could just use the switch until I could hookup a temp controller. First, I hooked up 110V to the element. 110V is not enough power (1375W) to bring or maintain a boil with my pot/element. It would work great for mashing though. Then I hooked up 220V, after a few minutes the pot almost had a boil over with just plain water. To make matters worse, as soon as I turned off the switch the water stopped boiling. Something faster and smarter was needed.
I started looking on amazon and found this and it worked great. I could maintain a nice boil with it. If you’re looking for a manual controller I recommend it.
I wanted to be able to mash with it too, so I needed some sort of temp feedback. I had an arduino lying around so I figured I’d rig it up with the basic PID sample code. I may have let some magic smoke out of the SCR and arduino after trying to replace the digital screen.
Another quick trip to Amazon and I had a 40A SSR, 220V 60A contactor, a few temp probes on the way.
The PID code with SSR wouldn’t give me a nice steady boil like I have with gas or the SCR controller. I could watch as the water would boil like crazy then stop as the PID was controlling it.
I can go into a long explanation about how to fix this but the short answer is I needed to add a zero cross detector. This tells the controller when the AC wave is almost zero so you control each half wave. Yet another quick order and I had an isolated 110/220V to 5/10V transformer and some opto isolators on the way. Note: I know I didn’t need the transformer but I was hoping I could power my final circuit with it too.
I built a basic Zero-cross detector and started to play with the arduino ACPWM code. I hooked everything up to 110V again and used a lamp to debug the code. Unfortunately, I made a strobe light instead of a dimmer. Luckily I have an old oscilloscope so I was able to figure out what was happening. The SSR I had bought off amazon that said it was an instant on was in fact a zero cross relay. This means that instead of chopping part the AC wave, I could only turn on the relay for a full half cycle.
I decided to try to work around this “feature” of the cheap SSR. I spend a few hours making a fancy duty cycle table in excel and then implementing it in the arduino code. The light was still a little strobe like but I figured the heating would be fine. I then converted the circuit back to 220V and hooked up my pot.
I flipped the circuit breaker on and pushed out full power to the pot. Once I had a boil, I put the set point to a 1:1 duty cycle and the boil started to slow down. Unfortunately, it was still boiling a little too rapid for me. What can I say, I don’t like boil overs. When I tried to lower the duty cycle more, the boil started to oscillate again.
I finally broke and bought a nice SSR from digikey that worked the way I wanted. This allows me to turn on the relay for a part of each half wave. Then I started to strip away all the excess code from ACPWM and now I have the interrupt routines down to 6 lines of code. The whole runtime for the SSR and contactor is around 40 lines as of writing this.
Now that I have working hardware I wanted to find some software for temp control. I started looking existing projects that I could modify to work with my AC chopping idea. I started with BrewPi, at the time they had the brewing code in demo. It would have been a massive rewrite to get it to work correctly. Then I found Open ArdBir. The code was easy to figure out and tweak to get the PWM code working. Unfortunately, the 3 interrupts that are called 120 time a second messed up the arduino millis function, LCD, and button code. After a 60 minute mash turned into 2 hours I decided I should figure something else out.
After the mashing issues, I decided I should break the UI and ACPWM code up. I originally modified the osPID code for my temp sensors and my ACPWM code. This worked great with a computer running the osPID front-end.
I was having a hard time tweaking the osPID front end the way I wanted. I’m not very good at writing code and I was having a hard time tweaking the osPID front end the way I wanted while adding more features to the osPID firmware.
After spending way too much time on trying to repurpose someone else’s project, I realized the very expensive software I use for work is able to talk modbus. This let me whip up a HMI quickly (with the work laptop) and focus on making a working controller. The nice part about modbus is the amount of free software that supports it.
Now I have a mostly functional brewing controller, I can work on getting rid of using my work laptop for the HMI. As of writing, this is where I’m at. I’m currently looking at maybe using something like AdvancedHMI or similar software package.