Roast Level Verification

After reviewing some documentation and literature surrounding coffee roast quantification, I settled on employing some form of NIR spectroscopy to take measurements of each batch of beans I roasted.

To do this, I purchased a SparkFun AS7263 Near Infrared (NIR) Spectral Sensor Breakout and constructed a simple prototype housing to ensure a dark testing environment and a consistent sensor-to-sample distance. The NIR sensor was connected to a SparkFun Qwiix Shield that was mounted on a SparkFun Redboard:

The device was controlled and programmed from the Arduino IDE via USB and active readings were taken from the serial monitor.

The data collection and testing procedure is as follows:

1. Fill sample cup with ground beans, leveling with a straight edge
2. Place sample cup inside of the testing cone
3. Apply slight downward pressure to testing cone to ensure that no external light reaches the sensor
4. Copy data from serial monitor to Excel or other system for storage
5. Empty sample cup and repeat for additional samples

Note: I would recommend taking 2 or 3 readings for each sample and averaging the results for improved accuracy.

After roasting multiple batches and testing them in this device, I plotted all of the data on Excel:

The differences between batches only appears in the longer wavelengths of light, so I plotted the highest wavelength values as a column chart:

At first glance, the data looks very messy, but there does appear to be enough variation between batches such that there might be a trend, but in order to investigate this further I plotted smaller sets of roasts where I used the same beans and roasted them all in the same evening to control for variables.

First, four batches of the same bean where I attempted to roast them to a consistent medium level:

And second, seven batches of the same bean where I roasted 2 batches as light, 2 as dark, and 3 as medium:

After replacing my popcorn popper roaster with a larger capacity flour sifter roaster, I carried out a NIR specificity experiment in order to determine how small of a change the sensor can detect in roasted beans. To do this, I roasted a 400g batch and pulled a sample every 20-30 seconds during the development phase until I reached a very dark roast well into second crack. I then ground and measured each sample twice, averaged the results, and plotted:

The prototype device was able to detect a difference between almost all of the roasts, with no major outliers or discrepancies, and in accordance with expectation that as the roast progressed the sensor reading would decrease.

By incorporating the temperature data during roasting, an area under the bean temp curve can be extracted to generally represent the total amount of heat applied to the beans throughout the roast, with the assumption that the more heat applied, the darker the roast, and that this would be in accordance with the NIR trends from above.

Here are two roast profiles with smoothing disabled and the area under the curve shaded as examples:

Plotting just the data from the batch of seven samples, we attain the following plot:

There appears to be an inverse relationship between the NIR reading and the roasting AUC, though the few overall data points makes this relationship difficult to rigorously prove.