📜 ⬆️ ⬇️

How we stalled and calibrated the coffee machine on the spectrophotometer



One day, in the middle of the working day, we suddenly realized that we could no longer live like this. Soul required to do something meaningless and merciless in the name of science. And we decided to calibrate the coffee machine. Normal people poke at the default button and drink everything that comes out of the coffee maker. Slightly more advanced for this open instruction and carefully follow it. Maybe they read the recommendations of the roaster, if of course these are not rancid noname grains that have been in a nameless warehouse for a couple of years. We can be attributed to normal with a big stretch, so we decided to go our own way. In short, under the light caffeine intoxication from the seventh cup of espresso, we decided to use the whole possible laboratory arsenal to get a reference drink.

Welcome to the world of madness, ultracentrifuges, coffee spectrophotometry in special tablets and a small amount of python, pandas and seaborn to visualize all this disgrace.

Correct extraction


First, we need to understand what we want to get. The main point of setting the coffee maker correctly is to get a balanced extraction profile. In this case, no less than half of the success depends on the correct grain, which was roasted in compliance with all the details of the thermal profile. Horseradish grain steamers may have irregular roasts or other defects. But even the perfect coffee can be turned into a terrible swill, if you cook it wrong.
')
The optimum temperature for the classical method of making coffee is 90-95 ° C. The number of grains should be about 10-20 g / 100 ml of water. It should also be borne in mind that the extraction process is uneven, from lighter and volatile to less soluble components. The trouble is that when we go beyond the optimal values ​​of water temperature, the degree of compression of the coffee pill (for espresso), the degree of grinding, the ratio of coffee to water or time, we may not have time to “pull out” everything we need from the grain. Or vice versa to capture an excessive amount of heavy fractions, spoiling the taste and balance of the drink. In particular, during hyper-extraction, an excess amount of chlorogenic acids gets into the cup, which causes the coffee to overly bitter and shift the balance of taste to the acidic side. With insufficient extraction will be something watery and sad to taste.


Quinic and hydroxycinnamic acids, the structural basis of chlorogenic acids

Preparing the experiment


In an automatic coffee machine, only two parameters are available for us to adjust: grinding and compression. The degree of grinding is determined by the mechanical rotation of the regulator, which sets the gap between the millstones. The compression of the freshly ground coffee tablet is preset and has 5 conditional levels of compression. Our task is to select the optimal parameters at which the concentration and balance of solutes will give an ideal taste.

The coffee itself for testing was sent to us for inhuman experiments from Torrefacto, for which many thanks to them. Two main categories: B and C (dark and light roast in their classification).

image
Honduras San Marcos ( source )

Dark Roast We have somehow switched to the middle one, but for comparison this variety is a very worthy option. Especially good with milk, but for our tasks we will prepare espresso from it. The taste is quite simple, without subtle nuances, but very rich.

image
Brazil Ipanema Dulce ( source )

Just awesome aromatic variety, with a very balanced taste and sweet fruit sourness. The grain itself contains a large amount of carbohydrates, which gives a slight sweetness.

For each grade and each of the five compression levels of the coffee pill, 8 sample cups are selected. At the same time, laboratory staff spit or rejoice at the result. Blindly, naturally. Choose the best taste samples, then to compare with the objective indicators of hardware research.

Deep freeze


We felt sorry for ourselves and we did not drink 80 cups of coffee in one day. Therefore, the samples were labeled and thrown into the freezer. Honey such a freezer, with a temperature of about -90 degrees. Eats 4 kilowatts, but as a result inside even carbon dioxide falls out in the form of a snowball on the walls. Perfect option.




When all the samples are ready, we take them out of the freezer and put them in the orbital shaker. Yes, I also like how it sounds. Almost like a planetary orbital laser, but it's just a shaker. We are waiting for complete defrosting of samples and at the same time mix everything well.

Spill in tubes and centrifuge




First you need to very carefully examine the samples. Without this miracle will not happen)





From the big test tubes we take away a coffee with a micropipette and we pour out on small test tubes for centrifuging. Label each tube with a number and enter it in a separate journal, so as not to confuse the samples.





The tubes are placed in a centrifuge strictly symmetrical to maintain balance. At high speeds of rotation it is critical. After centrifugation, we get a clear aqueous solution of what was extracted from the coffee, and all the microparticles that have passed through the filter of the coffee machine will remain in the form of sediment.

Spectrophotometry




Again, take a micropipette and dispense accurate doses of the samples into individual wells of a special 48-well plate.



As a result, the patterns are beautifully distributed in shades. From top to bottom, there is an increase in compression ratio and completeness of extraction.


I'm my mom operator


The plates are loaded into a FilterMax spectrophotometer from Molecular Devices. There are a whole bunch of sample study modes, various filter options, laser sources of radiation, and the like. We thought for a long time that it would make sense to measure such a strange thing on coffee and decided that measuring the same fluorescence in the ultraviolet is pretty pointless. It was decided to estimate the degree of absorption of laser radiation at a wavelength of 450 nm. This wavelength is blue laser. In principle, it is quite logical. Saturated coffee solution has a reddish tint and should absorb well the blue part of the spectrum.

As a result, we obtained absorption tables for all our samples. However, it would be nice to visualize all this. Since I most often use python and pandas with seaborn in my work, we will also save the data in the most convenient form for loading into pandas.

The degree of absorption in percent in csv format.
Roast Compression Absorbance
medium, level 1.21.31
medium, level 1,20.57
medium, level 1,24.49
medium, level 1,26.95
medium, level 1,20.49
medium, level 1,20.06
medium, level 1,21.22
medium, level 1,23.32
medium, level 2,28.09
medium, level 2,28.27
medium, level 2,23.13
medium, level 2,25.72
medium, level 2,26.75
medium, level 2,26.05
medium, level 2,26.92
medium, level 2,25.92
medium, level 3,32.88
medium, level 3.32.23
medium, level 3,33.13
medium, level 3,28.72
medium, level 3,28.82
medium, level 3,31.49
medium, level 3.32.31
medium, level 3,33.81
medium, level 4,38.68
medium, level 4,40.54
medium, level 4,39.34
medium, level 4,43.3
medium, level 4.41.48
medium, level 4,42.26
medium, level 4.42.73
medium, level 4,42.35
medium, level 5,57.62
medium, level 5,70.62
medium, level 5,70.74
medium, level 5,57.94
medium, level 5,77.62
medium, level 5,76.64
medium, level 5.69.12
medium, level 5,66.39
dark, level 1,27.54
dark, level 1,26.8
dark, level 1,30.72
dark, level 1,33.18
dark, level 1,26.72
dark, level 1,26.29
dark, level 1,27.45
dark, level 1,29.55
dark, level 2,34.32
dark, level 2,34.5
dark, level 2,29.36
dark, level 2,31.95
dark, level 2,32.98
dark, level 2,32.28
dark, level 2,33.15
dark, level 2,32.15
dark, level 3,39.11
dark, level 3,38.46
dark, level 3,39.36
dark, level 3,34.95
dark, level 3,35.05
dark, level 3,37.72
dark, level 3,38.54
dark, level 3,40.04
dark, level 4,44.91
dark, level 4,46.77
dark, level 4,45.57
dark, level 4,49.53
dark, level 4,47.71
dark, level 4,48.49
dark, level 4,48.96
dark, level 4,48.58
dark, level 5,63.85
dark, level 5,76.85
dark, level 5,76.97
dark, level 5.64.17
dark, level 5,83.85
dark, level 5,82.87
dark, level 5,75.35
dark, level 5,72.62

Draw graphics with python, pandas and seaborn


To plot, we first import our csv as a pandas dataframe. After that, using the wonderful seaborn library and the barplot function, we will construct a graph grouped by degree of roasting. For greater contrast, use the palette "Paired", it is very good when comparing different groups. By the way, as you remember, we ranked samples by taste. The coffee tasters of us are so-so, but surprisingly a consensus has been reached. The optimal taste of the drink was in the case when the degree of absorption at a length of 450 nm was in the region of 32%. Draw the corresponding line on the chart using plt.axhline.


Python code
import matplotlib.pyplot as plt import pandas as pd import seaborn as sns df = pd.read_csv("data.csv") sns.set() sns.set_style("whitegrid") sns.set_context("talk") ax = sns.barplot(x="Compression", y="Absorbance", hue="Roast", data=df, palette="Paired") ax.set(ylim=(0, 100), xlabel='Compression level', ylabel='Absorbance at 450 nm, %') plt.axhline(32, alpha=0.4, color='black', linestyle='dashed', label='Optimal concentration') plt.legend(loc='upper left') plt.savefig("plot.png", dpi=300) plt.show() 


The graph clearly shows that the optimal compression ratio for dark roast coffee is second, and third for average. In addition to this delightful conclusion from our experiment, we see that with maximum compression, the spread in the concentration of solutes between the individual espresso cups increases. Whether the machine does not provide repeatability, or with such compression, factors such as the length of a randomly broken channel in a coffee tablet through which hot water flows begin to significantly influence.

To make it finally beautiful, let's build a graph of the deviation of our parameter from the optimum. To do this, from the Absorbance column in our dataframe we subtract 32 (our optimum).

 # Subtract optimal value df['Absorbance'] = df['Absorbance'] - 32 


Python code
 import matplotlib.pyplot as plt import pandas as pd import seaborn as sns df = pd.read_csv("data.csv") # Subtract optimal value df['Absorbance'] = df['Absorbance'] - 32 sns.set() sns.set_style("whitegrid") sns.set_context("talk") ax = sns.barplot(x="Compression", y="Absorbance", hue="Roast", data=df, palette="Paired") ax.set(xlabel='Compression level', ylabel='Deviation from optimal concentration') plt.legend(loc='upper left') plt.savefig("plot_diverging.png", dpi=300) plt.show() 



Somehow, meaningless and mercilessly, you can get a cup of perfect espresso).

PS If I can find the time, there will be another post about high-speed ultrasonic extraction of ice coffee. There are samples, we will create strange further.

Source: https://habr.com/ru/post/331754/


All Articles