Here are the latest plans for the high voltage side of my Es(pi)resso machine controller. Obligatory warning: working with mains voltages as shown in this circuit is potentially very dangerous – use this circuit at your own risk.
Click to embiggen (to promulgate a neologism):
This diagram is a slight refinement of the circuit currently inside my machine. Basically, I’ve added a TC426 to drive the IGBT for improved switching times (replacing the BC556 used previously), and replaced the opto-couplers with the 4 pin HCPL-817 for reduced board area and pin count. This also leaves one spare TC426 output for future expansion, which I plan to expose on a 0.1″ header. Otherwise the circuit is exactly the same as the current working version in my Gaggia Classic.
The OC1 coupler enables the Pi to detect when the pump is powered on. As soon as mains power is applied to the pump, this open-collector output goes low. This makes it easy for the software to know when a shot is being pulled, and to count shots etc.
There are two SSRs in the circuit: K4 is used to switch the boiler elements, and K3 is used to switch power to the pump. The pump can still be manually controlled with the brew switch. When the pump SSR K3 is on, this also powers up the pump modulation circuit. The PUMP_PWM input is a 3V3 logic level PWM input for the pump. This goes through opto-coupler OC2 and the TC426 via 1K gate resistor to switch the IGBT Q3. It’s arranged so that a logic high on PUMP_PWM will switch on the pump. Therefore, PUMP_OUT and PUMP_PWM together can be used to automatically power the pump on/off, and to modulate the pump pressure via PWM (I’m currently working with 1kHz PWM frequency).
Today I carried out a low voltage test of a subset of this amended design (the HCPL-817, TC426 and IGBT), and it performs well. The next stage is to test this at mains voltage with the pump, and then I’m planning to design a custom PCB to replace the current strip-board used inside the machine.