Here is the circuit. As your Arduino board will be grounded to the coffee machine, it needs an optocoupler to the triac. Your HCPL817 will be suitable. I have replaced the ST micro in the AppNote with a CMOS 555 timer, wired as a bistable, to keep the load on the optocoupler to a minimum. The triac is switched on when the gate is negatively pulsed. So when the LED in the optocoupler is powered, the triac is triggered on. The 555 is powered by a diode pump. It works like this.
It is easier to explain if the ‘Line - A’ is considered to be at a fixed voltage. The ‘Neutral - B’ is then a 220V sinewave relative to it. 220VRMS is about 300Vpk so consider that B goes 300V above and below A.
C1 and C2 are both discharged at the start. When B is +300V relative to A, C1 will charge via R1 and Z1 (Z1 acting as a normal diode) to 300V and its RH side will be negative.
As the polarity changes, the voltage on both sides of C1 starts to fall, turning off Z1 and turning on D1. As the voltage on B goes from +300V to –300V, C1 discharges to zero then charges with the opposite polarity through D1 and C2. The charge that was on C1 will now be split between C1 and C2. As C2 is 500 times larger than C1, the voltage across C2 will increase by 600/500 = 1.2V, with point C being negative to A.
As the process is repeated in successive cycles, the voltage across C2 will get progressively larger until it reaches 5.6V, at which time Z1 will bleed away the charging current. So C1 effectively ‘pumps up’ C2. The current that can be drawn will be a function of the sizes of C1, C2 and R1 but I don’t know the law it will follow. The original was intended for 50mA pulses of 50mS duration.
The 555 needs to be the CMOS version, because the output of the standard bipolar type will not swing as high as V+.
I hope that may be useful for you.





