PID-controlled Quest M3s Roaster with Arduino and TC4

When getting the Quest M3s roaster, I had pretty much planned to add PID and (manual) computer control from the start. I wanted to make something comparable to an Aillio Bullet R1 in terms of features, but something I could maintain even if the manufacturer disappears or loses interest in maintaining the product. While Aillio looks like a really reputable company, I have had a few bad experiences with niche products that require firmware and software updates: once the manufacturer loses interest.

If by some unlikely chance you’re looking to do something similar, this post should help you find some of the resources I used. A word of warning, though: this modification involves mains wiring, and changing some already fairly sketchy circuitry in the Quest. The Quest roaster can start a fire if you operate it incorrectly, this adds the risk of electrocution if done incorrectly. Follow my instructions at your own risk, and please only do so if you know what you’re doing.

Here’s what I used:

  • An Arduino Uno ($10)
  • A TC4 ($55). This is an Arduino shield designed by greencardigan which can read 4 thermocouples and control a variety of things like motors, heating elements and fans. It also comes with excellent firmware also written by greencardigan.
  • Greencardigan’s Zero Cross Detector ($15) for phase angle control of the AC fan in the roaster.
  • Two Solid State Relays (SSRs). I used Crydom CWD2425 and CWD2425-10. CWD2425 is zero-crossing and CWD2425-10 is an instantaneous turn-on SSR which can be used for phase angle control. Similar SSRs without the plastic shield are recommended by Bill Welch in his diagram (around $100 for the two).
  • A project box, some wire and pin headers ($20?)
  • Two miniature K-type panel mount thermocouple sockets, like these for sale on amazon. ($15).
  • I had already installed a BT and MET (Maximum Environmental Temperature — the temperature outside the drum near the heating elements) probes.
  • I also purchased a 20×4 LCD, a bluetooth module and a small 5v power supply for the Arduino. Later, I plan to make this work wirelessly!

The total in parts was about $215. Counting $100 for the thermocouples, that works out to about $1700 for the roaster and this mod. That’s cheaper than a Bullet by $1100, though only if you count my time as worthless!

I also consulted a lot of resources online for this, namely:

  • Jason Wolley’s post on a nearly identical mod. This was incredibly useful, and you should definitely read it if you plan to do something like this.
  • This wiring diagram by Bill Welch
  • The Home-Barista home-roasting forum


The somewhat scary point-to-point mains wiring of the Quest M3s, with some additional wires connected. Seen from below with the bottom panel removed.

I wont go into step-by-step details here as I think anyone competent enough to undertake this mod should be able to use the wiring diagram above and greencardigan’s excellent github documentation. I will share some notes, though:

  • I used the aArtisanQ_PID 6 firmware available here to talk to Artisan and provide PID support. Configuring Artisan is really hard as the documentation is pretty bad. I figured it out eventually, but if you are doing the same thing feel free to get in touch and I can provide some pointers.
  • I left all of the analog AC circuitry intact, which has some tradeoffs. The good thing is that I could manually control a roast if the TC4 stops working. The bad thing is that using both controls will have unpredictable and possibly bad/damaging results, so you should not do this. I do notice that the ammeter occasionally bounces around at low heater duty cycles. I think this is due to the capacitors in the original AC control circuit charging and discharging with the erratic PWM’d AC signal.
  • I tapped into power after the timer switch, meaning that you still turn this knob to activate the machine. I considered switching to something else, but didn’t want to install a switch or keep the entire SSR part of the circuit energized with the roaster off.
  • I bolted the SSRs directly to the bottom of the chassis as Jason Wolley did. Stainless is a poor conductor of heat and this definitely doesn’t qualify as the recommended heatsink in the Crydom datasheet. The electronics cooling fan of the Quest probably helps this situation some. I haven’t had any issues with this, but I may improve this later.
  • This exposes some AC wiring outside of the roaster. The SSRs have plastic covers, but you could still easily make contact with a screwdriver or something. A safer design would mount these SSRs inside a grounded or insulated box.
  • When using this setup with a laptop on battery power, I get somewhat erratic thermocouple readings. This is some sort of interference or grounding problem as simply plugging the laptop into an outlet (and thereby grounding the Arduino itself) resolves the issue. I believe adding a ground wire from the chassis to the microcontroller case will fix this issue.
I did install the zero cross detector on the inside of the chassis as it is also energized with mains power. This panel unscrews from the bottom of the Quest.
The SSRs installed underneath the roaster as viewed from the bottom. The zero-cross detector is on the other side of this panel.

Results: PID Control

It turns out that tuning a PID circuit is not easy, especially when you’re controlling something that has a lot of thermal inertia like an electric roaster. My current settingd are p=5 i=0.7 d=20 using ‘proportional on error’ (for more information on this setting see this blog post from the author of Arduino PID) setting with okay results. This took several hours of fiddling to get to something workable. I still think these values are suboptimal, but I also feel that PID itself is pretty suboptimal too. I’m considering implementing my own fuzzy logic or neural net to do a better job.

With these settings, the roaster tends to both over and undershoot the target temperature about +/- 10F, as you can see in this roast driven by PID control of MET:

The green line is PID target, the red line MET. The initial oscillation is introduced by the bean charge. You can see after this the temperature follows the setting, though quite approximately. This roast was actually a great City+ espresso roast; one of my best in recent memory. However, replaying the same roast produces somewhat different results due to the relatively poor control of MET.

I hard originally intended to roast exclusively and entirely by PID, but so far this error and lag has prevented me from getting the best results. It has turned out to be super convenient for preheating the roaster, though. Before I would have to closely monitor the temperature of the roaster during preheat– now it’s entirely hands off.

Interestingly, the above graph shows a ~30 second lag between MET and ΔBT. The ΔBT jumps at 4:15 and 7:30 are preceded by bumps in MET about 30 seconds before. I’m using pretty sensitive 1/16″ probes with low smoothing, so quite small changes are visible in my somewhat bumpy-looking ΔBT. I’ve observed that a change in MET seems to result in about a tenfold change in ΔBT. Given that ΔBT is a derivative of the correlated BT, this makes sense.

Results: Data logging and manual computer control

PID turned out to be only somewhat valuable. What turned out to be amazingly valuable was the data logging and manual computer control! Before when using the analog knobs on the Quest, I always found myself over and undershooting my target adjustments. Very small changes in heat input produce pretty significant changes in the roast. Now, I can input very fine adjustments and review precisely what adjustments I made when later evaluating the roast.

You might not believe me from the graph below, but I’ve subsequently found that adjustments of 1-3% duty cycle is all I need to influence ΔBT in the right direction. This sort of precision is impossible

Similar but worse roast to the PID controlled one above, this time by manually controlling the heater duty cycle. Smoother ΔBT overall, but with some human error during first crack where ΔBT begins to crash and is overcompensated for with fairly frantic adjustments 🙂

Would I do it again?

Absolutely! This was a fun project, and I’m really pleased with the results. This will help me make my roasts much more repeatable, and gives me something to tinker with.

The PID is useful and perhaps workable for 100% automation given a little more tuning, and the fine-grained manual and fully data logged control is excellent.


  1. Hi Michael. Just curious if you’re still using the Quest and whether you’re using the PID for roasting or just preheating. Great blog post and something I’m considering for my Quest M3S!


    1. Thanks! I’ve switched back and forth between using PID for the entire process and manual control to see what results I get. I think either method works well, though I’ve been doing PID roasts most of the time simply because it’s requires less attention and is more repeatable.

      I have found it hard to notice a difference between PID and manual roasting. It’s difficult to control for other variables, but certainly the difference is small. One would think that the high-frequency variations in heat input might produce a worse or at least different result, though I think the heating coils and thermal mass of the drum likely behave as a low-pass filter making this difference irrelevant to what the beans actually “see”.

      I have played around with the PID settings and improved slightly on my results in this blog post. I’m now using p=3.30 i=0.11 d=50 with ‘P on error’ mode. The larger ‘d’ coefficient and smaller ‘p’ makes the roaster somewhat slower to react but less likely to overshoot. It’s still much more responsive than me tweaking the knobs manually, as I tend to make small adjustments and the PID algorithm has no qualms with jumping immediately to 0% or 100% power. I think the PID tuning could be improved upon further by someone with more patience/skill :D. If you do this mod, expect to spend a while tweaking these values.

      I do intend to make one change to the setup: I’m going to switch to using hardware knobs and buttons and attach an LCD to the Arduino. This will make it possible to do PID roasts without using Artisan. This is an option in greencardigan’s firmware; I just need to remake the enclosure to have a place to put the extra parts. Artisan has recently been experiencing a periodic race condition / timing issue communicating with the Arduino on my mac which disrupts remote control. I’m not sure of the root cause. I did look into implementing a workaround in Artisan itself, but the code is very rough. Looking at it convinced me that switching to hardware knobs would be a more dependable approach. I’ll still use Artisan for logging, but not worry so much when it occasionally breaks.


  2. Hi mate, this is wonderful!

    I’m now using a old Quest M3 from 2013 with upgraded drum. Somehow I want to upgrade mine one to become fully automatic! One question:

    Are you able to control your Quest M3 by adjusting the wattage of your heat elements and your fan in Artisan?




    1. With this approach Artisan (assuming you can figure out the Artisan configuration; this took me a while!!) can control temperature either with a PID set value (target temperature) or a percent power level. It’s not in watts, but you could estimate the wattage from the percentage.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s