Humidity Studies

I’m delighted to say that this article was publish in Roast Magazine in their January 2019 issue. I’ve embedded the article for those interested. My original article is also available for reading in the blog post below. Thanks everyone for your kind words and notes. I’m continuing to work on this theory and a new paper will follow soon…


In this study a coffee roaster was modified in an attempt to measure the mass of water leaving the coffee during a roast. Senors added include, capacitive humidity sensors, an anemometer and thermistors. This was to measure the water content, volumetric flowrate of air and temperature of exhaust gases. A tray of water was placed in the coffee roaster and readings were taken. A batch of coffee was then also roasted to compare the readings observed. The relative concentration of water in the gas stream was calculated using the aforementioned inputs. The integral of this calculation with respect to time was then used to determine the total mass of water that had left the coffee roaster. Results showed a median difference between mass lost calculated compared to actual measured mass loss of 9 grams over 30 roasts. It is therefore concluded that this method of online measurement has the potential to be a viable method calculating mass loss to be used during coffee roasting. This means the relative mass loss during the roast will be known. A coffee roaster will be better able to make decisions about when to release the coffee from the drum of the roaster, in order to achieve specific mass loss targets rather than having to make guesses based on experience. This would move coffee roasting forward towards a fully autonomous roasting system.


Coffee roasting is an interesting and complex set of chemical process that turns a small, dense seed into something beautiful. The Swiss Federal Institute of Technology reports over 800 different volatiles existing in roasted coffee (Rao, 2014). This same amount is also quoted in other texts (Racineux & Tran, 2016). However, this number includes just the identified compounds. There could be many more to consider (Illy & Viani, 2004). With so many complex interactions it can be easy to get lost in detail. This study will only focus on one compound in the gas stream leaving the roaster. This study will focus on water.

Water is an essential component of all organic processes and this is true of the coffee plant. Water sustains the plant while it is growing. It is then driven off during the drying process after the fruit is picked. Water is then further removed throughout roasting. Water is then used as a solvent to extract the coffee during percolation before being consumed. Throughout all these process there are specific windows of water content that must be attained to achieve a palatable product. Green coffee will change during the roasting process from being approximately 10-12% water by mass, to 2-3% (Illy & Viani, 2004). By comparison with other compounds within the coffee, water content undergoes the biggest change (by mass) when looking at the final composition of the coffee (Rao, 2014). This is to say, that most mass losses during roasting are caused by water being driven out of the coffee. Coffee roasting can therefore be modelled as a drying unit operation. 

The latent energy of water in the coffee is a key point to discuss regarding coffee roasting. This is because latent energy drastically changes the energy balance of the coffee roaster. The latent energy is defined as the amount of energy required for a substance to undergo a phase transition. To simplify that terminology this is referring to the heat that is available to the coffee to turn the water inside the bean into steam. So for liquid water inside the bean, it must have enough energy supplied to not only come up to its boiling point but enough energy to transition into steam before increasing in temperature. This is significant because the properties of steam when compared to liquid water are drastically different. Water’s capacity to hold heat, or the amount of energy required to raise the temperature of a given mass of water decreases in this phase transition. Water in the coffee acts almost like a heat sink, soaking up energy, refusing to transmit this heat further into the bean. A large temperature gradient occurs when latent heats are taken into consideration when this process is modeled (Illy & Viani, 2004). The difference between the outside of the bean and the inside of the bean is dramatic because liquid water inside the coffee is soaking up this energy, refusing to increase in temperature. Inside the bean during roasting there is a tug of war going on between water at the hot gases outside the bean. Heat transfer occurs from the hot roast on one side, and the water sinking heat on the other. The bean’s internal pressure builds as this water is converted into steam. Eventually the internal pressure becomes too much as steam is generated and overcomes the internal cell structure of the bean. This fractures the coffee and causes a snapping sound. Coffee roasters refer this point in the roast as ‘first crack’.

This first crack usually signals to the operator that the coffee is undergoing a critical period of transformation and it is time to start monitoring the roaster. This is usually done by looking at the temperature of the bean mass and modulating airflow and heat input into the machine. The water inside the bean has been largely converted to steam due to a changed thermal conductivity of the coffee. This will cause the temperature to change much more readily. This can result in a runaway state where the coffee increases in temperature much more rapidly than desired through this stage. This runaway state can ruin a batch by burning it, or causing the beans to reach a much higher temperature than intended. Some other coffees can have the opposite problem, where water flashing out of the beans condenses inside the roaster, causing the temperature to plummet and potentially 'stalling' the roast. This is another undesriable state which can ruin a batch. 

It would be assumed that water exiting the roaster would be monitored given water’s importance in the coffee roasting process. However there are no coffee roasters on the market that track the humidity levels of flue gas evolved during the roasting process. There have been experiments conducted where flue gas has been condensed and analysed (Dutra, Oliveira, Franca, Ferraz, & Afonso, 2001). But for online monitoring this was deemed to be impractical. It is hypothesised that a capacitive relative humidity probe may be used instead to monitor water throughout the coffee roast. The total amount of water leaving the system could be calculated by multiplying the water concentration by the volumetric flowrate of air, subtracting away background water content and integrating this value over the roast. A coffee roaster could monitor spikes in humidity to determine first crack and also estimate the final development of the coffee using this calculations rather than waiting for audible snaps . This mass loss could also be estimated without having to drop of the coffee out of the machine and measure the batch’s final mass.


  1. Coffee Roaster – The model of coffee roaster was a North Coffee TJ-067 now being sold by Mill City Roasters

  2. Temperature probes – Custom made, 3mm ungrounded probes were used

  3. Data bridge – Custom built circuitry was used to analyse the roaster’s internal temperatures and control air intake and heat input.

  4. Roasting Software – Custom software was written based in Microsoft Excel to monitor the data from the Roaster

  5. Humidity Probe – Novus RHT humidity sensor

  6. Airspeed Sensor – Custom built anemometer to measure airspeed.

The setup of the roaster is explained using the following P&ID. This type of diagram shows the process and how the instrumentation connects to it. It is not supposed to be a literal representation of the unit, just a diagram that shows how the connections work.

Figure 1 - Roaster P&ID

Figure 1 - Roaster P&ID

Coffee enters into the Drum via the hopper. It is mixed inside the drum until roasted. It is then dumped out of the roaster into a cooling pan. Everything else in the diagram shows how heat is added and removed from the process. An exhaust fan is used to draw ambient air from the bottom of the roaster, past the heating element, through the drum then through a cyclone separator and to the exhaust stack. The speed of this fan can be varied automatically by the roasting software to change the airflow as required. The fan causes air to enter the roaster below the 3kW element. The element is heating the roaster and its power level can be varied automatically by the roasting software. Three thermocouples relay temperature information back to the main data bridge. The hot roasting gases exit the cyclone after most particulates have separated and the hot gases cool to approximately 70°C. Halfway up the main exhaust stack there is a humidity sensor that measures temperature and relative humidity at this point. Beyond this sensor another sensor is used to measure four variables. These are airspeed, stack temperature, ambient humidity and ambient temperature. Ultimately the whole process is controlled from a main computer connected wirelessly to the roaster. 

The control thesis for this machine is to use modulated airflow and heat input to change the temperature inside the roaster. Exhaust gases are monitored for their flowrate, temperature and humidity to determine the amount of water exiting the stack. This is compared to the ambient conditions which determine the background water concentration. The mass of water leaving the roaster can be calculated because the background water content is known as well as the airflow and the stack conditions.


On advice from Gods Honest Truth Coffee Roasters, a baseline for the experiment needed to be obtained. The coffee roaster was left to idle at 65% element duty and 42% motor speed. The goal was to achieve equilibrium such that without changing the motor or element settings the temperature and roaster conditions would be stable. Equilibrium was achieved when the relative humidity in the stack and temperature in the stack would remain relatively constant. The ambient conditions observed at the roastery on the day of the experiment were;

Temperature = 17.8°C

Relative humidity = 75%. 

At equilibrium the stack temperature was observed.

Temperature = 74°C

Relative Humidity = 5.3%.

The next step involved converting relative humidity to absolute humidity to check the readings against one another. The following numerical methods were obtained (Vaisala, 2013), Using equations (2) and (3) as per the design document the Saturation vapour pressure was obtained. The water vapour pressure was then calculated using equation (1). Finally, the absolute humidity was calculated using equation (17).

Using ambient conditions the water content was calculated as 11.4 g/m³

Using stack conditions water content was calculated as 12.2 g/m³

There is a difference in these measurements of 7% which was considered to be negligible.

The tray containing 275g of water was then added at the 13 minute mark (approx.). The results were recorded until the water was depleted from the tray.

The roaster was allowed to reach equilibrium again.

1029g of the Sumatran 'Wanita Gayo' was added to the roaster and data was collected over a 12 minute roast.


Figure 2 - Water Tray Test (control)

Figure 2 - Water Tray Test (control)

The graph above shows a section of background data between 0 and 13 minutes where the roaster is left to best achieve equilibrium. The relative humidity of the stack gases show some temperature variation throughout the whole test, however this is only between 73°C and 77°C. This temperature, although variable within this range, is constant throughout the test.

The relative humidity shows a sharp increase when the water is added. This reaches relatively stable conditions at approximately 17.5% RH at 74°C. Using the same calculations as above, this would indicate 42g/m^3 of water in the stack. This continues until the water is completely driven off at which point the roaster returned to humidity levels that were observed at equilibrium. 

Figure 3 - The integral of the humidity curve

Figure 3 - The integral of the humidity curve

From the chart above the sections where the roaster was at equilibrium was removed. A 5th order polynomial curve was fit to RH(t). The R2 value of this curve was 0.98 which indicates a reasonable fit for the curve. The integral of this curve was then calculated between the end of the experiment and the beginning. This shows the cumulative water content increasing throughout the test. The max value of this curve was 268g comparative to an expected value of 275g.

From the charts above it can be shown that the temperature and humidity sensor in the stack conveys the overall trend of water coming out of the roast well. 

For the next test 1029g of the Sumatran  'Wanita Gayo' was added to the roaster. The roast took just over 12 minutes to complete the roast. Relative humidity and stack temperature was recorded throughout the roast. The relative humidity data was converted to absolute humidity and the background water content was subtracted from this number. The following curve was obtained. 

Figure 4 - Humidity Data, Wanita Gayo, Red Bourbon, Sumatra

Figure 4 - Humidity Data, Wanita Gayo, Red Bourbon, Sumatra

This graph shows a drying curve, much like the control, slowly ramping to equilibrium. However the curve in contrast to the control is not flat throughout the roast. It slowly keeps increasing throughout the roast. It is important to note the ramp in water content in the stack leading into first crack. As first crack occurs a large spike in humidity is observed. A regression curve fit to the Total Water content could not be fit with good tolerance (the best being a 6th order polynomial at R²=0.88), so numerical integration using the trapazoid method was used. Between the start of roasting and the drop at the end the result was 157.9. The mass loss of the sample was 158.7g, with a development of 15.4%.


The DIY coffee guy has a great article on his website. In his article he quotes a statistician as saying,

Essentially, all models are wrong, but some are useful. - George E.P. Box

I think that's important to keep in mind when looking at these results.

I'm also cognisant of Cunningham’s law which says that in order to find the right answer on the internet it is best not to ask the right question, but to post the wrong answer. With that in mind, I'm going to discuss the above results from a brief study into humidity during roasting. 

Figuire 5 - Absolute water content of gas stream and associated integral

Figuire 5 - Absolute water content of gas stream and associated integral

Shown above is the water content from a roast curve and its associated drying curve. I've changed the direction of the curve to better suit how most drying curves appear (as a total amount of water decreasing, rather than water content increasing).  Similar curves to this one were obtained in online flue gas monitoring experiments. (Dutra, 2012). This is to say water content declining steadily throughout the roast. This is also similar to what Mill City Roasters have said in discussion and I think they are correct. In fact when looking at drying operations in general this same behaviour is observed. 

(McCabe, W.L., & Harriot, 2001) proposes an increase to a maximum drying rate, which is the rate at which water can move into the hot air stream. There is a maximum rate at which it can do this based on the material you are working with. Looking at coffee specifically, coffee is observed not being able to efficiently transfer heat throughout the structure of the bean due to the latent heat of water inside the bean. (Illy & Viani, 2004). This means that as the bean heats up throughout roasting, the heat does not transfer as effectively in the begginging of the the roast comparative to the end of the roast.The latent heat is responsible for sinking away heat from the outside of the bean. This culminates in an endothermic flash . (Illy & Viani, 2004), though this has not been observed by the thermocouples in this experiment . At first crack the water has enough energy to be fully vapourised. It is here that roasters will see exothermic behaviour in the roast as this pent up energy is released. Run away behaviour may also be observed if the energy supply to the roast is too great at this point . (Illy & Viani, 2004)

This is consistent with phenomena known as 'Case Hardening'. This is noted as being particularly common in food processing (McCabe, W.L., & Harriot, 2001). By monitoring humidity data, the sudden spike in water content is indicative of this energy being overcome and the onset of first crack being imminent. The total water loss throughout the roast can theoretically also be predicted by looking at this drying rate. This would mean that if a coffee roaster had desired water content in mind for a specific product, and the water content of green beans was also known, then by monitoring online humidity data they may be able to use this model to predict when to drop the coffee from the machine and begin cooling the batch. This could also be used to minimise give-away. This would be commercially useful because roasted coffee is sold on a per kilogram basis. There is little sense in driving off water that does not need to be driven off. It costs money in fuel to heat the roaster and will ultimately mean less of a return for the coffee roaster overall when the product is sold. 

Conclusions and Implications

This has been a cursory look at online humidity measurement in coffee roasting. There are numerous holes in the overall picture that need to be filled in. First of all, this study was conducted on an electric roaster. A gas roaster may have differing results as a main product of combustion is water vapour. This may skew the results for a roaster that uses combustion (as most do) to roast coffee. 

Second, as the DIY Coffee Guy mentioned, the roasting process may cause drafts or other issues, effectively sucking more outside air (hence water) into the roaster. The variability of airflow will cause issues with online measurement of water content unless it is accounted for.

It could be a co-incidence that the integral of these two tests happens to match the expected water content of the tests. This has yet to be peer reviewed and may just be conjecture. In application the online monitoring has shown promising results. Over 30 roasts a median difference of 9.5 grams was observed between the expected mass loss and the humidity sensors reported values. The interquartile range of these 30 studies was 37.5g the outlying values were -43.3g at a minimum difference and 48.5g at maximum. One thing to take into account is sensor hysteresis. The sensor can take a while to reach a new humidity value between due to very hot dry air and a sudden drop in temperature . This sensor error can be subtracted away with reasonable reliability however. So far the research seems to indicate a useful, albeit most likely incomplete model. 

There is benefit in understanding what the relative humidity of the exhaust stream means in the context of coffee roasting. This would allow coffee roasters in different climates to take control of their drying rates and achieve overall desired water content of their product. This can mean fewer products ultimately ending up in the atmosphere, rather than in the customer’s hands as previously stated. It would also mean a more consistent product for the roaster. Online humidity measurement could also inform control decisions for the roaster. It could also help when working with older beans when the moisture content has dropped.

You cannot control what you cannot measure. I hope that coffee roasters can better control the water content of their product by measuring humidity throughout the roast.


I'd like to thank the DIY Coffee Guy, Mill City Roasters, God's Honest Truth Coffee Roasters and Gary Davison for their contributions with respect to this article.


Dutra, E., Oliveira, L., Franca, A., Ferraz, V., & Afonso, R. (2001). A preliminary study on the feasibility of using composition of coffee roasting exhaust gas for the determination of the degree of roast. Journal of Food Engineering, 241–246.

Illy, A., & Viani, R. (2004). Espresso Coffee - The Science of Quality. Elsevier.

McCabe, W.L., S., & Harriot, P. (2001). Unit Operations of Chemical Engineering. 6th Edition. Singapore : McGraw-Hill International Edition.

Racineux, S., & Tran, C.-L. (2016). Le café c'est pas sorcier.

Rao, S. (2014). The Coffee Roaster's Companion .

Vaisala. (2013). Humidity Conversion Formulas. Retrieved from Vaisala: