I am in the middle of designing a DIY Brew Controller for my new Electric BIAB setup. I believe am incorporating a few features that I have not seen in the commercial units. Please let me know your thoughts and ideas.
My initial idea was a WiFi based controller using an ESP8266 that I would interact with via my phone. I had a small 1" OLED display, so I figured I may as well add that so I could see things like temperature and time, and maybe some other info like what stage in the brewing process, etc. The display was a bit small for my aging eyes, plus OLED isn't the best for outside, so I bought a 4.2" 400x300 eInk display that is large and easily seen in daylight. I needed a couple of push-buttons to control two pumps, and then figured it would be nice to also be able to quickly adjust temp and time without needing my phone, so that's 4 buttons. Maybe one more to change modes or something? So I adding a 16 key telephone-style keypad seemed cleaner and future-proof.
The extra GPIOs for the keypad pretty much pushed me over the ESP8266 pin-count, so I decided to use a Raspberry Pi Zero W instead. This also avoids some of the other limitations of the ESP, and gives me more flexibility and power, plus some enhanced features like hosting it's own webpage for the display via my phone, data logging, recipe storage, etc.
To drive the heater I'm using a zero-crossing optoisolator triac driver that then drives a 40A power triac (with a B.A. heatsink to dissipate approx 30W of heat). The zero-crossing reduces noise and electrical stress. The Pi will be set to a PWM frequency of 120 Hz, which allows precise control in half cycles of the 60 Hz. So the 0 to 120 range for the PWM gives 120 steps of power from 0 to full-on, which is less than 1% resolution. And at 120 Hz, the worst-case dynamic "pulsation" of heat is less than a second - I doubt this really matters, but some people swear they see boil pulsation with a 2 second duty cycle.
For the pumps, I am using 2 more of the same zero-crossing optoisolator triac drivers and 40A power triacs, since they are a fraction of cost of an "arduino-style" 5V Relay, plus they are solid state and take up less space. They will strictly be driven ON/OFF, no PWM. No heatsink needed, but I will mount them to the inside of the enclosure, so they will actually have a substantial heatsink.
I have two DS18B20 temperature sensors feeding the Pi. One through an oring seal a couple of inches up from the bottom of the kettle (direct sense, no thermowell). Then I have a second sensor inside an 8" thermowell attached to the lid to measure close to the surface, and/or actually inside the grain bed during a mash.
One thing I am experimenting with is a piezo vibration sensor. My plan is to differentiate between "no boil", "low rolling boil", and "violent boil" using the sensor so the Pi can adjust the heater during the boil phase.
I'm writing the code in Python, and my initial cut will have separate phases for each part of the brewing process: heating strike water; recirculating mash; mash-out/lauter; boil (and maybe something I am not thinking of?) I will need to characterize the heater response so I can adapt the PID algorithm so avoid overshoots, etc. Things like lowering the heater power as temp gets within a few degrees of the target. Maybe have the total water volume & grain bill as inputs to software to help the algorithm adjust? I also plan to input or measure ambient temperature, so I can have the mash cycle be smart enough to adjust the PID gain/lead/lag terms to keep things right at desired mash temp, regardless of whether its a typical Florida 95 degree day, or a 40 degree, 20 mph wind day.
Thoughts?
-Greg
My initial idea was a WiFi based controller using an ESP8266 that I would interact with via my phone. I had a small 1" OLED display, so I figured I may as well add that so I could see things like temperature and time, and maybe some other info like what stage in the brewing process, etc. The display was a bit small for my aging eyes, plus OLED isn't the best for outside, so I bought a 4.2" 400x300 eInk display that is large and easily seen in daylight. I needed a couple of push-buttons to control two pumps, and then figured it would be nice to also be able to quickly adjust temp and time without needing my phone, so that's 4 buttons. Maybe one more to change modes or something? So I adding a 16 key telephone-style keypad seemed cleaner and future-proof.
The extra GPIOs for the keypad pretty much pushed me over the ESP8266 pin-count, so I decided to use a Raspberry Pi Zero W instead. This also avoids some of the other limitations of the ESP, and gives me more flexibility and power, plus some enhanced features like hosting it's own webpage for the display via my phone, data logging, recipe storage, etc.
To drive the heater I'm using a zero-crossing optoisolator triac driver that then drives a 40A power triac (with a B.A. heatsink to dissipate approx 30W of heat). The zero-crossing reduces noise and electrical stress. The Pi will be set to a PWM frequency of 120 Hz, which allows precise control in half cycles of the 60 Hz. So the 0 to 120 range for the PWM gives 120 steps of power from 0 to full-on, which is less than 1% resolution. And at 120 Hz, the worst-case dynamic "pulsation" of heat is less than a second - I doubt this really matters, but some people swear they see boil pulsation with a 2 second duty cycle.
For the pumps, I am using 2 more of the same zero-crossing optoisolator triac drivers and 40A power triacs, since they are a fraction of cost of an "arduino-style" 5V Relay, plus they are solid state and take up less space. They will strictly be driven ON/OFF, no PWM. No heatsink needed, but I will mount them to the inside of the enclosure, so they will actually have a substantial heatsink.
I have two DS18B20 temperature sensors feeding the Pi. One through an oring seal a couple of inches up from the bottom of the kettle (direct sense, no thermowell). Then I have a second sensor inside an 8" thermowell attached to the lid to measure close to the surface, and/or actually inside the grain bed during a mash.
One thing I am experimenting with is a piezo vibration sensor. My plan is to differentiate between "no boil", "low rolling boil", and "violent boil" using the sensor so the Pi can adjust the heater during the boil phase.
I'm writing the code in Python, and my initial cut will have separate phases for each part of the brewing process: heating strike water; recirculating mash; mash-out/lauter; boil (and maybe something I am not thinking of?) I will need to characterize the heater response so I can adapt the PID algorithm so avoid overshoots, etc. Things like lowering the heater power as temp gets within a few degrees of the target. Maybe have the total water volume & grain bill as inputs to software to help the algorithm adjust? I also plan to input or measure ambient temperature, so I can have the mash cycle be smart enough to adjust the PID gain/lead/lag terms to keep things right at desired mash temp, regardless of whether its a typical Florida 95 degree day, or a 40 degree, 20 mph wind day.
Thoughts?
-Greg