# My Espresso PID controller



## Steve_M (May 26, 2018)

In June of '18 I did a restore of a late 90's classic (link to thread) and decided to add an Arduino based PID controller to it. My little PID controller worked pretty well, but it was a little fragile and moving the machine to clean it / around it usually meant crossing my fingers that the controller would work.

Fast forward to the end of 2020 and I've designed and had a set of 5 PCBs made up at JCLPCB for about $20 CAD including shipping! I tested it out on my Franken Baby and it worked great, so now I've got my Classic complete as well and it's working out great. It gets powered on/off with the power switch on the machine.

The code and PCB files are here.

Picture time!

Here's the Gen 1 board made up with some protoboard.










Here's what the new PCB looks like. Just a tad bit nicer! 










Installation #1 in the '03 Baby










Prepping the install for the classic. I'm using a thin cutting board as the mounting surface in both the Baby and Classic.










It's hard to get a decent shot of it inside the case. I ended up modifying the installation here. The SSR is now mated directly to the case and the PCB on the mounting board is on its own.










What it looks like on the back of the machine










A little video of the controller working. You can see the brew light being toggled on/off as the boiler is powered on/off

https://i.imgur.com/9qTFjJJ.mp4


----------



## Steve_M (May 26, 2018)

I've just pushed a bunch of code changes that include being able to use the steam switch to increase the temperature setpoint. I've also enabled MQTT support, which is great for those using Home Assistant.

GitHub repo here


----------



## Rincewind (Aug 25, 2020)

EXCELLENT 😎 ...and no unsightly box neither.


----------



## Steve_M (May 26, 2018)

The "no unsightly box" approach is what I was going for. I was using a small OLED screen with it at first, but after a while I didn't bother with it. I know that after 7 or 8 minutes that it's warmed up and ready to go. You can also visually tell it's warmed up as you'll see the brew light turn off for a split second every 5 seconds, as that's all is needed to maintain the setpoint once it's warmed up.

Of course I can also check it from my phone and remotely turn on the boiler from anywhere in the world!


----------



## Rincewind (Aug 25, 2020)

You've nailed it 😎😎😎 , nuff said.


----------



## editor (Nov 8, 2017)

Great work, I think a more discreet PID would be great if made available to purchase for the less techy.

The usual metal box stuck to the side can have a bit of a 'wallace and grommit' type asthetic...


----------



## phario (May 7, 2017)

Maybe a dumb question but isn't the thermocouple amp sufficient to read the K type thermocouple and convert to digital? Are you using it in addition to the ads115? How does that work?


----------



## Steve_M (May 26, 2018)

The AD8945 thermocouple amp is analog with an output of 5 mV/C. The ADC on the ESP8266 is only 10 bit and of questionable quality. The ADS1115 is a precision 16 bit ADC. In reality it's only 15 bit since we're not measuring negative voltage values. It also has 4 ADC channels, so if down the road I want to incorporate something like a pressure transducer, I can use one of the free analog inputs on the ADS1115.


----------



## Rincewind (Aug 25, 2020)

Steve_M said:


> ...The ADC on the *ESP8266* is only 10 bit and of *questionable quality*...


 +1 ☝ ...i've had 3 of these DOA.


----------



## raberrio (May 1, 2021)

Hi, i am doing my own PID controller too. Just wanna ask you how did you power the controller. I want to power on the controller with the machine and turn off with it but I can't figure how. I wired one cable to N and other cable to SSR input (thermostat input) which turns on with machine switch, but controllers keeps powered on all the time.

thanks


----------



## Steve_M (May 26, 2018)

raberrio said:


> Hi, i am doing my own PID controller too. Just wanna ask you how did you power the controller. I want to power on the controller with the machine and turn off with it but I can't figure how. I wired one cable to N and other cable to SSR input (thermostat input) which turns on with machine switch, but controllers keeps powered on all the time.
> 
> thanks


 I made a Y connector that sends the Neutral wire directly to one side of the 120V AC > 5V DC Hi-Link transformer. The other side of the Hi-Link transformer is powered from the Line wire that used to be attached to the steam thermostat. This ensures the 5v transformer is only powered up when the power switch on the front is in the on position.


----------

