Removing a Stuck Shower Plate from the Gaggia Classic

Shower Plate Removal

My shower plate had become badly clogged, with two of the holes pretty much completely blocked. When I tried to remove it, I found it was really badly stuck… I tried soaking in descaling solution, tapping it with a soft faced hammer, levering it from the side with wood (mindful of damaging the shower plate)…. but it wouldn’t budge.

Then I stumbled on a tip in a forum: simply insert a longer screw in the central hole, and tighten this until it pulls the shower plate free! So, I used an M5x20mm socket head cap screw (pictured above) and, with a few turns of an allen key, the plate popped straight off.

I tried cleaning and descaling the shower plate, but it was pretty badly stained. Having neglected my machine so badly, I felt slightly ashamed and decided it deserved an upgrade with a shiny new brass shower plate…

Brass Gaggia Shower Plate

Much better!

Gaggia Classic Boiler: step response, lag and temperature drop rate

Partly for my own notes, here are the results of some simple experiments with the Gaggia Classic boiler, to better understand its behaviour. Prior to these tests, the machine started out at ambient temperature of around 21°C. The temperature sensor is the TSIC 306 mounted in the same position as the original brew thermostat. There was no portafilter fitted. The tests were carried out on 240V AC mains in the UK, and this is the original Gaggia Classic with an Aluminium boiler.

This first graph shows the temperature (blue line) in °C versus time in seconds for a step input of heat at full power for 4s. The red line shows the timing of the heat pulse. Note the lag of about 4s before any measurable change in temperature after the element is switched on. In this example, the starting temperature was 21.7°C, the peak temperature was 29.8°C and the temperature rise was 8.1°C.


This second graph shows a step input of heat at full power for 8s. Again, there is a lag of about 3s before the temperature changes. Here the starting temperature was 23.2°C, the peak temperature 39.1°C and the temperature rise was 15.9°C. The original data can be downloaded as a CSV file.


Here’s a longer sequence, showing the first 35 seconds of the boiler heating up from “cold” after the heating elements are first switched on. The heating elements were on for the full duration of the graph below. Again, it takes 4 seconds before the first change in measured temperature. After 12 seconds, the temperature rise becomes almost linear, with a rate of increase of about 1.83°C/s (straight line fit to a linear subset of the data in Excel). The original data can be downloaded as a CSV file.


For the final test, the machine started at about 26.9°C and was driven up to 93°C under PID control then allowed to naturally cool down, to see how fast the temperature drops. Again, the data can be downloaded as a CSV file.


The initial temperature drop from 92.9°C to 90°C takes 29.25s, which is about 1°C every 10 seconds (0.099°C/s), within the small region between 90°C and 93°C where our temperature controller operates.

Measuring Ulka EP5 Pump Inductance

Having previously tried to estimate the pump inductance of the Ulka EP5 Pump, and without really being certain of the accuracy, I decided to try and actually measure it. Unfortunately, this is made difficult by the series diode built into the EP5 pump. Although I had a spare pump, I didn’t want to completely destroy it by opening it up, so I decided to try and reach the terminal by performing “minimally invasive surgery” on the pump…

To start with, shining a torch through the plastic pump body reveals the location of the metal tab terminal on the solenoid, and the series diode:2016-05-04_ulka_exam1

Having done this, a Sharpie pen was used to mark a point above the metal tab, which was approximately where the “U” is in the ULKA logo as shown by the small black dot below:


Then a pin vice was used to carefully and slowly drill a 1mm hole until it reached the surface of the metal tab, while taking care not to drill too far:


Having done this, we can now directly access both terminals of the solenoid and completely exclude the diode from our measurements. Using a low cost LCR component tester (fish8840 Taobao) it is possible to measure the inductance and series resistance as shown below. Successive readings showed 847.8mH, 856mH and 859.3mH with an average of about 854mH. The series resistance was about 165Ω as measured previously.2016-05-04_ulka_coil_LR

As both sides of the diode are now accessible, we can also check the diode forward voltage as shown below. This shows Vf=706mV and C=40pF:

2016-05-04_ulka_diode_VFCWhen finished, the hole will be filled with epoxy to seal it back up again and make it safe.


The inductance was measured as 854mH and the series resistance was 165Ω. The diode forward voltage is 706mV. These tests are carried out at a low voltage, and without any hydraulic load on the pump. It is possible that the solenoid plunger position may also affect the measurements. Note that the measured inductance is significantly different to the previous estimate.

Estimating Ulka EP5 Pump Inductance

As part of my work to modulate the Ulka EP5 pump pressure in my Espresso machine, I decided to try and simulate the pump in SPICE. This would necessarily be a very simplified model, but might be useful nonetheless to understand the behaviour of snubber circuits for the pump PWM controller. To create the model, I needed an estimate of the pump inductance.

Previous attempts

I could only find one previous reference to the pump inductance online. It’s not clear which Ulka pump was used, but it looks like an E5 type (EP5 or EX5) and a circuit diagram refers to 41W rating (consistent with the 120V 60Hz EP5). They took the approach of measuring the current drawn by the pump at 0.57A and, assuming a line voltage of 120V, calculated the reactance as follows:

XL = V/I = 120V / 0.57A (AC) = 211

With the formula XL = 2πfL = 2π * 60Hz = 377L, the inductance L was estimated as follows (for a 120V 60Hz pump):

L = 211 / 377L = 0.56H = 560mH

However, XL = VPEAK/IPEAK and the above voltage current values may be average or RMS values rather than peak values. For 120V AC mains the peak voltage would be VPEAK =12√2 = 170V. Similarly, when measuring AC current, some multimeters only give accurate results for a sinusoidal AC waveform, and may not be accurate for AC chopped by the series diode in the Ulka pump. This doesn’t necessarily mean the result is wrong of course, just difficult to be certain.

Manufacturer data on the pump

The manufacturer data states that:

  • Ulka EP5 240V~50Hz is rated at 48W
  • Ulka EP5 120V~60Hz is rated at 41W

Estimating pump electrical properties

There’s an integrated series diode in the pump, but the type is not indicated. However, based on similar Ulka pump models described in Ulka/CEMA specifications, the diode is assumed to be 1N4007 which according to manufacturer datasheets have a typical forward voltage VF = 1.0V when IF = 1.0A (noting that there are some small variations in the specifications for 1N4007 between manufacturers).

Attempting to measure the pump coil resistance directly with a resistance meter could give misleading results, due to the internal diode. To overcome this, a known DC voltage and current can be used to estimate the resistance.

With a ~12V DC power supply connected across the Ulka EP5 240V~50Hz pump, the measured voltage was 12.33V and the measured current was 70.1mA. At this relatively low current, it is likely that the diode forward voltage will be less than 1.0V. To estimate the diode VF, an individual 1N4007 diode was connected in series with a 220R resistor and ~12V power supply, giving IF = 51.9mA and VF = 0.775mV.

Assuming that VF = 775mV at IF = 70.1mA, the actual voltage across the coil will be reduced to (12.33 – 0.775) = 11.56V and therefore a first estimate of the pump coil resistance is as follows:

R = 11.56 / 70.1×10-3 = 165Ω

To calculate the inductance, the manufacturer voltage and power ratings are used to estimate the reactance as follows:

Although the Ulka EP5 240V~50Hz model is rated 48W, the internal diode means that the pump is only active for half the cycle. Considering the coil without the series diode, we therefore assume that the AC power consumption would be 96W and use this figure to calculate the AC current:

P=VI therefore I=P/V

IRMS = PRMS/VRMS = 96/240 = 0.4A

Note that the mains line voltage and current will of course vary in practice due to local mains supply quality.

The peak voltage and current are then estimated as follows:

VPEAK   = VRMS√2 = 24√2 = 339V

IPEAK      = IRMS√2 = 0.4√2 = 0.57A

The inductive reactance for an inductor energised by a sine wave is calculated as follows:

XL = VPEAK/IPEAK =  339 / 0.57 = 599.27

The inductance can be calculated based on the reactance and frequency as follows:

L = XL / 2πf

Where f is the mains line frequency 50Hz:

L = 599.27 / (2π × 50)  = 599.27 / 314.159 = 1.91H

However, on closer inspection, I noticed that the exact pump model I tested is labelled 230V~50Hz on the side. Repeating these calculations with 230V, the following results are obtained:

IRMS = 96/230 = 0.42A

VPEAK = VRMS√2 = 23√2 = 325V

IPEAK  = IRMS√2 = 0.4√2 = 0.59A

XL = VPEAK/IPEAK = 325 / 0.59 = 550.59

L = 550.59 / 314.159 = 1.75H

So this estimate puts the pump inductance for the 230V~50Hz EP5 pump at somewhere between 1.75H and 1.91H and the resistance at 165Ω.

Simulating the pump in SPICE

Running an LTSpice model with a 240V, 50Hz AC supply in circuit with a 1N4007 diode and an inductor modelled with L=1.75H, R=165Ω gives the following results:

Iavg=0.34A, Irms=0.46A, Vrms=240V, Pavg=35.67W

This doesn’t look too far off, however it is obviously lower than the rated power of 48W indicated by the manufacturer. Adjusting the LTSpice model inductance to L=1.37H gives results closer to the manufacturer ratings:

Iavg=0.39A, Irms=0.54A, Vrms=240V, Pavg=47.93W

Measuring the pump inductance

More recently, another attempt was made to directly measure the inductance. This was achieved by drilling a small 1mm hole in the pump to access the coil terminal before the series diode. The measured inductance and resistance was L=854mH and R=165Ω. The series diode forward voltage was measured as 706mV.


Modelling the pump as a simple inductor is obviously a gross simplification, as the pump is a spring loaded solenoid, whose inductance will vary as the internal plunger vibrates. Also, the hydraulic pressure in circuit is not considered. Finally, with high frequency PWM switching, the parameters estimated at 50Hz / 60Hz frequency may not be correct.

Nevertheless, the inductance values above when used in SPICE provide a first approximation which may be useful to estimate how the system will behave in practice, and do seem to give behaviour very similar to the real system.

If anyone has any corrections, comments, improvements or information to add, drop me a line in the comments below.

Mmm… Roasting Coffee

I had a really fascinating visit to The Blending Room, a coffee roaster based in Hull. The owner James is clearly very passionate about coffee and completely committed to perfecting his roasting technique and recipes. I could easily have spent the whole day asking questions and chatting about coffee with him! It’s really great to see these small producers offering such a diversity of great quality coffee, and to see people who care so much about their craft.

Coffee Beans

Mmm… now I feel like a coffee, but it’s kind of late in the evening.

Disaster! …but a salutory lesson

I made a schoolboy error last night when measuring current through the Ulka pump on my modified Gaggia Classic, which resulted in a very loud explosion of the SSR (pictured below).

Destroyed SSR
Oh no, all the magic smoke has escaped…

The machine was working perfectly well, but I just wanted to take a few measurements…. which ended badly due to a very simple mistake. I thought this would be an interesting example to share, to demonstrate the risks involved in this kind of experimentation!

The intention was to measure the AC current through the pump when using the IGBT versus the current with a direct connection. First of all, I started by putting my multimeter on the AC current range in series with the IGBT (between the IGBT collector and the pump). That went without incident.

The next step was to measure the current without the IGBT, and here’s where I made the error. I disconnected the IGBT collector lead from the pump, inserted the meter between the pump and Neutral, and powered on. There was a tremendous BANG like a gunshot, a cloud of smoke rose from the machine, and all the lights went out. Oops.

I didn’t immediately spot the problem, until I examined the circuit diagram, at which point it became obvious (see below). When I disconnected the wiring, I had accidentally removed the series diode D7 which prevents AC flowing back through diode D6. Placing the meter across points (A) and (B) and setting on the AC 10A current range created an effective short-circuit from the anode of D6 to Neutral:

Destroying an SSR

This allowed AC to flow from Neutral, through D6 and through the SSR K3 directly back to Live with no load in the circuit, as shown by the bold red line above. The poor, unsuspecting SSR (rated 8A) and diode D6 wouldn’t know what hit them! They both died a quick death, before the 13A fuse in the plug blew. The SSR blew with a loud explosion and a cloud of smoke. The diode failed silently, but went short-circuit.

After this, I was pretty annoyed with myself for not double-checking the circuit diagram before powering on. Concerned about the possibility of toxic chemicals from the burnt SSR, I also had to strip and clean the machine, which wasn’t a whole lot of fun. On the positive side, I did have a spare SSR, diode and fuse, so I was able to fix it that same evening, and the machine is working again now!

Next time, I will check my wiring much more carefully before powering on…

Calibrating the Pressure Sensor to match the Pressure Gauge on my Espresso machine

Some time ago I fitted both a mechanical pressure gauge (shown in the photo below) and an analogue pressure sensor (Danfoss AKS 32R) to my Gaggia Classic. The analogue sensor is connected via an ADC board to a Raspberry Pi, which displays the output on an LCD display. Calibration is needed to make the sensor reading match the gauge exactly.

Pressure Gauge

When I first installed the sensor, I used an approximate calibration as shown in the pseudo-code below:

minVoltage = 0.5V
maxVoltage = 4.5V
maxPressure = 20.6842719 bar (300 psi)
voltage = pressure sensor voltage (measured by ADC)

voltageRange = maxVoltage - minVoltage
bar = maxPressure * (voltage - minVoltage) / voltageRange

Although this was only based on the sensor specifications, it actually gave surprisingly good results. There was only about 0.5 bar difference between the gauge and the pressure sensor (the sensor always read slightly higher than the gauge). Nevertheless, I decided to calibrate the sensor against the gauge (on the assumption that the gauge was more likely to be correct). Absolute accuracy isn’t really critical, but I wanted them both to show the same values.

To calibrate the sensor, I took about 20 simultaneous measurements for the gauge and the sensor and plotted them in Excel as an X-Y chart. This isn’t as easy as it sounds, because the readings need to be taken when the pressure is fairly stable. After running the pump, it takes a while for the pressure to slowly reach equilibrium, and that’s when you need to very quickly take a note of both values! It’s also difficult to read figures very accurately off the gauge.

These measurements gave a reassuringly good straight line fit (below), which suggests that both the gauge and sensor have good linearity. Using Excel, I then added a trend line to the chart and read off the scale and offset values directly (Excel has an option to display the equation), as shown below.


To correct the pressure sensor reading, the value is scaled by the reciprocal of 0.9385 and the offset 0.829 is subtracted. These parameters are stored in a configuration file, so they can be easily changed if required.

This simple calibration process worked out really well and means that the pressure sensor readings displayed on the LCD (and stored in the log files) now match the mechanical gauge exactly!

Making a Portafilter Wall Mount

I always seem to have Portafilters lying around on the kitchen worktop, partly because I have a couple of them (the original Gaggia filter, and a naked PF), and partly because I tend to leave them off the machine after cleaning. Some kind of wall mount seemed like the solution, but I did a quick search and didn’t find anything suitable, so decided to have a go at making one.

Wood seemed like a natural choice, to avoid damaging the Portafilter, and being easy to work with. I started with some 45x45mm scrap soft wood, and routed out two 70mm diameter holes (I made a temporary MDF jig for the router to cut this radius). Then I routed slots for the Portafilter handles (about 19mm for the standard PF, and 16mm for the naked PF) as shown below:

Portafilter Wall Mount

The next stage was to chisel out some slots to accommodate the “ears” on the Portafilters. This was pretty easy for the naked PF, but it took a bit more work to shape it to suit the original Gaggia PF, mainly due to the big flared handle on the PF. I put a 45 degree chamfer on the lower front edge of the block, to make it easy to insert/remove the Gaggia PF.

Having finished the wood work, I sanded it smooth and treated it. After searching for a suitable “food safe” coating, I settled on pure Tung Oil. I didn’t thin the first coat (to avoid mixing in any toxic thinners/solvents!) and it worked out fine. I applied three coats at 24 hour intervals, sanding lightly between coats. Each coat was applied with a brush, left for 20~30 minutes, then the surface was wiped clean with a rag.

Portafilter Wall Mount

Here’s a view after the final coat. It seems to give a nice smooth finish, and is apparently resistant to water, alcohol etc. Time will tell how well it lasts in daily use!

Portafilter Wall Mount

Here’s a top view showing the recesses needed to accept the “ears” on the Portafilters. The left side is for the original Gaggia PF, which needs a very large area removed to allow it to be lifted in/out easily. The right side is for the naked PF and needs a much smaller recess:

Portafilter Wall Mount

Here’s a view of the two Portafilters slotted into the wall mount bracket. Now I just need to drill a couple of holes and mount it! I’m planning to leave this for a week or so to cure properly before using it in earnest.

Portafilter Wall Mount

Here’s a final update, showing it mounted on the wall with a couple of 8×2½” screws:

Portafilter Wall Mount

PCB Design for Es(pi)resso IGBT Driver Board

In the process of updating the IGBT driver in my coffee machine with the new design using the TC426, I decided to replace the strip-board with dedicated PCBs. I’ve separated out the high voltage section which interfaces to the pump IGBT, making a standalone board (which could potentially be useful for other projects).

Here’s the circuit diagram for this new board, which I’m calling the “IGBT driver” board (imaginative name, eh?):


Since I had one driver spare in the TC426, I decided to expose this by adding another opto-isolator. So there are two opto-isolated IGBT drivers available (initially, I only need one of these to drive the pump).

There’s a 4-pin connector JP4 which takes two 3V3 logic inputs IGBT1_IN and IGBT2_IN. When driven high, these will enable IGBT1 and IGBT2 respectively (driving the IGBT Gate high). This connector also has an open-collector output PWR_SENSE_OC which will be pulled low when the mains power is on. This can be used by the controller to safely detect when the pump driver is powered on.

The mains power input is by screw terminals on JP1. In my machine, this is connected to the front panel pump switch. This powers up the AC-DC converter, and provides the non-isolated 5V rail (referenced to Neutral) used for the IGBTs. The IGBTs are not fitted to the board, as they need high current wiring, and potentially heat-sinks also, so this design gives more flexibility with installation. There are two headers JP2 and JP3 which provide Gate connections for the IGBTs. In my setup, the IGBT Emitter is connected to Neutral through the wiring loom.

For the PCB design, I opted for through hole rather than SMD for ease of assembly. It’s crammed onto a 60x50mm board, to save space, and reduce manufacture costs. The PCB was manually routed in Eagle:


The low voltage section on the right has a small copper plane, but the rest of the board is naked tracks (having big filled areas at mains Neutral seems undesirable…) There are slots under the opto-couplers OC1, OC2 and OC3 for isolation purposes. Hopefully these will manufacture OK as this is a bit of an unknown for me!

Here’s a rendering of the board, created using GRBV:


I’ve just sent this off to for manufacture, and I’m now waiting to see how that turns out!

Pump PWM: High Voltage testing with Oscilloscope

Although I’ve had PWM pump modulation working in my Gaggia Classic for a while now, and have been working on an updated design, I never actually put a ‘scope on the high voltage output side, mainly due to the difficulty of doing this safely without a differential probe. Today, I finally got around to trying it.


To limit the voltage to a sensible range, I used a potential divider made of a 180k and 1M resistor in series across the pump, then connected CHA and CHB inputs of the ‘scope across the 180k resistor. The ground clip of both CHA and CHB was connected to EARTH (the ‘scope is also earthed of course). This means that our voltage measurements will be relative to earth, rather than a differential measurement between two points. However, the math functions on the ‘scope (e.g. CHA-CHB) can be used to simulate differential measurements if needed (provided the voltage range of the ‘scope isn’t exceeded!)

The figure below shows the voltage measured at the pump for one cycle, using 1ms/div and 5V/div on the ‘scope. The PWM frequency was 1kHz, and the mains frequency was 50Hz. Therefore, there are 1000/50 = 20 PWM pulses visible in the graph below.


This graph is taken from CHB, measured at the point where the pump coil is connected to the IGBT collector. The CHA measurements look very similar. Frankly, I was surprised how clean the waveform looked! There is a little distortion, but it looks pretty good, considering the high frequency switching.

The PWM frequency isn’t synchronised with the mains frequency (being derived from the CPU crystal oscillator), so the PWM waveform slowly drifts relative to the underlying 50Hz mains sine wave. However, this shouldn’t make any appreciable difference to the output power of the pump, given the high PWM frequency.