Humidity sensor on exhaust - other gas sensors ? - Page 10

Discuss roast levels and profiles for espresso, equipment for roasting coffee.
Esteve (original poster)
Supporter ♡

#91: Post by Esteve (original poster) »

GDM528 wrote:In my service as a warning to others, I can report on how to save $80.
Thanks for the test! I had this in my cart for a while waiting to get some free time to resume the testing.


#92: Post by GDM528 »

Gas sensor testing:

Follow-on to the humidity sensor comparison, only this time for two different gas sensors:

Sensirion SGP30: - note: discontinued

Bosch BME688:

The Sensirion SGP30 is a discontinued product, but was originally chosen because it was the only sensor that had an integrated membrane to protect against roast exhaust debris. I think the air pump with the inline (cigarette) filter system eliminates the need for ruggedized sensors, so an updated version of the sensor system would likely switch to the SGP40/41.

The chart below shows the same linearly-declining RoR roast profile used on the prior runs. The focus this time, is on the gas readings. The SGP30 produces two results: total volatiles (TVOC), and "equivalent" CO2 (eCO2). The eCO2 curve is derived from the TVOC data, but does appear at times to show different landmarks in the curve compared to TVOC.

The BME688 is more complicated. It's based on the same sensor technology as the SGP30, so it too is measuring volatile compounds in the roast exhaust. However, the gas sensor in the BME688 is broadly programmable, which could theoretically enable the sensor to be 'tuned' for analyzing coffee roasting exhaust. This is a pretty deep rabbit hole, so for now I just tried two different sensor configurations to see what sort of effect it might have.

Quite a difference between the Sensirion and the Bosch sensors.

The Sensirion seems to do a pretty good job at showing the development phase of the roast. It also appears to anticipate first crack by about 45 seconds - that might be useful for some roasters. In many respects, the SGP30 is redundant to the moisture readings, which also indicate first crack and development progression.

I'm still trying to figure out what the deal is with the BME688 - the curve is practically featureless compared to the SGP30. Theoretically, I may be able to find the proper sensor configuration to more closely match the SGP30, but perhaps the BME688 is showing yet some other useful aspect of the gasses released that I just don't understand yet.

I want to be a fan of the BME688 for a couple reasons:
1) One stop shopping for all my sensor needs: pressure, temperature, humidity, and volatile gasses - all in a single chip package.
2) Deep complexity for data gathering and analysis: the programmable sensor combined with Bosch's analytical tools might enable other side uses for the gas sensor system. For example, Bosch has a demonstration of how the BME688 can 'smell' the difference between light and dark roasted coffee - of course, I can just look at the coffee and see the difference ;)

Given my SGP30 is a sunk cost, I'll keep gathering data with it to benchmark against the BME688. I look forward to discovering what nuances the BME688 gas detection might offer.

Footnote for anyone acquiring the BME688:
The Adafruit CircuitPython BME68x software driver has a 'situation' that forces the sensor to take four seconds between readings. Look in the driver file for "if dur < 0xFC0:" and replace with "if dur > 0xFC0:".


#93: Post by GDM528 »

Further testing of the BME688 temperature/pressure/humidity/gas sensor.

The BME has a programmable gas sensing system... so, I programmed it. Looking to see if the BME688 can get closer to matching the readouts from the SGP30 sensor, which is largely hard-coded to be generally useful right out of the box.

I found a range of settings for the BME688 that sorta bracket the SGP30. The chart below shows the results comparing the SGP30's eCO2 readout with three different settings for the BME688. Note that I normalized all the gas readout curves on the Y-axis, so their vertical scale is 'whatever'. It's just numbers, and my primary interest is in the shape and timing of the curves, hence pinning their min/max values.

So I can lay the BME688 response on top of the SGP30's eCO2 curve - except for an interesting 'hump' in the eCO2 curve starting at first crack. Is the hump real? The gas sensors are very sensitive to humidity, which is changing pretty significantly around that same timeframe. The SGP30 has a humidity correction capability, which I implement, but it may not deal well with rapidly-changing humidity. That same humidity correction is automagically built into the BME688, so maybe it's doing a better job of humidity compensation. On the other hand, maybe there really is something dramatic that happens to gas output right at first crack, and the SGP30 is picking it up...

And for fun, here's the RoR curves for same data:

This shows how the peak in the BME688 gas sensor readout can be time-adjusted. Given all the other metrics showing when first-crack is reached, it might be useful if the gas readout could spot yet some other landmarks in the roast. It appears the BME688 can 'anticipate' first crack, for this particular roasting profile, by a full minute. I myself have pondered what might be happening when the BT is above the optimal range for caramelization but not quite at first crack - the BME688 may be able to mark that zone as a roasting metric.

A bit of a tangent but had to point out the clear slope changes in the BT thermocouple readings, at what I'm guessing might be 'dry-end' and again right at first crack. With all this kit I've no excuse for knowing when first crack happens ;)

I'd also like to point out that the curve I've marked at "BME688 300C/1s" is the same configuration I used in post #92 - but that curve was distinctly different... I think root cause is the greens. Post #92 was a Guatemalan and this latest run uses a Mexican green. So these gas curves are reflecting the greens used - that seems like that could be really useful - once it's understood.

I've run over a dozen batches with the gas sensors sniffing away, and so far none of them have had anything to say about early phases of the roast: drying and yellowing. Curious, given how readily my nose can pick up those early roasting aromas, yet the sensors are 'smell blind'. Latter phase aromas are far less prominent to my nose - yet that's when the sensors are going nuts. Which brings up an intriguing possibility with the BME688 sensor: the sensor configuration can be changed on a per-reading basis. That means the sensor's reaction to the exhaust gas can be dynamically adjusted in real time during the roast. So, I'm hoping to find some sensor settings that can track the roast from start to finish.

And speaking of start to finish, these sensors are picking up similar readings before and after the roast. If I stick the sampling tube into a bag of greens or a bag of roasted coffee, I get readings as strong and as differentiated as when I'm roasting.


#94: Post by GDM528 »

I've taken all the components in the photo from post #79 earlier in this thread, and integrated it onto my IKAWA Home. Note the key word is "onto" - not "into", meaning the only modification to the factory roaster is to unscrew the four rubber feet on the base, which can be restored in the event of a warranty claim. I made a point of not doing anything that would void the warranty. This sits passively outside the roaster and gathers the same data as the Pro100x, plus VOCs.

Using IKAWA's nomenclature, I think this would be an IKAWA Home100xplus. Less than $100 in materials plus a healthy dose of maker skillz:

I simply extended IKAWA's industrial design at the base of the roaster with a 20mm riser ring that houses the gas sensing system. There's a subtle blue glow peeking out from underneath the riser, that signals the controller is connected to my Wi-Fi network. I can monitor the data as it's being collected, from the comfort of my desktop PC and a web browser. Currently I wirelessly download the data through the browser, but longer term I aspire to have the roaster simply email the roasting logs as they're completed.

On the backside is the 'sniffer' tube and thermocouple probe. The tube simply inserts far enough into the exhaust port such that the only air it samples is the exhaust during the roast. I also happen to use some (optional) copper tubing to allow me to steer the exhaust more conveniently into my stovetop range hood.

The thermocouple wire was stripped from a stock thermocouple probe and laminated into some kapton tape to make it very flat so it can slip under the glass cover without interrupting the seal. At some point I'll replace this particular thermocouple wire with a commercially available alternative that won't require nearly as much modification and craftwork.

The sniffer tube brace halfway up the side of the machine is still a work in progress and not absolutely necessary, but it does keep the tube from getting caught on surrounding objects. The tube is held in the exhaust port with a simple paper clip that happens to be perfectly sized for the diameter of the tubing. At the base, the tubing is press-fit into a receptacle that also houses a replaceable cigarette filter - that filter is critical for keeping everything else downstream from getting fouled up from the roasting byproducts.

Also built into the riser ring is a USB power input receptacle. The receptacle was purchased commercially online and hacked down to fit nicely inside the riser. The power is switched on by plugging in power from a USB power adapter.

This next photo shows the interior of the riser. There's a 3D-printed mesh cover that was removed for the photo. Inside the riser is a platform (laser cut MDF) that holds the various components in place. The pump is suspended in place with fabric padding to reduce pump noise:

The filtered roasting exhaust air is pulled through the silicone tubing into a micropump that I sourced from Amazon. I suspect the pump may have been originally intended for blood pressure cuffs, but in this application, it does an awesome job of overcoming the airflow resistance from the narrow tubing and the inline debris filter.

The output of the micro-pump is routed into "gasshats" I designed to fit over the sensor boards I obtained from Sparkfun and Adafruit. They're designed to stack in a line as shown, and there's room for additional sensors if needed. The gasshats are resin (SLA) printed, but a good filament printer with a small nozzle could also suffice.

There's also a thermocouple reader bolted next to the USB power input, for measuring BT. The in-chamber BT readings have become instrumental in helping me deduce when the roast begins and ends, independently of any signal from the roaster or the app. The BT drops very clearly and abruptly at the end of the roast, allowing me to then work backwards to figure out when the roast started and synchronize with the gas readings.

The microcontroller is in a 3D printed housing, held together with steel screws that magnetically attach to the base plate. During operation, the controller can simply stay in place, or be slid forward until it drops free so it can be set outside the base:

Long term goal is to program the system to automatically run in the background, so I can use the roaster as I normally do, without having to set up and interact with anything else.

Who cares? I'm planning to post the CAD data on GrabCAD, but I went kinda nuts with FDM printing, SLA printing, and laser cutting. So, if there is any interest, I could tweak the design so it can be entirely FDM printed - which I suspect many coffee drinkers have that type of printer. However, some parts are much nicer when SLA printed, and there are many online consumer-friendly printing services out there... This is where any feedback from interested parties would be helpful.

I'm also still planning to make a stand-alone version of the gas sensor system that could be attached other roaster types (drums, hot air roasters, whirlypops, etc.). Aside from totally nailing when first crack is reached, I'm hoping some collective effort can accelerate figuring out how else the moisture and VOC data is useful.

Esteve (original poster)
Supporter ♡

#95: Post by Esteve (original poster) »

This is amazing! Feels like a finished product :o

What material did you use to extend the Ikawa ? Have you been able to use the TVOC and eCO2 for any roasting decisions ? I find myself using the humidity for first crack and to make sure that during drying I keep extracting moisture. But have not found any use for the other measures.


#96: Post by GDM528 »

The riser was printed with standard PLA - just happened to have a spool of white filament laying around. The bottom of the roaster stays pretty cool, thanks to all the inlet air rushing over it, so pretty much any printer filament should be just fine. I also print with a high flow-rate nozzle: the bead is 1mm wide and 0.5mm tall, which matches the pitch of the screws IKAWA used for the rubber feet - they screw into the riser with no additional hardware.

I think it's too soon for me to base any roasting decision solely on VOC data. It's clearly highlighting differences between roasting profiles and source origins, but I've yet to link it to a cause/effect analysis. I'm optimistic it will get there eventually, fueled by the data collected. We differentiate roasted coffee using visual color - but our sense of taste is more influenced by smell, so electronically 'smelling the coffee' could have some real merit. It would be awesome if I could benchmark the gas data to an actual human Q-grader.

A key obstacle to the gas measurements is calibration. The sensors are factory calibrated, but the exhaust air is a variable dilution of the actual gas produced by the roasting coffee. Changing the fan speed and/or the batch size will change the dilution with the room air. While most of us can agree on BT to within a few degrees, different roasting setups and profiles can easily create 2x differences in VOC readings. It will take some thought on how to process the sensor data to be independent of dilution.

Team HB

#97: Post by ira »

My guess is it will turn out to be most useful if you buy a large about of one coffee helping you navigate changes to the roast over the life of that coffee and less useful to base the roast of one coffee on another. But what do I know. But, really good job. If you put that side facing the wall, no one would realize it's been modified.


#98: Post by GDM528 »

ira wrote:My guess is it will turn out to be most useful if you buy a large about of one coffee helping you navigate changes to the roast over the life of that coffee
Exactly what I'm doing right now. Even without fully understanding it, the gas data has helped me decide how to tweak the next roast of the same source greens. I'm not making specific changes based on the gas data, but it seems to help along whatever narrative I concoct in my head, rational or otherwise.
ira wrote:... and less useful to base the roast of one coffee on another.
Well, actually...
One side benefit of the flexible tubing, is I can pull the sniffer tube out of the roaster and stick it in other stuff, like greens, roasted coffee, etc. In my initial, informal 'sniffing around', I've observed different VOC readings from different source greens, and that difference carried through into the roasted results... what does that mean??? Easiest answer is sloppy design of experiment, but perhaps there is a thread to pull on here. The BME688 sensor claims to be able to smell the difference between 'espresso' and 'filter' roast. Bosch doesn't explain what those terms mean, but I'm guessing they mean light versus dark roast.

Perhaps someday I'll use the gas sensor to test a new bag of greens and use that data to decide what roasting profile to start with.


#99: Post by GDM528 »

Is it so wrong, to love a batch of greens, simply because it produces nice-looking data?

These particular greens produced the smoothest-looking curves I've seen so far. The absolute humidity (AH, light blue dots) curve is the raw data from the sensor - no smoothing required. I could blame the equipment, but I wonder if perhaps there's something about the greens that produces such a clean curve.

However, the point of this posting is to exploit the cleanliness of the data to look at how the temperature drives moisture out of the beans. I used a 'stepped' profile that holds the roast at a caramelization temperature for about five minutes, then steps up about 40C to a first-crack development temperature and holds for about 2:15 post-1C.

I superimposed dashed lines to extract and show the slope of the absolute humidity curve during browning and development respectively. Raising the temperature 41C increased the downward slope of the moisture released by a factor of 3.1 over the browning rate. Yeah, the trend shouldn't be surprising, but at least now I can put a number on how much it changes: roughly 3x - but that may change from one SO to the next.

I also note the beans are still shedding moisture when the roast is stopped, which I'd like to think means I've haven't completely driven out the 'flavor spirits' from the roast. Just eyeballing the curve, looks like it might have taken another 2-3 minutes to have rendered the beans inert.

Perhaps this links to DTR: solely based on first-crack timing, DTR was about 28%. But DTR based on area under the moisture curve is about 32%. Using moisture release might be a better metric, given that temperature and timing is what's done to the roast, whereas moisture release is what happens to the roast.

Supporter ♡

#100: Post by Erichimedes »

GDM528 wrote:I'm also still planning to make a stand-alone version of the gas sensor system that could be attached other roaster types (drums, hot air roasters, whirlypops, etc.). Aside from totally nailing when first crack is reached, I'm hoping some collective effort can accelerate figuring out how else the moisture and VOC data is useful.
Count me as extremely interested in this. I have enough DIY skills and could source parts and assemble my own, as long as I have a list of resources and someone I can ask questions to, especially on the software side. I know someone in town I should be able to get 3D printed parts from. I haven't had the chance to read all of this thread yet, but I'm sure I could get up to speed on most of it.

I'm running out of room inside the main box of my roaster, but I would be interested in a stand alone version to start out with. I can always stuff it into the main box down the road, depending on how much I end up using the data.
GDM528 wrote:I superimposed dashed lines to extract and show the slope of the absolute humidity curve during browning and development respectively. Raising the temperature 41C increased the downward slope of the moisture released by a factor of 3.1 over the browning rate. Yeah, the trend shouldn't be surprising, but at least now I can put a number on how much it changes: roughly 3x - but that may change from one SO to the next.
I'm not quite familiar with the data you're posting here, but man am I interested in it. Am I reading the graph right in seeing that there's a noticeable drop in moisture RoR at a specific BT there at the beginning? Maybe 130C or so? Do you see that peak at a similar BT between different greens or does it tend to change?