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:

Hey!
Having made the exact same setup as you, and thanks for the guide by the way, I’m curious to which settings you have altered and which values.
I’ve run the auto tune, but, I’m also sing a rapid drop in temperature in brewing and somewhat time before the output signal goes high. But, I didn’t pay much attention for the short time I studied EE @ AAU so I’m basically lost on knowing what to do 🙂
Thanks so much!
I just recently installed a new boiler and learned that it altered the needed settings quite a lot. So it may be different for different machine versions.
However I’m using:
Integral M50 = 450
Differention P = 226
How did you fit the sensor in the boiler ? The tread from the sensor is more wide than the tread in this pre-2000 boiler(v1) ?
Hi Ben,
I put a little bit of thermal grease on the sensor and then simply tightened it under the brew thermostat on top of the boiler.
HI,
So when you set the machine to steam it bypasses the PID and goes to the steam thermostat?
That is correct.
It does yes.
The steam thermostat is a separate one
Thanks for publishing this page. It helped me installing a PID in my Silvia. I used Inkbird ITC-100V, K-thermocouple with 5mm washer and 25A SSR (all sourced from Ebay for ~USD$30). The Inkbird is the same as your Sestos.
Good stuff. Thanks for posting 🙂
Nice one 🙂
Is it possible to use a higher A ssr like 40A
Sure.
But 220 V times 25A is already like 5.5 kW. 40A would burn your fuse installed in the main switch board of your house installation first 🙂
Hey, I’ve got the same setup.
What PID settings are you using. I seem to have a long overshoot and want faster response, but can’t seem to get there.
Thanks
Yeah. There is a little issue here. The control settings cant really fit both the two common scenarios:
1) Machine cold and warming up
2) Machine already warmed up and you want to get back to the set point after brewing your coffee.
I tuned the parameters of the PID according to scenario 2). Then I kranked up the parameter for the differential term since that is probably the most effective to avoid overshoot.
It performs nicely during 2) but it IS admittedly slow during 1).
Not much to do about it… unless 😀
You install a Raspberry Pi and code up a PID control loop for each scenario. My wife has pulled the plug on that project though 🙁
Hello, Thanks for the clear explanation!
A also want to install a pid controller on my Rancilio V2.
I want To use : https://nl.aliexpress.com/item/4000401029757.html?spm=a2g0s.8937460.0.0.180e2e0eVBwaRf
With a SSR-25
You are using the K-type thermocouple.
You are explaining. ,,I put a little bit of thermal grease on the sensor and then simply tightened it under the brew thermostat on top of the boiler.”
Did you shorten the sensor?
Do you have A picture for me.? I don’t know exactly what you mean. Sorry for my bad writing I living in the Netherlands.
Greetings Nanne
Hi Nanne,
I did not shorten the sensor, it fitted as it is. I did calibrate it with a known thermo sensor (i.e. adjusted the offset in the PID setting. Not the gain).
Hey kuhlmeier
So I bought the espresso machine now.. won’t you come by and do the magic? I’ll even buy you a beer if you additionally train a NN running on Coral learning if the brew was good or not and adjusting the parameters accordingly
– Alejandro
Funny enough that’s exactly what I intended with that hack! To travel the world and adjust people’s espresso-machine-PID-parameters. You got it mate! As soon as we get through this corona situation 🙂
I’m going to attempt to replace the PID on a 2nd hand Sanremo Treviso LX (HX, E61 with rotary pump) which I’ve just acquired.
Sanremo appear to have replaced the mechanical pressure relay controlling the boiler temp with a microcontroller PID, in the last revision, that has a set of DIP switches. No one will tell me how to configure them. I’ve tried everyone incl Sanremo.
My only concern is that the manufacturer’s thermocouple is surface mounted, which is easy to replace, but I see my machine hit 2.5bar when switching on from cold, finally settling down after 10mins around 1.25->1.5 bar which is too high.
It’s manual says 0.8-1b.
Can’t turn it down because no one will tell me how to!
Your post here gives me a nice solution, rip it out and replace it!
I’m assuming you surface mounted that K type thermocouple on top of the boiler?
I just don’t have the nerve to drill a hole into my boiler to take a direct reading. 🙂 Do you have any trouble with over shooting the boiler pressure on cold start?
Also I tried to find a PDF manual online for the Sestos 1DS but couldn’t. Did yours come with a manual? I’ve ordered one from a Chinese re-seller on EBay, hoping it has some instructions with it.
Hi George.
Overshooting is a bit of an issue when I have made the first brew. The temperature drops rapidly during brewing because cold water is being infused in the boiler. The best fix I have come up with is to auto tune the parameters after the warmup/brew cycle and then decrease the integral gain. I.e. not putting so much weight on the integrated set point error from the temperature drop.
Thanks for posting this. I’m about to install a PID in my Silvia and like your idea of mounting it in the machine instead of hanging it between the GH and steam wand. But I’m concerned about heat effecting the PID. Has this been an issue?
The same PID is actually still running.
In conclusion, no heat has not been an issue. I run at 93 deg C.