Comparison of MR16 50W 12V Halogens with LED lights

We have some low voltage Halogen spots (50W, wide angle 60°) in some portable demo kit and, aside from the Halogens being ineffecient and running very hot, they have a tendency to break if knocked. I wondered if these could be replaced with LED lights and did a quick comparison:

Beam angle (Degrees)606060
Colour temperature (K)300030002700
Colour rendering (Ra)90-10080-8980-89
Average lifetime (h)40002500040000
Luminous flux (lm)770575370
Normalised brightness175%48%

I could only find one real candidate for replacement (8W Sylvania). It’s not as bright as the original Halogen, so not a true 50W equivalent, and expensive at £22.64 versus £1.38 for the Halogen. However, the LED should last 6.25× longer, and uses 16% of the power.

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.

Low voltage testing of IGBT and opto-coupler switching times

I was keen to know how quickly the TC426 can switch the IGBT in my pump driver. As it’s slightly more difficult and dangerous to test at mains voltage, I decided to postpone that by carrying out some basic low voltage tests with the IGBT first, simply using an LED and 300R resistor as load from 5V to the IGBT collector.

First, as expected, there’s a small delay introduced by the opto-couplers and TC426. Using a dual trace ‘scope, I found that the gate voltage rises 3.2us after the rising edge of the PWM input, and falls 20.4us after the falling edge of the PWM input. This looks fit for purpose: the pulse would be delayed by about 3us and would be about 17us longer compared to the original pulse fed to the opto-coupler.

So, how does an IGBT rated at 14A and 400V perform at just under 10mA and 5V supply? Although the IGBT was perhaps a little disappointed at being asked to switch a paltry 10mA, it seems to perform well. Here’s a plot of the gate and collector voltage at 500us/div:


This appears inverted, because when the gate voltage is high, the IGBT switches on and quickly pulls the load (close) to ground. When the gate voltage drops, the IGBT switches off and the collector voltage rises again.

The gate voltage rise and fall is extremely fast (<200ns) and I didn’t measure further. The collector voltage also falls very quickly as the IGBT switches on. The plot above is at 500us/div, but here’s a closer view of the collector voltage rising as the IGBT switches off, plotted at 10us/div (and inverted):


Updated high voltage output stage for my Es(pi)resso Machine (muhahaha…)

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.