Gene Cafe Bean Mass Probe

I just tested out the bean mass probe proof-of-concept on my hacked Gene Cafe. It worked even better than I had expected. The probe itself is a bare type-K thermocouple that I inserted through a small hole I drilled near the inlet of the roast chamber.

The thermocouple is positioned to keep it out of the airflow and to maximize the time it spends buried in the bean mass.

I am using a MAX31855 thermocouple amplifier on an Adafruit breakout board. This is attached to the roast chamber itself.

I attached a chunk of perf board on the rotating plate that the drum snaps into using some stand-offs to help keep it cool during the roast. On this perf board is a Pro-Trinket, a Bluefruit EZ-Link, and a lithium-polymer battery. This was extremely easy to get working.

This interfaces with my laptop to display the temperature once per second. The sketch I am using right now is the example code “serialthermocouple” that is in the MAX31855 library.

Forgive the mixed units here… it works! The temperatures in the chart below are taken at somewhat random intervals during a roast. I recorded the lowest temperature for both outlet and bean mass during the drum rotation. You can see a significant difference between the temps. Note that the outlet temperature was being controlled at 510F. Once the outlet reached this temperature, it stopped climbing but the bean mass temperature continues to rise.

Lots of work to do here to get the bean mass probe temperature readings integrated into the Roast Genie but I am very pleased with the results. This should provide a fantastic opportunity to get a better window into the roast.

Some additional thoughts:

The li-po battery is not contacting any hot surfaces but the radiant heat load is significant. I am guessing it gets up to 140F +. Some shielding may help keep this cooler.

The thermocouple amplifier gets warm since it is directly mounted to the roasting chamber (using Sugru). It has cold junction compensation but any temperature difference between the amplifier chip and the connection point for the thermocouple will create errors. This may not be very significant but future versions should be designed to avoid this.

Because of the way the beans move around in the roast chamber, sometimes the thermocouple is buried in the bean mass and sometimes it is exposed. During heating, the lowest temperature read during a cycle is closest to the bean temp. The thermocouple responds very quickly so I don’t think that this will be a big problem. I will probably set up the software to compensate for this.

Post navigation

32 thoughts on “Gene Cafe Bean Mass Probe”

Do you plan on open sourcing the code? I’m about to throw my gene cafe out the window and/or burn it because I can’t gauge when first crack starts. A bean mass probe is imperative if you want accuracy and consistency.

Yes — happy to share. I’ve had great luck with this, much more reliable than I had even expected. I generally don’t have too much trouble identifying first crack by sound (some beans are easier than others) but knowing bean mass temp helps to know when to start watching. Project files are all located here: https://github.com/evquink/RoastGenie. Good luck and let me know if you have any questions.

I’m thinking of doing this mod so I can control and record the rate of rise. Would it interface with my windows laptop via Bluetooth or would I have to do the rest of the mods you’ve done and hook it up with cables?

The version of the bean mass probe documented here worked fine over Bluetooth with my windows laptop – so it should also work for you.

Recently I built a new version (which I need to document) that is based on an ESP8266 wifi board that broadcasts to an MQTT server I set up. This approach has some advantages but the Bluetooth solution is pretty easy to implement. Both give great bean mass readings but make sure you don’t put the thermocouple on the outlet end of the roast chamber – that tends to read 50 degrees or so higher that the actual temp.

Thanks for the reply. Your images appear to show the probe mounted at the inlet side. Would I have to make changes to the code if mounting it from the outlet or have you already made those changes after moving the probe yourself?

What do you do with the excess thermocouple length? Still run it up and don the length of the chamber handle? It appears the MAX31855 thermocouple amplifier is connected to the pro trinket with wires. Are these quick and easy to reconnect after removing the drum? I thought it might be easier to put the aplifier on the perf board with everything else and then just plug/unplug the thermocouple.

When I mounted the probe on the outlet end, I did not change the code. That said, it did not work all that well (readings seemed way off). I never investigated that carefully enough to determine if this is something that could be compensated for in the software. You might be able to. Instead, I moved the probe back to the inlet and mounted the electronics to the inlet side of the roaster. I also mounted the amplifier to the roaster instead of the drum as you suggest here (indeed it is easier to plug/unplug the thermocouple). I did not do this originally because I didn’t have proper thermocouple connectors but do now (get them from Omega Engineering). As for the excess thermocouple wire — just cut it to the length you need. The insulation is a bit of a pain to deal with but certainly doable. You can make junctions by simply twisting the bare wires together tightly and trimming. I will try to get details of the new version loaded onto the site.

Thanks for the advice. I’ll be sure to mount it on the inlet side as pictured (with the probe hiding behind the metal away from the airflow). Could you possibly link to the connectors you used? I’m in the UK and can only find “mini k type connectors”. I can’t seem to find a female connector to solder to the amplifier.

I’ve got all of the parts together now and soldered but I can’t seem to get any data to transmit to my computer. I’ve uploaded the program to the pro trinket, soldered everything together, and paired bluetooth. When I open com4 on serial monitor I don’t get any data.

Is there some other software you’re using, particularly to create the graph? I’d like to add some programming to calculate the rate of rise in addition to current bean temp, but that can wait until I’ve got this working!

I haven’t tried that but I successfully uploaded and receive comms via Bluetooth last night. I think there was a problem caused by a Bluetooth mouse…anyway its giving me a series of 0 readings with the serial thermocouple sample, I haven’t uploaded your code again yet but it’s not looking good for the amplifier, it might be fried.

Hopefully you can get this working. Let me know if I can be of any help. One thing to check out is the version of amplifier you are using. Adafruit started using a different MAXIM chip a couple of years ago. There are different libraries for the old one. I am guessing that the code would have failed to compile if you didn’t have the correct library though. Another thing to think about — I have started working on a different version of the bean mass probe using an ESP8266 and MQTT (AdafruitIO dashboard). Better results with less hardware. Some preliminary details are posted here and I am working on full documentation now.

Your code with added line which produces expected result error message “something went wrong”.

//BeanMassProbe

/*
The MIT License (MIT)

Copyright (c) [2014] [Evan Graham]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

int t_delay = int(1000/RATE); // this is the number of thousandths of a second between temp readings
int TmaxLoopCount=0; // # of measurements since Tmax was set
int TminLoopCount=0; // # of measurements since Tmin was set

I’ve checked connections with a multimeter and everything is ok there. I’m pretty certain the chip has gone. I might have let one of the jumpers from 5v slip onto a data pin when trying to twist them around, though I don’t remember having it incorrectly connected to anything but ground.

I’ve done it! Turns out I’d misread something and BUS can’t be used as data output, so I switched to another port and got actual readings. It’s all mounted to the end roasting plate now using Sugru and I’m pleased to say the temp doesn’t get very high at all, maybe into the 50c range. Thermocouple readings are slightly inaccurate with First crack occurring at 109c and finishing at 121c, but accuracy isn’t as important as having the temps as a point of reference. When you know how far off your equipment is you can compensate easily.

I downloaded Artisan roast logging software but couldn’t get it to record anything. Will have to look around for something to help log so I can concentrate on responding to the temp changes rather than writing them down.

Very glad to hear that this worked for you! It is odd to see the temps so low – I get very consistent readings with 1st crack starting at 400 to 420F (204-215C). You might want to do a calibration the the thermocouple in boiling water just to rule out other possible issues. I’d be interested to see pics of how you mounted it.

This is awesome. I won’t be building a board and driving the Gene like you are but seeing where you placed the heat probe and your belief that having the beans out of contact with the bean mass is acceptable is great!

I have purchased a Lascar EL-USB-TC that I will be using to capture bean temperature data. It has an operating temperature of 104F so I will be enclosing the Lascar device in 1/2″ thermal blanket material and attaching it to the side of the drum handle so it won’t add to the circumference.

It comes with software to read the data log and it provides an export feature to Excel. From there I’ll take your suggestion and separate the lower numbers (probe in bean mass) from the higher numbers (probe exposed) then plot graph the result as ambient drum interior and bean mass.

While I’m not as ambitious as you I want to thank you for posting this; absolutely outstanding!

Thanks for the kind remarks George. The bean mass probe has probably been the best addition to my setup. I am thrilled to hear that it helped you with your project. I have found the readings remarkably consistent with roast stages. Good luck with your probe – please let me know how it works out for you.

I will do my best to take pictures of how and what I’ve done with any notes. I will then get back with you and if you want to look at them and see if they are suitable for your site I would be happy to share them. I will also take screen captures of any graphics and data analysis.

BTW – did you ever get a temperature reading on the outside of the drum? I’m hoping 1/2″ ceramic thermal blanket will be sufficient to keep my thermocouple device from being destroyed.

Did you come up with an automated method of separating the cyclic sensor readings of “in bean mass” vs “out of bean mass” for the data stream? If you did and you are not using Excel then your solution will probably be of limited value to me but understanding your logic may still help.

Based on the charts you’ve posted, running a straight “line with markers” scatter plot chart in Excel for the data stream will graphically represent the separation of readings due to the cyclic nature of the sensor being in “bean mass” and “out” quite nicely.

For clarity, I would like to separate the cyclic sensor readings into two separate line graphs (as you have done). For me, this means going through the data and manually separating the stream into two columns with headers similar to “Sensor in Load” and “Sensor in Air” with #NA values in blank cells.

Given the amount of data, I’m interested in automating this separation.

Sorry for the delinquent reply George. I am using a very simple algorithm to identify local minimum and maximum temperatures. The logic works like this:

1) Check the reading of the bean mass probe every 1/2 second
2) Compare the current temperature (To) the previous reading (T1) and the one before that (T2)
3) If To > T1 and T1 < T2 then T1 is a local minimum, the lowest temperature the thermocouple has read over the past second. I take this to be the bean mass temperature.
You can do this on a spreadsheet but I do it in the code I use to collect the data.
A couple of things to note:
1) With this very simple algorithm, you will get some excursions in the data (seen as rapid, temporary increases in temperature) that are not good readings. These could be filtered out with a little more coding.
2) It is important to use a thermocouple with a fast response time. I use a bare thermocouple wire of about 30 gage. When using a thicker thermocouple wire (probably 24 gage). I noticed a markedly higher temperature (> 50F) this is probably due to the fact that the thicker thermocouple can’t change temperature fast enough. A sheathed thermocouple may not work well at all.

I plan to do something similar. I don’t have the Gene Cafe yet, but I was wondering about the probe. The wire does not twist while the drum rotates? Or there is something that rotates along with the drum , therefore the probe won’t twist?
I plan to do something simple. My goal is to see the temperature of the beans, I don’t plan to connect anything to a computer. Connecting to an android phone would be nice though.

The setup I built rotates with the drum. It is battery powered (LiPo). The first version I built (documented here) uses Bluetooth to communicate the temperature data. I built a second version (not yet documented) that uses WiFi and could be linked to any number of IoT servers (Adafruit’s for example). I will try to document this soon – it is a better solution. The bean mass probe is a really nice addition to this roaster.

I haven’t tried that but I successfully uploaded and receive comms via Bluetooth last night. I think there was a problem caused by a Bluetooth mouse…anyway its giving me a series of 0 readings with the serial thermocouple sample, I haven’t uploaded your code again yet but it’s not looking good for the amplifier, it might be fried.