Why…?
… does seem to be a fair question. In my case: The brew thermostat of my Rancilio Silvia died. Changing a thermostat is perhaps just as boring as fixing a flat bicycle tire. Adding a PID controller to an espresso machine however is good fun. Which must serve as a good explanation.
Good temperature control is claimed to give both higher quality and more consistent quality of your coffee shots.
The PID controller keeps a much tighter control of the temperature variations compared to the on/off thermostat control – as expected!
But I have to say that the Rancilio delivered superb quality coffee before the PID controller was installed – and it still does after the installation of the PID controller. So at least I didn’t break anything which to a certain degree is also a measure of success.
Let’s have a look at the parts list
Parts List
I chose a DIN 1/16 size since it then fits nicely into my espresso machine or alternatively into a standard project enclosure so my wife and children are out of harms way when operating the machine. I.e. the 220V terminals are packed away and out of reach. The model I choose was a SESTOS D1S, but you may get even cheaper once.

There is much to say about PID control. Which I will not. There are plenty of resources elsewhere on the internet. I my self am an engineer and have sort of a basic understanding of what to tune in the controls to get a certain response (without being an expert in any way!). Luckily the PID controller will normally have an Auto Tune program which does a fair job in setting the control parameters. Try it out and if some fine tuning is still needed, in the case of unacceptable temperature overshoot or too long heat-up time, then consult here or drop a post or read further down and see if you get anything useful out of my PID “theory” section 🙂

One disadvantage of the SSR over your current mechanical relay is perhaps worth mentioning. SSR’s have a tendency to fail “shorted” on their outputs, while electromechanical relay contacts tend to fail “open”. This means that in the unlikely case of the relay failing then the boiler in your espresso machine will continue boiling even after the set temperature is reached. Have this in mind but don’t worry about it. SSR’s are known to as very reliable components.
As you see there are 4 terminals. 1 and 2 should be connected such that they power the heating element. I.e. connect them to the two wires attached to you existing brew thermostat. It does not matter which you put were as long as the two wires goes to terminal 1 and 2. Terminals 3 and 4 are the control input side. So they are for the PID to operate. Note that they have a + and – and this should correspond with the current output on the PID. for the SESTOS the terminals are SSR3 goes to PID8 and SSR4 goes to PID6.
On the advantage side you will have a completely silent relay when the SSR is in operation since there are no moving parts (no more “click-click” sound).


Note that you can cut off the end of the thermocouple and basically shorten it to any desired length. Just expose to two wires and twist hard them to ensure a good connection between them.
Search the Electronic Components section on eBay for “project enclosures” and make your pick.
How is it all connected?
Some photos and drawings which may be of help if you want to try this out yourself:
click to enlarge
- Connecting PID, SSR and thermocouple

Tuning
The PID controller most likely have an auto tune program/feature. Let your espresso machine heat up for 30 min and then deploy the auto tuning. This lets the PID analyse the response of the system and set the gain or time parameters.
Try it out and see if you are happy with the result. In my own experience you will benefit from adjusting the parameters manually afterward. The main reason is that the auto tune wile most likely find the optimal set of parameters to include a good portion of integral action. Where this is a good thing to keep an almost undisturbed system stable it is not necessarily good for the system response you want of your espresso machine. When you press the brew button, cold water will flow to the boiler and the temperature will drop rapidly for a short time as you brew. Having a lot of integral action available in the control strategy will interpret this as a temperature which is offset even though heat is supplied. I.e. the integrated error will increase quite a lot during the seconds you brew. To make up for this, heat is supplied to the system until the error is again low resulting in a temperature overshoot of several degrees after each brew. This was NOT what you wanted. To avoid this set the integral gain/time low and compensate with differential instead. This worked for me. The temperature is at present time not quite as stable as it was using the auto tune parameters. But I manage with the +/- 0.7 °C temperature variations I’m seeing. Speed in getting to the set value and stable post-brew response is more important to me than +/- 0.1°C accuracy of the steady state temperature.
Enough silly talk about control strategy. You basically just wanted a cup of coffee right? 😉
So without further ado:
