# Continuous Measurement of Fluid Density, Part 1: Concept and Design

## Introduction

One of the chores every brewer performs is measurement of the density of a fluid. This measurement gives two critical data from the brewing process. First, a measurement right before fermentation tells how much sugar is in the wort. This is called original gravity and is one of the key parameters of any beer recipe. A large portion of the work that goes into a brew day is to control the quantity and types of sugars that are in the wort. Second, since the density of the beer decreases as the yeast convert sugars to ethanol and other byproducts, measurement of density allows the brewer to monitor the progress of the fermentation. When fermentation is complete, the last density measurement is called the final gravity. The difference between the original and final gravities can be used to calculate the alcohol content of the beer.

There are two methods available to brewers to measure density. The simplest device is the hydrometer, a glass bob that is submerged in a cylinder of liquid. The denser the liquid, the higher the hydrometer floats. The other device is a refractometer, which measures how much the fluid refracts light. Sugar and alcohol in the beer change its refractive index, so a few calculations can yield the concentration of sugar and alcohol in the fluid.

Considering how important a task this is, it’s embarrassing to admit that I absolutely hate doing it. Each of the above methods requires collection of a sample of the fluid. I don’t mind this on brew day, but collecting a sample from the fermentor using sanitary technique is a hassle. I like to be hands off during fermentation; that’s why I went through the trouble of building an automated temperature controller. It’d be great to add density measurement to my existing system.

I’ve been slowly tinkering with a solution, but the idea of automatic specific gravity measurement on a homebrewer’s scale isn’t new. The homebrew forums have been kicking ideas around for years, and have beaten it to death. Then, the Beer Bug hit the scene with what is probably the best solution. If I’d known about it sooner, I probably would have bought one. However, I’ve put a fair amount of work into my prototype, and I’d like to see it through.

## P&ID Legend

There are a few diagrams to follow, and I’ll use symbols that are mostly self-explanatory. Two that may not be well known require some explanation.This is a manual valve. It sits at the bottom of my fermentor. I open it when I want to collect yeast or transfer the beer to a keg.This is a check valve, or a one way valve. It allows fluid to flow in the direction of the arrow, but not the other direction.

## Concept

One of the simplest ways to find the density of a fluid is to measure the pressure caused by a height of the fluid. The diagram above shows the fermentor and two ports at different heights connected to a sensor. The differential pressure measured by this sensor can be used to calculate the density with the following formula:

$\Delta P= \rho g \Delta h$

$\Delta P$ is the pressure difference between two points in the fluid
$\Delta h$ is the height difference between the two points
$\rho$ is the density of the fluid
$g$ is gravitational acceleration

While this is straightforward, the difficulty lies in the design. The density of the beer will change by no more than 10% from start to finish, so changes of even 0.1% of the scale of the transducer can be significant and indicate that fermentation is still active. Since detecting cessation of fermentation is the most important goal, the precision of the system will need to be within this order of magnitude.

## Design

The first design challenge is selection of a sensor. Differential pressure sensors are expensive devices. A device that has the required accuracy, tolerates liquids, and is food safe would easily cost hundreds of dollars. There are much cheaper differential pressure sensors available, but they don’t tolerate liquids and aren’t food safe. Fortunately, with some creative design, they will serve the purpose.

The above diagram shows the first change necessary to allow the use of a cheaper sensor. Instead of attaching the sensor directly to the wall of the fermentor, it is attached to dip tubes extending down to different heights within the fluid. This keeps beer from directly contacting the sensor, which means it doesn’t need to tolerate liquid or be food safe. Instead, gas will transmit the pressure from the dip tube to the sensor.

The above diagram shows the problem with this approach. The left panel shows the desired configuration, but the right panel shows liquid rising into the tubes. In the right panel, the height of the liquid is different than expected, making the calculated density incorrect. To fix this problem, one more change to the design is necessary.

This shows the addition of a small vacuum pump leading into the dip tubes. Check valves prevent the reversal of flow and isolate the tubes from one another as well as from the gas in the top of the fermentor. A microcontroller will occasionally power the pump, which will pull gas from the top of the fermentor and push it into the tubes, clearing any liquid. The pump will then be turned off to allow for the measurement of the pressure difference between the two tubes.

## Rejected Design

Commercial transducer with a metal isolation diaphragm

One thought worth mention is diaphragm isolation. This was an idea that was discussed in the homebrew forums and that I had also considered. Diaphragm isolation is a technique for measuring the pressure of a fluid while keeping the sensor separate from the fluid by placing a thin layer of material between the medium and the sensor. The space on the side of the sensor is filled with an inert hydraulic fluid. This would be another way to solve many of the above problems. Interestingly, it would also have the added theoretical advantage of greater accuracy since the height of the hydraulic fluid would have to be subtracted from the height of the beer. This would allow the use of a sensor with a smaller range, yielding greater accuracy and precision. I considered this approach for a time, but decided against it after a conversation with my father, my personal engineering guru. Here are the reasons why:

• Isolation diaphragms are expensive.
• A sensor that can tolerate inert liquids is much more expensive than one that is made only for inert gasses.
• Thermal expansion and contraction of the hydraulic fluid would cause considerable error, likely greater in magnitude than the required precision.
• The elasticity of the diaphragm and the tubing becomes a source of error with an isolated hydraulic connection, also likely greater in magnitude than the required precision.

While theoretically advantageous, isolation diaphragms are not feasible for low pressure, low cost applications.

## Next Installment

In my next post, I’ll discuss the components of the system, pertinent specifications, and plumbing.

# Heat Exchange Snobbery

The recipe for beer is pretty simple. One important step is boiling the wort, the sweet mixture that yeast will ferment into beer. Boiling sanitizes the beer so that yeast can work its magic, but not before the wort is cooled back down or the yeast meets the same quick, steamy end as its potential competitors. There are many ways to cool wort, but I recently upgraded my cooling technique to the optimum method: countercurrent heat exchange.

I previously used this immersion cooler. This is a good method in which a length of coiled tubing is placed into the wort. Cool water is pumped into one side and it comes out hot on the other, all the while cooling the wort. Despite the ease of execution of an immersion chiller, it’s limited. Initially, there is a large temperature difference between the wort and the cold water running through the chiller, and it works well. As the wort cools, the temperature difference between the wort and the water decreases, and the cooling is less effective. It takes more and more water to accomplish the same heat transfer. Countercurrent exchange doesn’t suffer this limitation, and this is why it’s a superior heat transfer method. How it avoids this limitation can be demonstrated by comparing the countercurrent configuration to the parallel configuration, which is somewhat similar to the immersion chiller method. Here’s a diagram showing both flow configurations:

Both involve a tube within a tube. The inner tube is usually made of thin metal so that the fluids can easily exchange heat across the metal. In the parallel configuration, hot wort is introduced at the same side as cold water. As the wort and water flow through the tube and exchange heat, they approach the same temperature you would get if you mixed the two in a bucket (ignoring the thermodynamic effects of mixing). In the countercurrent configuration, hot wort is introduced at one end and cold water is introduced on the other. This results in a very different temperature profile for each fluid along its path. Check out this diagram from Engineering Toolbox:

The result is that the wort is continuously cooled throughout its path while the cold water is continuously heated throughout its path. To phrase this more practically, you more fully utilize the cooling ability of all the water you use. Unlike the immersion chiller that only heats the first amount of water to near the starting wort temperature, all the water used in a countercurrent heat exchanger will be heated near the starting wort temperature. While countercurrent heat exchange is limited by the surface area and the flow rates, so are other methods. For any exchange method, too small a surface area or too high a flow rate and the fluids don’t have a chance to exchange enough energy. Countercurrent exchange is not equilibrium limited, and this is the difference.

Countercurrent exchange isn’t just an engineering technique. It evolved biologically and is evident in many homeostasic mechanisms. My favorite is the kidney, an analogous example of countercurrent mass transfer. Remember those tubules and the sodium gradient? That’s countercurrent exchange, nature’s way. There are heat exchange examples in nature as well.

Now that countercurrent exchange is justified, it should be implemented. Even though there are commercially available, reasonably priced countercurrent plate chillers designed especially for home brewers, that’s too easy! Here’s the tube-in-a-tube heat exchanger I built:

The design is simple. The outer ports connect to a 3/8″ stainless tubing coil that, with great lubrication, forcefulness, and bleeding, I managed to shove inside a length of garden hose. Wort is pumped through the stainless tubing in one direction while tap water flows through the hose and around the outside of the tubing in the other direction. 3/8″ compression fittings seal the internal path from the external path. 1/4″ compression fittings house in-line DS18B20 temperature probes that I’ll eventually use to monitor and optimize heat exchange. As always, cam locks attach the hoses attachments. I fastened the coil with rope and hung the exchanger in the roof of my cabinet so that cooled wort can go directly to the conical fementer. Here is the entire system in a test:

For the test, I brought the whole system to 80 degrees Celsius and let the wort out of the exchanger flow across my kettle thermometer. I had to cut the flow rate down, but I was able to get the outlet temperature down to almost 20 degrees Celsius in one pass.

This will be my last modification to the system until after boards, but I should have a few brew posts. Right now I’m growing a yeast culture for a 10 gallon batch of Dubbel, which will hopefully sate everyone for a little while. My friends sure can put away some home brew.