Between Pitch and Pint: Advanced fermenter/dispenser automation
Most pro brewers (and a growing number of homebrewers) are using some sort of control panel to interact and control their brewstands. But many of these same brewers revert to fully manual measurement and simple thermostats once the wort has been handed off to the cellar. This article takes a look at what is possible with modern automation, between pitched yeast and a poured pint.
The Basics
Let’s start by making sure we are all on the same page regarding what is and is not automation. Being able to walk up to a control panel and push a button to start a wort transfer is not automation, nor is a digital display of the temperature inside a fermenter. An automated system is one that can, for example, measure when the specific gravity of beer in a fermenter has fallen to 1.020, close a valve to stop chilled glycol from flowing through the fermenter’s jacket, allowing the temperature of the beer to rise to 60 °F (16 °C) for a diacetyl rest for a lager. In the automated system, the gravity, temperature, and duration of the diacetyl rest are pre-determined and occur without intervention from the brewer.
The processor in an automation system interacts with a controller. The controller serves as the middleman between the processor and the various inputs and sensors in the system. On the output side, the controller can tell various bits of equipment in the system to turn on or off. Some systems that use a Programmable Logic Controller (PLC) have both the processor and the controller in the same part. PLCs are industrial-grade process control equipment and usually require extensive programming (and the debugging that goes with it!) in order to perform as intended. Larger regional breweries will probably use custom-developed PLC controls in their fermentation systems. Huge industrial breweries for AB InBev and MolsonCoors make use of PLC-based automation extensively. The high cost of a custom-programmed PLC system puts that option out of the reach of most small, startup breweries as well as homebrewers.
While we may not have the industrial-grade hardware found in a PLC, there are systems that are suitable for smaller breweries all the way down to the ubiquitous 5-gallon (19-L) homebrew batch scale. Two of the most common systems that are suitable for development of a fermenter/dispenser automation system are Raspberry Pi (RPi) systems and BruControl systems. Raspberry Pi is an open-source, System on a Chip (SoC) computer that uses the also open-source Linux operating system. Software packages like CraftBeer Pi and Raspberry Pints have been developed to provide the basic controller interface. BruControl is a Windows front-end application. Both systems interact with various microcontrollers and interface boards that are between the computer and the cellar. From a straight-up cost perspective, the cheapest path to automation is with an RPi processor, but brewers will need to learn some programming or pay someone to develop the automation routines called “steps.” BruControl is a powerful, flexible system that can run both the brewery and the cellar, and it has an easy-to-learn native scripting language to handle the hands-off automation.
The automation and robotics world is exploding, and microcontrollers are the heart of the explosion. There is a dizzying array of choices for microcontrollers and the support equipment used for projects like brewing and cellaring beer. Elegoo, Adafruit, and SparkFun are good websites to start learning about automation capabilities as well as places to purchase the necessary equipment.
By far, the most common microcontrollers are the Arduino boards. Depending on the amount of Inputs and Outputs (I/O) required to build an automated cellaring system for your brewery, microcontrollers can range from $10–$37 (USD). Several microcontrollers can be connected to a single processor, which means that highly complex systems with several hundred I/O are feasible within a budget that is a small fraction of an equivalent PLC-based system.
By far the most challenging part of developing an automated cellaring system is the integration of the various bits and pieces of hardware, microcontrollers, valves, sensors, relays, circuit breakers, contactors, etc. that all have to work together and be compatible with each other in order to make a functional automation system. For the hobbyist trying to get control of a couple of repurposed refrigerators and a big keg freezer (keezer), there is a tremendous amount of information and expertise available on the internet. Most of it is from other hobbyists who have been willing to share what they learned. For a small-scale pro brewer, it might be more cost-effective to contract with either an experienced hobbyist or a commercial integrator. More information about what’s involved with integration will be discussed later in this article.
Not as challenging, but still something that has to be thought through carefully, is the actual implementation of the system. Where will the touchscreen be mounted? Do I need one enclosure or three? Where will I route my sensor wiring? How do I get Wi-Fi into my all-metal walk-in cooler? Do I need to get a professional to punch holes in my fermenters and bright tanks? How will I clean the stuff that comes into contact with beer? There are those questions and a hundred others. Again, the automation threads on HomeBrewTalk.com and other online brewing forums are a terrific resource.
Inputs
At its most basic level, inputs tell the processor what’s going on in the system (i.e. your fermenter) and the processor tells the system what to do next via the outputs. The term used to describe the processor’s inputs and outputs is I/O (it’s “eye-oh,” not “one-zero”). Generally speaking, inputs are sensors, and outputs are controls. Also generally speaking, there are three pricing tiers for the sensor and control hardware. The least expensive tier falls into the “caveat emptor” category. It’s the least accurate, the least precise, and is built from the poorest quality materials. Alibaba and Amazon’s Chinese suppliers often fall into this category. Up from there are sensors that are built from higher-quality materials and have a Mean Time Between Failure (MTBF) rating several times that of bottom-tier equipment.
This second tier would be recommended for homebrewers with some budget flexibility, and any pro brewers who feel their time is better spent brewing than fixing stuff. The top tier is reserved for laboratory-grade equipment. It’s the gold standard. Measuring equipment at this level can run in the tens of thousands of dollars, but it’s as close to “Absolute Truth” as humans can manage. Lab-grade stuff is beyond the scope of this article, and often not suitable for installation in a brewery.
Since the topic at hand is cellaring, the following list of inputs would be expected in an automated cellar:
- Temperature: Includes ambient, individual fermenters and bright tanks, walk-in coolers, heat exchangers, kegerators and keezers, fermentation chambers, and glycol reservoirs. Understanding and controlling fermentation temperature is the most important part of cellaring. Temperature sensors are found in three main varieties: Resistance Temperature Detectors (RTD) measure the resistance across a thin piece of platinum wire whose resistance changes as the temperature rises or falls. PT-100 sensors are the most accurate of the commonly available probes. Thermocouples (TC) are the most common form of sensor, but are not as accurate as an RTD sensor. They measure the voltage change between dissimilar metals as temperature rises and falls. Thermocouples are the sensors shipped with most off-the-shelf thermostats. The final commonly available sensor is the 1-wire, where each sensor provides a digital signal that includes the measured temperature and an ID number unique to the sensor. While not as accurate as an RTD/PT-100 sensor, they are very useful, as their digital signal can be sent over a far greater distance than that of the analog signal of a PT-100 or thermocouple.
- Specific Gravity (SG): The next most important measurement for a fermentation is the specific gravity of the beer in the fermenter. It’s how we know that the yeast has done its job and it’s time to keg. For homebrewers, the Tilt hydrometer is the most popular choice, but several other similar devices are available. The Tilt unit is a waterproof capsule that drops into the fermenter and reports temperature and specific gravity readings to any nearby Bluetooth device. Accuracy and precision are not laboratory-grade, but the convenience and ease of integration into an automated system have proven to be tough to beat. For small-scale professional brewers, an in-tank sensor with an external connection may be a better solution (though they should not take the place of a proper quality control program). But Tilt does now offer a larger unit for professional brewers as well as a repeater to allow use in larger stainless tanks. Bluetooth devices traditionally have a reduced range when inside stainless steel containers.
- Pressure: Fermenting under pressure, or spunding, is an established technique in the professional brewing world and has been increasing in homebrewing spaces. Unitanks have an undeniable appeal, but using this technique requires the ability to measure and control the pressure inside the vessel. While a spunding valve is all that is really needed, Atlas Scientific does market a sensor and interface board that is suitable for measuring pressure. Controlling pressure would be a function of the output side of the processor and will be discussed later in this article.
- Flow and Weight: The dispensing side of the cellar has its own measurement requirements. Flowmeters, pressure sensors, and strain gauges are the input tools available to measure the volume of a liquid (beer) as it moves from fermenter to keg to glass. You can set up a system to measure how many pints you have poured from a fresh keg. In a small-scale brewery, it can alert taproom staff of an imminent keg change. You can gauge how much beer you have pumped into each keg.
- Integrated Sensors: Some manufacturers are now selling multi-sensor units that use either a portable sensor unit that hooks into a dedicated sampling port, where the active fermentation vessel is connected to a magic box that pumps out a sample every couple of hours, analyzes it for several measurements, and reports the measurements to the system’s processor; the other unit is a probe that stays immersed in the beer and reports the periodic measurements to the processor. These units measure temperature, specific gravity, dissolved oxygen, pH, color, clarity, and conductivity. While I mention these, some of them range in the tens of thousands of dollars.
Outputs
Now that the processor has all of the information it needs to make decisions, its scripts and other programming tells the microcontroller what to have the cellar’s equipment actually do. The actions are performed by outputs, which are, when boiled down to the basics, just switches. Some switches operate occasionally, while others operate hundreds of times per second. Our perception of automation depends on when each of these switches changes state or is turned on or off. Here are some examples of equipment that is controlled by an automation system’s outputs:
- Valves: Valves can control liquid flow, directing beer from a fermenter to a bright tank, from a bright tank to a keg filler, or from a reservoir of caustic cleaner into a keg washer. Valves can run off of DC power at 12 or 24 Volts, and AC power at 120, 208, or 240 VAC. Motor-operated valves are available in all NPT sizes commonly found in breweries. The combination of automated control of pumps and valves means a huge reduction in both labor and mistakes when transferring large volumes of liquid from one place to another in a brewery. It also means a lot less time is spent dragging hoses and pump carts from tank to tank.
- Motors: Like valves, the use of relays and contactors means that pumps, from a basic homebrewer’s Chugger pump to the largest pumps in a 50-BBL brewery, can be controlled with the cellar’s automation system. It’s just a matter of scaling the relays and contactors to handle the voltage and current. The control signals for everything in the brewery are low-voltage, low-current signals.
- Alarms: One of the key outputs from an automation system are alarms. When a process or function strays from its defined parameters, it’s up to the processor to let the operator know that something is amiss. Any automation system worth installing in a brewery should have an alarm capability that can trigger a horn/buzzer, a strobe light, or an email. Some even offer to send a text message if a number goes sideways. Alarms are particularly useful to notify brewers of a power failure or some other catastrophe that could result in the loss of an entire batch. At a far less destructive level, alarms can also notify the brewer that (for example) it is commencing a diacetyl rest process, that primary fermentation has completed, or that your last keg of Fat Cat IPA is about to blow.
Integration: The 800-lb. gorilla
System integration is where the happy dreams of a fully automated touchscreen control system with a sci-fi grade interface meet the rough pavement, skinned-knee reality of mismatched voltages, incompatible communications protocols, and voltage spikes from improperly managed electromagnetic interference (EMI). It’s the part that requires knowledge and planning.
There are two tables that have to be defined at the start of the integration planning. The first is the overall power consumption of the system, and the second is an accurate count of the I/O needed for the system to be able to do what you want it to.
The power requirements are listed as the first priority because you can’t have a workable system if breakers and fuses are tripping and blowing every time you try to ferment a batch. I/O is listed second because it’s not exactly “automated” if you have to unplug one temperature sensor in order to free up an input port for a pH meter.
Load Analysis
In order to understand how much power you need, you need to perform a load analysis. Every component in the system you are planning consumes electricity, and you need to figure out exactly how much electricity is being used in order to scale the power distribution components of the system so that adequate power is available to each component. Most people develop a spreadsheet that lists each component of the system, the voltage and current it requires, and the percentage of use it will see during normal operations.
High-voltage, high-current devices like glycol chiller compressors, heaters, and large pumps are the first to get added to the analysis, as they have the biggest impact on breaker size and the overall power consumption of the system. Every piece of equipment you evaluate will have a specification sheet available that lists the power consumption of the equipment. Compressors, pumps, and valves will provide specifics, but some sensors and signal-level components will not. Equipment with specified power consumption will need to be itemized in the load analysis, but signal-level components can be lumped into a group that is allocated an Ampere or two of capacity. In reality, those signal-level components only use a milliamp or two of current, so a 2A allocation should be adequate. Now is the time to make certain that every component has the power it needs.
Be careful with the current numbers you use in your load analysis. Compressors are a prime example of why. Some equipment that have a compressor may only list a recommended breaker value, like a residential refrigerator repurposed as a fermentation chamber. The installation manual may recommend connection to a 15A circuit, but the ID plate may state that starting current (Full Load Amps, or FLA) is only 12A, and running current is only 6A. ALWAYS use the FLA figure.
You should develop a list of the current requirements at each voltage in your system, and scale the power supplies accordingly. The glycol system may need 20A at 240VAC, but the bank of low-voltage relays may only need 8A at 24VDC. The motor-operated valves may need 3A at 12VDC. Whatever voltages and current the equipment needs should be reflected in the load analysis so that you know how to properly scale your power supply circuits and equipment.
I/O Analysis
A second spreadsheet needs to be developed that lists every input and output that your system needs. This analysis needs to list whether the I/O is digital (e.g. a switch) or analog (e.g. a Hall-effect flow meter sensor), what its operating voltage is, and what type of signal it uses. An RTD will use low voltage to provide a reading in ohms, and a DC pump may use a 24VDC PWM (pulse-width modulation) digital output. All of this information needs to be laid out in advance of final equipment selection.
Once the power and I/O requirements are known, the controller and power supplies can be finalized. Once the power supplies are specified, the overcurrent protection requirements can be specified. Contactor and relay selections can be made after the power supplies and overcurrent protection choices have been made.
After the power-handling equipment has been specified, the next step is to define the communications protocols for each sensor. Some will use UART-based serial communications, some will use the I2C bus, and some will use Wi-Fi or Bluetooth connectivity. More advanced and pro-level PLC systems may use the Modbus communications protocol. Note that some of these communications protocols can be sensitive to EMI and need to have the cable connections shielded and routed away from any wiring that carries AC power. Other protocols may have a maximum cable length, which can affect decisions about where to place the equipment.
Bill of Materials
Once you have refined the load analysis and I/O analysis, the final step is to develop a preliminary Bill of Materials (BOM) that includes every component that will be utilized in the system. You should build a final spreadsheet that lists each component, its part number, source, cost, voltage, amperage, and a link to the specification sheet that shows its electrical connection diagram.
The end of this phase of the project should leave you with a clear understanding of every component in the system, how it is going to be connected, the parts that are needed to connect the component — both mechanically and electrically, and how those components will connect to the microcontroller and to the processor you have selected.
Implementation
Rubber, meet road. The implementation process begins with the development and careful review of an electrical schematic and connection diagram. All of the design ideas need to be put down on paper to define exactly what it is you need to do to have the system work. You cannot shortcut this process. Accurate schematics are critical for any kind of diagnostic effort later on. A professional electrician should be consulted to review your design. But there are some online resources available, including sample schematics and integration hardware available from BruControl.
Building the system will mean making lots of decisions, mostly involving mounting and placing equipment and sensors, running wires, building enclosures, and making connections. Don’t hurry this process. The temptation to do a big push to finish everything up across a long weekend will lead to mistakes borne from haste. They are avoidable if you take your time and cross-check your work as you go. It can be helpful to enlist a buddy to come in for a review of your work. But if you feel even some hesitation, there is no shame in bringing in a professional to lend a hand during the build.
Testing
The importance of testing cannot be overstated. It needs to be done methodically and carefully, with the primary focus on protecting the equipment you just bought from a catastrophic meltdown. I promise that you don’t want to live with the empty wallet and burned equipment smell when you inadvertently apply 24VDC to a digital input on a microcontroller rated to run on 3.3VDC. Your best tool will be a written test checklist that describes each test, and the expected result.
In general, begin testing with a meter set to test continuity. Where there are connections that you expect to see line voltage on an AC circuit, check for continuity to ground. If there is continuity, you might have an issue when you plug it in. Next, check all of the low-voltage DC circuitry. Look for correct continuity for both positive and negative circuits.
When you connect AC power for the first time, open all of the circuit breakers and pull all of the fuses. Close breakers and insert fuses one at a time and look for the correct voltages at each test point.
Once all of the basic electrical testing is completed, it’s OK to begin the mechanical testing. Make sure the valves open and close. Make sure the pumps turn on and off, and that they are pumping fluid in the expected direction. Check the functionality of each switch.
The last round of testing should involve batch-sized amounts of water or a simulated glycol reservoir. Make sure that your liquid connections do not leak, and that you don’t accidentally pump glycol into a fermenter.
Also, the testing protocol needs to include a thorough exercise of the control interface of the automation system you have chosen. Any scripts that have been developed also need to be tested and debugged with water testing.
Once the final liquid tests are done (and ALL glitches have been resolved), your system is ready to go live!