Introduction
Recently, I’ve been comparing data from Salamibot with previous data collected using split shots. There are some systematic differences between the two data sets, so I’ve been looking closely at the two measurement procedures to identify the source of these differences.
One potential source of error is the conversion from Brix measurements, given by my refractometer, to total dissolved solids (TDS). In the past, I’ve always used this common conversion:
This is consistent with the result published by Omar Gómez, who collected data from a variety of online sources then used linear regression to produce the following conversion:
However, other formulas have been suggested—usually adding higher order terms to this expression, i.e., equations of the form:
In this post, I will measure the relationship between TDS and Brix for my own refractometer, compare this with the result reported by Gómez, and consider whether a model with more parameters would be justified.
As usual, I have uploaded my results and analysis to GitHub and Binder.
Equipment
The following equipment was used for this experiment:
- Eureka Mignon Specialita
- Normcore V4 tamper
- Gaggia Classic Pro
- A 0.01 g scale similar to this one
- A 0.001 g scale similar to this one
- A Brix refractometer
Method
For each trial, the following preparation was performed:
- Cut 10 4″ x 4″ foil squares from aluminum foil.
- Fold each square into a 2″ x 2″ x 1″ boat.
- Label each foil boat using a permanent marker.
- Dry the foil boats at 350 °F for 30 minutes.
- Cool the foil boats for 10 minutes then weigh.
- Check and adjust the zero of the Brix refractometer using distilled water.
The following image shows the foil squares before folding:
Here is a completed foil boat:
With preparation complete, a cup of espresso was prepared, then allowed to cool in a water bath until the beverage was near room temperature. The cup was placed on a 0.01 g scale and the scale tared so that it read 0.00 g. Here is a photo of the experimental setup:
Then the following steps were repeated for each sample:
- Stir espresso in the cup with a glass rod.
- Using a transfer pipette, put 3 drops of coffee on the Brix refractometer and make a measurement.
- Check the calibration of the milligram scale using a 10 g weight.
- Transfer 4 g of coffee to an empty foil boat, then record the total weight of coffee and boat.
- Add distilled water to the cup of espresso to bring the indicated weight back up to zero (i.e., the original beverage weight).
- Clean the refractometer, transfer pipette, and glass rod using distilled water.
For the current experiment, the above procedure was repeated for two different preparation methods, giving a total of 20 samples:
- 18 g of Rosso Two Wheel coffee was ground on the Eureka Mignon Specialita. The shot was pulled on the Gaggia Classic Pro. The resulting shot had a weight of 20 g. This low brew ratio was chosen to keep TDS in the resulting beverage high.
- A second shot was prepared using the same technique as above, but afterward the shot was passed through a Chemex paper filter.
The following photo shows how the beverage was filtered for the second shot:
And the prepared samples:
The prepared samples were placed on a cookie sheet then placed in an oven pre-heated to 100 °C (212 °F). The samples were re-weighed every 2 hours. When drying was complete, the samples had a cracked appearance, as shown below, and the weight of the samples had not changed appreciably since the previous weighing.
Results
The experiment was performed twice. The first time, drying was stopped after 6 hours. I was concerned that there was still moisture remaining in the dried samples, so I repeated the experiment and this time dried for 12 hours total. This gave four separate sets of data consisting of:
- Brix measurement for each sample boat
- Weight of empty sample boat
- Weight of liquid plus boat
- Weight of dried sample plus boat
We can calculate the weight of the liquid and dried sample by subtracting the weight of the empty sample boat. Then we calculate total solids (TS) for each sample as follows:
For the filtered samples, total solids is equal to total dissolved solids. However, for the unfiltered sample, we expect TS to be a little higher than TDS, since it includes some solids which are not actually dissolved—i.e., they are in suspension. If we plot TS vs. Brix for the two trials where we dried for 12 hours, we get the following:
Next, we do a simple linear regression with y-intercept set to zero. We set the y-intercept to zero since we know that TS must be equal to zero when Brix is zero—in this case, we’re measuring pure water. This gives the following result:
We can estimate the error in these values using Markov chain Monte Carlo methods. If we assume an error of 0.2% in the raw Brix measurements and 0.002 g in the raw weight measurements, we get the following result:
The weight of each sample was measured approximately every two hours during drying. We can visualize the progress of drying by plotting the calculated conversion factor from Brix to TS for each set of measurements:
We can see that drying was largely complete at measurement #4, but certainly complete at measurement #6.
Analysis
In the last plot above, the results for the two filtered experiments (shown in orange and red) are almost the same, but the results for the unfiltered experiments (shown in blue and green) are quite different. This could be due to a small difference in procedure.
In the first experiment (shown in green), I scooped the crema off the unfiltered sample, but in the second experiment (shown in blue) I did not. Since we see a higher TS for the second experiment, this suggests that a significant proportion of the suspended solids in the beverage is contained in the crema.
The remainder of this analysis will focus on the filtered results from experiment #2. We can compare these with the results obtained by Gómez:
Source | Total Dissolved Solids / Brix |
Experiment #2, filtered | 0.8520 ± 0.0074 |
Gómez | 0.8491 ± 0.0043 |
The agreement here is remarkable to me, and suggests two things.
First, this suggests that the relationship between refractive index and total dissolved solids does not depend on the specific coffee used. Since Gómez relied on data from several online sources, this hypothesis is also supported by the narrowness of the standard error in their result.
Second, it suggests that our cheap refractometer is obtaining results that are within experimental error of the results reported by Gómez—mostly using Atago handheld refractometers. This doesn’t mean an Atago refractometer wouldn’t be better—part of what you’re paying for with such an instrument is specified accuracy, so in principle you can depend on its results without the need for this kind of calibration. But it does suggest that with careful calibration, a cheap refractometer can be used to produce quantitative results.
Finally, I want to consider whether our model would be improved by adding additional parameters, e.g.:
There are criteria we can use to make this decision quantitatively—for example, the Akaike information criterion—but in this case I think we can approach the question intuitively. Let’s start by looking at the error bars for our data:
The error bars assume an error of 0.2% in the raw Brix measurements and 0.002 g in the raw weight measurements. We’ve drawn error bars in both axes, but only the horizontal bars are visible for the most part. This is because the error is dominated by errors in the Brix measurement—relatively speaking, the weight measurements are quite accurate.
We can see that the error bars easily include the best fit line. In a case like this, adding more parameters to the model would result in relatively small gains in the quality of the fit, but at the cost of encoding more information in the model itself—a condition known as overfitting.
We can also look for a pattern in the residuals relative to the linear model—i.e., the difference between each data point and the best fit line:
There is no obvious pattern here that suggests a model with more parameters would be a better fit—any pattern we do see isn’t much stronger than the random variations.
This situation might change if we could measure refractive index much more accurately. However, the analysis by Gómez suggests that even with a more accurate refractometer, results are dominated either by process error or by variation between coffees. It would be interesting to see measurements of TDS vs. refractive index using a very accurate refractometer, careful control of experimental procedure, and a variety of coffees, to establish how this relationship varies from coffee to coffee.
Conclusion
In this experiment, we measured the relationship between Brix and total dissolved solids for an inexpensive refractometer. For filtered samples, we found this relationship to be:
This is in agreement with results reported by Gómez, and also with the common conversion:
Further, we found that the results of this experiment do not justify a model with more parameters than the one given above.
I set out to perform this experiment in order to validate results obtained using my refractometer. Previously, I was concerned that there might be significant systematic error in the refractometer’s measurements, and I was considering purchasing a more expensive digital refractometer in order to eliminate this source of error.
However, the results obtained here suggest that measurements from the refractometer can be converted quite accurately to TDS using the equation given above. Of course, the results will only be accurate with careful attention to factors like beverage temperature, but this is true of any refractometer measurement.
Excellent work!
Hey Michael. Thank you very much for sharing your findings in regards to the relationship between Brix and TDS for coffee. We find it quite useful for future experiments that might relate staleness with solubles in the coffee. In this line, you mentioned that temperature of the measurement is key for accurate calculations of tds by using your formula, which temperature is that? And is it very sensible to variations? Thanks in advance for your reply
A refractometer measurement depends on two refractive indices: the refractive index of the liquid being tested; and the refractive index of the refractometer’s glass surface.
Refractometers will usually try to correct for ambient temperature either using a physical mechanism (in the case of an analog refractometer) or using a temperature sensor and table of corrections (in the case of a digital refractometer). However, the accuracy of this correction depends on the accuracy of the measurement (e.g., these corrections are based on a temperature measurement near the sample, but not at the interface with the sample). For this reason, it’s best to keep the refractometer at room temperature, and then get the temperature of the liquid as close as possible to room temperature before taking the measurement. This way, the refractometer, the liquid being tested, and the correction mechanism are all at the same temperature.
The actual change in refractive index with temperature will depend on the material, but I think we can get a sense of the change by looking at how this figure changes for solutions of sucrose. Belay et al.[1] have a nice chart (Figure 5) which shows refractive index vs. temperature for several different concentrations. Using the chart, we can see that a change in temperature from about 30 °C to about 70 °C gives a change in refractive index roughly equivalent to a 5% reduction in concentration. To keep this change within about 0.1%, we would need to keep the temperature within about 1 °C.
[1] https://www.hilarispublisher.com/open-access/concentration-wavelength-and-temperature-dependent-refractive-indexof-sugar-solutions-and-methods-of-determination-contents-of-sug-2469-410X-1000187.pdf
Got it. That’s very interesting really! Thanks for the reply. Also, do you have any idea if keeping the samples of coffee stored for a couple of days before measuring would affect the measurement in any way? For example, I brew coffee today at 4 pm and save the sample in the fridge, then do the measurement 48 hours later. Should it read the same refractive index as if I had done it right after brewing and letting it cool for a couple of minutes?
Thanks again,
Brewed coffee samples will be good for a day or two at room temperature but at some point will start to develop some kind of mold. Should be good in the fridge for a while longer. I have kept samples frozen for a month and seen no change in refractometer response.
This should be fine. If I were doing this, to minimize the loss of volatiles, I would put the sample tubes into a cold water bath as soon as the sample is taken.
On the other end of things, remember that a cold sample is just as bad as a hot one, in terms of shifting the refractive index. When you take the samples out of the fridge, you could put them into a room temperature water bath to bring them up to temperature a bit quicker.