Category Archives: Electronics

A Turn Signal Beeper for the Vespa GTS 300



I wasn’t sure whether it was worth writing this project up, as there are several descriptions already on the internet of people tapping into the Vespa alarm header in order to make a turn signal beeper. However the ones I’ve seen are all very simple direct connections of a piezo buzzer to the turn signal wires (via diodes). This project is a little more sophisticated in that it uses my old friend, the PICAXE microcontroller (see my “Pimp my Rocket” post for another PICAXE project). It’s still quite a simple circuit, but it has allowed me to program how and when I want the buzzer to sound, and has allowed me to audibly distinguish between the left and right turn signals. I’m not going into great detail here, but I thought a quick write up might give others some ideas for their own projects.

The problem to be solved is a common one for many motorcyclists, namely sometimes forgetting to turn the turn-signals off.  This of course sends the wrong signal to other motorists and is potentially dangerous, or at least annoying. It also makes you feel like a chump if you’re the offender. My bike, a Vespa GTS300ie Super, has no audible turn signal warning. It has single dash light for the turn signals – but this is of limited use if you forget because, well, you’ve forgotten and you’re looking at the road ahead, not checking the dash. The last time I forgot to turn off my turn signal I thought, right, I’m going to fix this. I remembered the piezo buzzer that I had removed from the annoying kettle (see my post on de-beeping a Kitchenaid kettle) and thought that it would be suitably ironic to make good use of a device that previously had such a useless function. Unfortunately when I tested it, it wasn’t loud enough to be heard on the road! I had to go out and buy another piezo which was specified as  12V, 15mA (max.), 3.3kHz, 90dB (distance not specified, but loud enough to be easily heard through helmet, engine noise and moderate wind noise).

The circuit drawings below don’t show diodes on the turn signal inputs. They should not be necessary since the left and right turn signal wires are not being connected to each other (which without diodes would result in both signals flashing together). You might notice, however, that my circuit board below has diodes. When I first built it on a breadboard, I had the turn signals connected as a single input and thus needed diodes. When I decided to separate them for greater functionality I figured it wouldn’t hurt to leave the diodes in.


circuit drawings

Figure 1. Parts of the circuit, and the pin-out for the Vespa alarm header plug. Note that the PICAXE  chip (an 08M2)  itself is not shown. Note also that only one turn signal input voltage divider (top right) is shown – two are required, one for the left and right signals.


The parts of the circuit shown above are the power supply for the PICAXE chip, which takes inputs from the +12V and ground pins of the alarm plug, the voltage dividers (top right) which take the 12V from the turn signals down to about 4.3V for the PICAXE inputs, and the piezo switching transistor (top left) which allows the 12V piezo to be driven by the PICAXE.


Figure 2. I etched my own circuit board using the laser print to Canon glossy photo paper and iron-on technique.

Figure 2. I etched my own circuit board using the laser print to Canon glossy photo paper and iron-on technique. In the photo, the laser toner has not yet been removed, which I do by wiping with xylene solvent.


Figure 3. The completed circuit board.


In figure 3 above, the blue and white wires go to the right and left turn signal pins of the header plug. The red and black wires go to the switched +12V and ground pins of the header plug. The two header pins on the circuit board connect to the piezo buzzer. Note that there is no PICAXE serial programming circuitry, which is why the 08M2 PICAXE chip is in an 8-pin I.C. socket – so that it can be removed for re-programming on a breadboard. You might also notice that PICAXE pin 4 is connected to an unused pad. This was for possible future use such as connection to a brake signal.


Figure 4. The circuit in a box, with the piezo buzzer connected.

Figure 4. The circuit in a box, with the piezo buzzer connected.


The smallest box I had easy access to was about twice as big as necessary, but it still fitted in the space available (see below).


Figure 5.  The box plugged in to the alarm header, ready for testing.

Figure 5. The box plugged in to the alarm header, ready for testing.


The alarm header plug is located behind the left “knee cover”. I have a Stebel air horn mounted in this space, but still found room for my circuit box. In fact it was quite good, because the box is quite snug in there and doesn’t move or vibrate. I didn’t have the male counterpart to the alarm plug, so I had to make do with diode lead off-cuts soldered to the wires. I found that these (which have a diameter of 0.7mm) fitted snugly into the connector. It’s not ideal, but will do until I can find a proper plug.

The way I have programmed it to work (and I won’t include my inelegant code here) was to have a short beep every three seconds while the left turn signal is on, and a short double-beep every three seconds when the right turn signal in on. Thus I can tell not only that the flasher is on, but also that the correct flasher is on. These beeps continue for about 45 seconds (15 x 3 second loops), after which the program switches to a more intrusive “mimic” mode where it continuously looks at the turn signal inputs and switches the buzzer on or off to match (equivalent to a simple direct piezo connection circuit). The short “peeps” every three seconds are enough to remind me, but not so obnoxious that they are annoying. And the 45 seconds is long enough to get through waits at traffic lights. It all works really well, and is already an indispensable addition to the bike.



De-Beeping a KitchenAid Kettle


Stopping a KitchenAid kettle from beeping, at all.

My wife and I were recently in the market for a new electric kettle and were having trouble finding one of suitable quality and visual appeal. Eventually our attention was drawn to the KitchenAid KEK1722 kettle which, although somewhat expensive, seemed to offer what we wanted. We don’t own any other KitchenAid products, but thought that as it is a respected premium brand, there wouldn’t be be any issues with it right? Wrong. Once again, I didn’t bother to check online reviews. If I had, I would have quickly noticed a very common complaint with this product – it produces a very loud cheap-sounding piezo beep every time a button’s pressed, when the water’s boiled (three beeps!), even when you just put it on the base. And there’s no option to turn the beeps off. To quote Amazon reviewer Charlie2095, who ended up sending his kettle back:

At first the beeping isn’t a big deal. After a while, it becomes annoying. Then grating. This thing beeps for every reason it can think of. It even beeps when you set it back on the base! What the heck for? “Beep! I am back on the base!” “Beep! You just pushed a button! Beep! You pushed another button!”

It astounds me how some of these products get through the design process and out the door with such an annoying and in this case totally unnecessary “feature”. They’ve obviously put some careful consideration into the visual design, but what happened after that? Did they just hand if off to the electronic design guys and say “here you go, we’re done with the visual design, just do what you want and throw it in a box”. Did they not do any customer testing on the final product?

It’s not just the fact that it beeps too much, it’s also the quality of the sound. We have a Samsung dishwasher that beeps, but it is a quieter and more acceptable polyphonic chime, not a cheap loud piezo buzzer screech. At the extreme end of the scale, our Asko washing machine (mentioned in another post) has no beeps at all, and it’s no problem from a functional point of view.

Anyway, like Charlie2095, I put up with it for a couple of days, then couldn’t stand it anymore. But I didn’t send it back, no, I got out my soldering iron and fixed it good! So if you came here because you have an annoying KitchenAid KEK1722 kettle, and you don’t mind voiding your warranty, here’s how to do it. Note that I would not recommend this procedure to anyone without electronics soldering experience and a good temperature controlled soldering iron.

To silence the beeps, you need to locate and remove the piezo buzzer. The circuit board containing the buzzer is located under a cover on the bottom of the kettle itself (not the kettle base that plugs in to the wall). You will need to remove two triangle recess screws (photo below). I didn’t have the correct screwdriver bit, but I managed to use a tri-wing bit. Even a simple flat-bladed jewelery screw driver of the right size will work. Before you start, remove the AA batteries if installed. Remove the triangle screws and carefully lift off the cover.

Start by removing the batteries if installed, then remove the circuit board cover which is held in place by two triangle recess screws (blue arrows)

Start by removing the batteries if installed, then remove the circuit board cover which is held in place by two triangle recess screws (blue arrows)

You should now see the circuit board with the piezo buzzer as shown below. There are three connectors, indicated by yellow arrows, that will need to be unplugged so that you can lift up the board in order to de-solder the buzzer. These connectors were covered with a hot-melt glue in my kettle, so the first task was to very carefully prise away the glue. Once the connectors are un-plugged, remove the three philips screws holding the circuit board (blue arrows). This should allow the board to be lifted from the right hand side as viewed in the photo. You will need to hold the connector wires back out of the way to get the board past them.

The main circuit board exposed, showing the offending piezo buzzer (red arrow), the three screws that need to be removed (blue arrows) and the three connectors that need to be pulled out (yellow arrows)

The main circuit board exposed, showing the offending piezo buzzer (red arrow), the three screws that need to be removed (blue arrows) and the three connectors that need to be pulled out (yellow arrows)

You should be able to lift the board enough (the two wires that pass across the blue capacitor can be pulled out of the base a bit to give some slack) to get in behind with a soldering iron and remove the buzzer (the black component indicated by the red arrow above).

The three connectors removed and the circuit board carefully lifted up.

The three connectors removed and the circuit board carefully lifted up.

I didn’t take photos of the de-soldering because I was on my own, but I just gently pulled on the buzzer with a pair of pliers as I heated each of the two pins in turn on the back side of the board. There are some surface mount components near one of the pins, so be very careful with the iron. Once the buzzer is gone, push the board back down and replace the screws and connectors.

No more buzzer! The board is back in place with screws in and connectors reattached

No more buzzer! The board is back in place with screws in and connectors reattached

Put the batteries back in and replace the covers. That’s it! No more beeping, just the gentle sound of heating water.

Moment of truth…yes, it still works!

Moment of truth…yes, it still works!

Solar iDevice Charger in Atomic Punk Style


For a while I’ve been keen to build a solar powered charger for my phone and iPad, mainly because I wanted to have a play with solar power – something I haven’t done before. It certainly wasn’t to save money. I think I calculated that it would take several lifetimes of daily device charging to pay off the investment in parts. Anyway, I recently completed the project and thought I might showcase it here. The internals aren’t that interesting, being all off-the-shelf parts, but I was particularly satisfied with the way the external design worked out. It’s a style I have dubbed “atomic punk” – a sort of steam punk variant with a 1950-60s technical aesthetic. Let’s go straight to a photo of the finished charger in action.


The coiled black lightning cable is an essential part of the aesthetic.

The case is made from plywood scraps, and is finished with brushed on “Hammerite” hammered silver finish paint to give it that 50’s technical equipment look (note that before painting with Hammerite I sealed the plywood with a coat of water based varnish). The top panel and sloping instrument panel are removable to allow access to the battery and wiring. The instrument panel has two analog meters, one indicating battery voltage, and one indicating the current being drawn by externally connected loads. It also has a 5A fuse (connected between the battery and the load), a power switch and indicator lamp (filament of course). I really wanted a nice 60’s era coloured glass-bezel panel lamp, but I couldn’t find one. The switch switches the load to the battery, and the lamp indicates when load power is available.


The power conversion and USB interface circuitry necessary for charging phones and iDevices is provided by two off-the-shelf 10W Belkin USB car chargers. These are plugged in to a twin car accessory socket mounted to the top panel.  I actually started out by building my own USB interface with a small buck converter to provide the step down from 12V to 5V, and circuitry to provide the appropriate voltages on the USB data lines as required when charging Apple devices (2.7V on both data lines lines – as measured on a recent 10W Apple charger). It worked, but I wasn’t sure how to neatly integrate the USB sockets, and my circuitry was large and unweildy compared with the neat and compact off-the-shelf car chargers. So in the end I gave up and went with that solution.

Inside the box. Note the ventilation holes in the base. There is another set of holes on the rear face of the box.

Inside the box. Note the ventilation holes in the base. There is another set of holes on the rear face of the box.

On the inside, the box contains a 9Ah, 12V sealed lead-acid (SLA) battery connected to a Genasun GV-5 MPPT charge controller. Also connected to the controller is a lead running to a 20W monocrystalline solar panel (max. power at 17.2V / 1.17A). The panel is actually mounted flat on a carport roof, but seems to easily provide enough energy to keep up with daily phone and ipad top-ups (at least in summer – we’ll have to see what happens in winter).


The photo above shows the meter readings when charging an iPad at maximum rate. The ammeter was reading about 50mA high at this time, and the light bulb consumes about 70mA, so we are seeing an energy draw by the USB charger of about 0.88A x 13.5V = 11.9W. I haven’t measured the actual current draw on the 5V side of the charger, but the Belkin units are rated at 2.1A at 5V, or 10.5W, so that’s not a bad conversion efficiency. With an iPhone and iPad plugged in, the maximum 12V side current draw is about 1.5A. If the two devices are topped up daily from say 75% battery, this level of current draw is required for maybe up to an hour, after which it tails off to zero as the device batteries reach full capacity. Looking at the discharge rate data for the SLA battery (see graph below), at a 1.5A discharge rate the battery will be flat in about 5 hours, assuming no input from the solar panel (e.g. charging at night). However, we don’t want to completely drain the battery, ideally we only want to take it down to about 70% capacity. This would happen after about 1.5 hours of discharging at 1.5A, which is just about perfect for its intended duty.

The amount of energy that you can extract from a lead-acid battery depends on how fast you extract it. Something to keep in mind when you are sizing your battery.

So that’s it, the “Fusionmaster Deluxe” nuclear fusion powered device charger. I hope you enjoyed reading about it.

Pimp My Rocket (Espresso Machine)

Combining Coffee and Electronics – An Idea for a Project

Having played around with fixed function logic ICs, such as the Johnson counter used in the Spindicator project, I was keen to move on and experiment with programmable microcontrollers. I decided to obtain and play with some PICAXE chips, as they looked like they would provide an easy introduction to using microcontrollers. Soon enough I was flashing LEDs and building touch-activated computer power switches. But what I really wanted to try was using the chip to control the colour of an RGB LED. For a suitable project I came up with the idea of using a strip of RGB LEDs to provide accent lighting for my Rocket Espresso coffee machine, where the colour of the LED would depend on the temperature of the machine (specifically the inlet water to the brew head). I thought this had the potential to not only look pretty, but actually provide useful visual feedback on the all important brew water temperature. If you are reading this because you’re a coffee geek interested in E61 HX type espresso machines, you may want to skip the electronics part and read the last section to see how it turned out.

PICAXE is a low-cost, easy to use microcontroller system which uses a simple BASIC like programming language. I’m not going to provide a tutorial on how to use and program PICAXE chips in this post. If you are interested in that, the PICAXE website has excellent documentation, free programming software, and lots of circuit and code examples. There are several different PICAXE chips you can buy, with different numbers of inputs/outputs and different inbuilt functionality. The inbuilt PICAXE function that is central to this project is PWM (pulse-width modulation).

Controlling RGB LED Colour with PWM

An RGB LED is actually made of three LEDs under one lens, a red, blue and green LED (I’ll call these sub-LEDs). Each sub-LED can be switched on separately, so you can switch on blue and red to get purple for example. By switching each sub-LED completely on or off  you can make six colours (red, blue, green, purple, cyan and yellow). In order to gain access to a complete spectrum of colours, you need to be able to precisely control the brightness of each sub-LED, and the way to easily do that is via pulse-width modulation. PWM controls the brightness of an LED by switching it on and off very fast (20,ooo  times per second in my program), and controlling the amount of time it is on during each on-off cycle. The time for an on-off cycle is called the period (50µs in this case), and the time of the on pulse as a percentage of the period is called the duty cycle. So a for duty cycle of 50% at 20kHz, the LED will be switched on for 25µs, then off for 25µs. The switching is too fast for the eye to see, and so the overall result is that the LED will just look half as bright. Thus the LED brightness is directly proportional to the duty cycle. Most PICAXE microcontrollers have a PWM control function built in and accessible on one or more of the chip’s pins (see pinout diagrams in the PICAXE manual). Some PICAXE chips also have separate PWM control circuitry referred to as “HPWM”, or hardware PWM. The circuit and program described below uses the software PWM function. To control an RGB LED you need a chip with three (or more) independent PWM outputs such as the 14M2 or the 20M2. For this project I used the 20M2.

Close-up of the RGB LED strip used in this project. Note that the strip has current limiting resistors built in, and uses a common anode configuration.

The Circuit

The circuit for this project is fairly simple as the PICAXE microcontroller does most of the work. For the LEDs I used a strip of six RGB LEDs. These  are pre-wired to a strip of adhesive backed flexible circuit board as shown in the photo above. They come on a long roll which can be cut to any multiple of three LEDs. Initially I was going to use two sets of six, one mounted under the Rocket on each side. Consequently, this circuit is designed to drive 12 LEDs, and can drive up to 15 using the transistors and resistors specified. When I tried it though, I didn’t like the look of the reflections of the individual LEDs off the stainless steel bench on which my machine sits. In the end I decided to use one strip of six mounted behind the machine and reflecting a nice diffused colour off the wall behind. The first circuit diagram below shows the power supply for the PICAXE and LEDs. The 12 volt DC input is supplied from a small 500 mA 12V plug-in power adaptor. This 12V input is used directly as the power supply for the LEDs, and also as the input to a 7805 voltage regulator with 5V output. The 5V rail powers the PICAXE chip and peripheral circuitry. I added a small LED to the 5V output as visual confirmation of PICAXE power on. The switch on the 12V input is to assist with programming the PICAXE (the best way to program the chip is to initiate transfer from the computer with the power off, then quickly switch the power on). To save space I implemented this switch with a simple two pin header and jumper, which is actually a bit fiddly. If I were to build it again I would use a proper PCB-mounted mini toggle switch.

Power supply circuit

The rest of the circuit is shown in the diagram below. It can be divided into four parts; the 20M2 PICAXE chip itself, the serial programming interface circuit, the thermistor voltage divider and the LED switching transistors.

Click for larger image

The serial interface part of the circuit consists of two resistors and a 3.5mm stereo phono jack,  and is the standard minimum serial communication circuit as specified in the PICAXE literature. This can be used with either a simple serial cable (for connecting to a computer serial port, if your computer still has one), or the PICAXE USB  cable. For a temperature sensor I used a standard 10KOhm NTC thermistor (a component whose resistance changes in response to temperature). The thermistor forms half of a voltage divider with a 2.4K resistor, the divided voltage being read by the PICAXE analog to digital conversion function (ADC). The value of 2.4K was chosen to give a reasonably linear relationship between the divider voltage and thermistor temperature over the range of interest (25 to 120°C), as well as the greatest change in voltage over this range. This relationship can be calculated, and is shown in the plot below for my thermistor, which has a specified calibration constant (beta) of 4,100K.

The PICAXE ADC function converts the voltage at the input pin to a number between 0 and 255  in direct proportion to the voltage. This number is then used by the program to calculate and adjust the duty cycle of each sub-LED (red, blue and green). Because the LED strip requires a supply voltage of 12V, and because a PICAXE output can only sink or source up to 20mA, the LEDs are switched via three BC337 transistors (for my final 6-LED configuration, I could have also used BC548 transistors with say a 2KOhm base resistor). For the particular RGB LED strip I used, I measured the 100% duty cycle current per sub-LED at 6.2mA (red), 5.5mA (green) and 5.7mA (blue). Thus for a strip of six LEDs, the maximum current that any transistor will switch is 37mA. In the circuit shown above, the BC337’s can switch 100mA and remain saturated (probably more, but that’s a safe figure), which means that the circuit will safely switch a strip of 15 LEDs (they come in multiples of 3 remember). By reducing the base resistor value you could switch a lot more LEDs, as BC337’s have a maximum collector current of 800mA (you may need a gruntier 12V supply than I’ve specified though, and don’t forget the PICAXE per-output 20mA maximum current, with 90mA maximum per chip).

After going to some trouble to design a PCB layout in Illustrator, I decided that I couldn’t be bothered trying to etch a circuit board, so I made up the circuit using a prototype board and jumper wires, with screw terminals to connect the power supply, thermistor and LED strip. The board is illustrated below.

The circuit board

The prototype board. Not very elegant, but it does the job.

The Program

Of course the circuit above doesn’t do anything interesting until you load a program into the PICAXE. Programs are written in a simple language modelled on BASIC, but with many commands specific to the PICAXE functions. These include ‘readadc’ which measures the voltage on a pin and converts it to an 8 bit number (used for reading the thermistor), and ‘pwmout’ which sets the pwm duty cycle of an output pin. Again, there’s excellent documentation on these commands available on the PICAXE website. If you click on the link below, you can download my program in open document format, which you should be able to open in your word processor of choice (WordPress does not seem to allow uploading plain text files). You can simply copy and paste the text from this document into the PICAXE Programming Editor.

PICAXE BASIC Program for Rocket LED Controller

Here’s a brief description of how the program works. The objective of the program is to ramp the LED colour from blue through green to red in response to increasing brew water temperature as monitored by a thermistor attached to brew head water inlet pipe. The two important parameters that need to be set in the program are the thermistor readings that will correspond to 100% blue and 100% red. The half way value for 100% green is calculated from these by the program. I obtained the red and blue values by measuring the thermistor resistance when the machine was cold and fully hot (which happens about 45 minutes after switch on out of interest). I converted the resistance values to PICAXE ADC readings using a spreadsheet (the same one that produced the graph above). You could also directly observe the ADC readings by writing a simple program that reads the thermistor and reports the value back to an attached computer using the PICAXE debug function. The program uses the range of ADC values corresponding to 0-100% duty cycle for an LED and calculates a scale factor for converting the ADC value into a duty cycle output for the LED. Note that the PICAXE duty cycle output value is not a number between 0 and 100 as you might expect, but is calculated from the PWM frequency and the clock frequency of the chip itself. It’s all a bit confusing, but there is a ‘PWM wizard’ function in the programming software that helps you calculate the values to use. In this program, the PWM output values range from 0 to 400 (corresponding to 0 and 100% duty cycle). Anyway, having initialised these values, the program then enters the main loop where it reads the thermistor value and determines if it falls the blue-green ramp or the green-red ramp. It then calculates the appropriate duty cycle output for the two ramp colours (the third colour being off) and issues the pwmout command for all three colour channels. It then returns to the beginning of the loop, reads the thermistor again, and checks to see if the value has changed. If not, it just keeps re-reading the thermistor until it does.

Installing the Thermistor

So having built and tested the circuit, the next step in this project was to install the thermistor into the Rocket. In this case, I attached it to the copper pipe that supplies water from the heat exchanger to the brew head (I’ll talk a bit more about this below). The top panel of the Rocket can be removed for easy access to the brew head plumbing. Here’s the thermistor installation in pictures.

Thermal compound is applied to the water inlet pipe

Teflon tape holds the thermistor against the pipe. A short length of adhesive foam is then wrapped around it for insulation.

A final layer of foil tape completes the installation.

Installing the LEDs

As I mentioned in the above, I eventually opted for a strip of six LEDs installed at the back of the machine so that they reflect diffuse light off the wall behind. The LED strip adhesive stuck well to the polished stainless steel case. Importantly, it also seemed to be removable without damage to LEDs or case. However to test the set-up I just exposed a little adhesive at each end of the strip, and that’s how it has remained attached so far.

The LED strip attached behind the machine.

The End Result

Most of the measured temperature rise occurs in about the first 15 minutes after switching the machine on, so that’s about how long it takes the LEDs to change from blue through green to red. Over the next half hour or so the temperature does increase a few degrees more as the whole machine warms up to a steady equilibrium temperature. I decided that the best way to show what the heat-up looks like was to make an animated gif image from a series of stills. The quality’s not great, but you’ll get the idea.

An animated sequence showing the LED colour change as the machine heats up from cold.

Out of interest, the circuit draws 49mA from the 12V supply when operating, which gives a power consumption of 590mW. Of this, the LEDs consume about 330mW

More Than Just Pretty Lights?

The objective of this project was not just to make pretty accent lighting for the Rocket, but to also see if it could provide useful visual feedback on the temperature of the water entering the brew head. It is essential that this temperature is right if you want to make good coffee on a heat exchanger E61 type espresso machine like the Rocket. Actually it is essential on any machine: the brew water temperature needs to be in a certain range in order to make good espresso (85-95°C). Different machines have different ways of achieving this temperature. In heat exchanger machines there is a water boiler which is maintained at a certain temperature, usually around 120-125°C. This boiler provides steam for milk frothing, and is also the heat source for heating the brew water. The pipe taking cold water to the brew head passes through the boiler so that the brew water is heated and will be in the correct temperature range when it hits the coffee, hopefully. Unfortunately there is more to achieving the correct brew temperature than just the  boiler temperature and design of the heat exchanger. Firstly, the machine needs to be properly heated up (at least 45 mins for the Rocket, especially if you want to do more than one shot) as getting the correct temperature requires the pipe-work and brew head to be warm. To keep the the E61 brew head warm, which is a large chunk of brass, the pipework forms a loop between the heat exchanger(HX) and the E61 head. This creates a convective flow as water in the head cools and flows back to the HX and water in the HX heats and flows up to the head. This also helps keeps the water in this ‘thermosyphon’ loop cooler than the boiler temperature, but in the rocket (and I suspect most machines of this type) it still quickly becomes too hot for making coffee. Reading my thermistor, I observed the head inlet pipe stabilise at 113°C when the machine was properly warmed up. So before you make your coffee you need to flush the over-heated water from the inlet pipe. However the machine design relies on some heating of the loop between shots, and on the heat stored in the brew head, to achieve the correct water temperature. If you keep running water through the HX and out the brew head, the water will quickly become too cold to brew coffee! It all sounds a bit tricky, but remember that these machines are based on a commercial design, and you can see how it might work in that environment: you pull a shot and while you clean and refill the portafilter the loop water reheats just the right amount, then you pull another shot. At home the machine is more likely to be sitting idle for a long time between shots, which makes controlling the temperature more of a challenge.

So do the LEDs help? Well sort of. I found I use the LED colour as an indication that I’ve got my flushing about right.  So, if the machine has been warming up for an hour, or sitting idle for a time, the LEDs will be red and I know from experience that the loop will be too hot, probably in the order of 113°C at the head inlet. The first step is to grind and tamp some coffee. The next step is to flush the over-heated water to drain. When I start the pump I can observe the super-heated water boil and splutter as it comes out of the head. After some seconds, the boiling will stop as the water temperature drops below 100°C. At this point I leave the flush running for maybe 5 seconds, which brings the temperature at the head down below brew range (around 80°C). There is a lag in the thermistor response, so a few seconds after stopping the flush I observe the LED colour stabilise to greenish-yellow. During this time I lock in the portafilter and get a cup ready. Now I wait for usually 30-50 seconds so that the cool water in the HX can heat, and the water at the inlet warm back up, but not above the acceptable brew range. This is indicated by the LED colour changing to a yellow- orange. Then I pull the shot. The LED’s certainly aren’t essential, but they’re fun and I think I’ll keep them.

Here’s a short video I made to illustrate the process:

Hmm, I don’t know why the captions are dropping off the bottom. I’m not very good at this video making business.  Anyway that’s about it. I hope you enjoyed reading about this project as much as I enjoyed doing it.


UPDATE July 2013

I thought I’d just add a note here to say that my Rocket LED lights are still going and have now become an essential part of my coffee brewing process. The technique I’ve settled on is to run a 10 second flush of the grouphead after it stops spluttering (see paragraph above). While this flush is running, I grind and tamp the coffee. After some seconds the lights will change to green and then slowly back through yellow to light orange. It is at this point that I pull the shot. Currently, with low ambient air temperature in the morning, this happens anout 1 minute and 20 seconds from the beginning of the flush.

Spindicator Mk 2–Now With Fade Effect.


I’ve had a couple of questions asking about using capacitors to fade out the  LEDs of the spindicator to give a sort of trail effect, and I thought I’d like to try it myself. So let’s get straight to the circuit.

Spindicator with Fade

The first thing to note is that in this version I have used the computers 12V supply, not the 5V supply as in the original spindicator. This is necessary to obtain a good fade effect from the capacitor.

The motherboard interface and low pass filter are the same as in the original circuit. The difference is that the counter’s outputs now switch  general purpose NPN transistors (a BC 547 in this case). When a transistor switches on, its associated LED is lit via the 1k Ohm resistor, and the 47uF electrolytic capacitor charges. When the transistor switches off, the capacitor discharges via the 1k Ohm resistor and LED, fading the LED as the charge dissipates. The fade time is a function of the values of the resistor and capacitor; the larger the values the slower the fade. The resistor is also the current limiting resistor for the LED, so that sets a limit to its value (between 470-1000 Ohms for most LEDs). What I found with breadboard testing is that if the fade time is too long, the whole spindicator ring lights when there is lots of disk activity, and you lose the spinning effect. I found that a 47uF capacitor gave a noticeable but suitably quick fade to each LED.

A challenge I faced with this circuit is that it has many more components than the original spindicator, with an extra 10 capacitors, 10 transistors and 20 resistors. The prototype board and patch wires approach would be too big and messy, so I decided to make my own PCB. With some trial and error I managed to get a reasonable result by laser printing (Brother HL-2170W) a design onto some Canon glossy photo paper (GP-401) and using an iron on its hottest setting to transfer the toner to a blank copper circuit board. It required some hard pressing to stick the print to the board, and then more working over the areas where the traces were with the tip of the iron. What I found though is that the paper then pulled away cleanly, leaving the traces stuck to the board. There was no mucking around soaking off the paper in water as others have reported when using this technique. If some of the traces pull off with the paper, you can just clean the board with some xylene based brush cleaner and try again with a fresh printout.


The above photo shows my copper board with its toner transfer sitting in the ammonium persulphate etching solution. You’ll notice some rough edges on the left hand ground trace, but there was enough cover left so I didn’t bother to print it again.

The end result, with components all soldered in is shown in the photo at the beginning of this post. I’ve connected all the LED cathodes together (not shown) so that there is only one common cathode wire and 10 anode wires running to the LEDs. I have not yet installed this spindicator – I’m waiting for the next time I’m doing some work inside the server (probably when I upgrade to WHS 2011).

Here’s a quick video of the spindicator mk.2 working at a constant clock frequency of about 25 Hz. The background sound in the video is rain on my workshop roof.

The “Spindicator” Project

In this post I’m going to describe my attempts to date to build a novel computer hard-disk activity indicator, which I named the “spindicator”.


The usual hard-disk activity indicator is an LED connected to a header on the motherboard which illuminates when data is being read from or written to the hard drive. These reads and writes often happen many times in quick succession, resulting in the characteristic rapidly flashing LED  during periods of high disk activity. A while back I built a nixie clock from old Russian  nixie tubes. A related type of old-school discharge tube is the dekatron, which is a decade counting tube. I love the look of the spinning warm glowing dots of a dekatron counter, and wondered how I could possibly use one in a project. Then I had the idea of using one as a spinning computer disk activity indicator, or “spindicator”, with the activity pulses from the motherboard advancing the dot around the dekatron. There were a couple of problems with this idea, firstly I didn’t have a dekatron on hand, and secondly I didn’t (and still don’t) know how to design the high voltage  circuitry for driving one. So I decided to begin by building a simulated dekatron from a ring of ten LEDs, and trying to drive this with the disk activity signal from the motherboard.

Selecting a Counter

A quick look at my old Digital Circuits & Microprocessors textbook from university (I’m not an electronics engineer, I just took the course out of interest) and I could see that simplest type of counter that would produce the required output, a sequentially advancing logic high output, would be a mod 10 ring counter. One could be easily built from flip-flops, but ring counters do not use flip-flops efficiently. A mod 10 (decade) ring counter requires 10 flip-flops. A modification of the ring counter is the switchtail counter, also known as the Johnson counter. This only requires 5 flip-flops to produce 10 unique output states. The disadvantage is that to get a single advancing high output from this counter requires decode logic to be added to the flip-flop outputs. Luckily, however, a mod 10 Johnson counter complete with decode logic is conveniently and commonly available in integrated circuit form as the 4017 decade counter. The counter has 10 outputs, Q0-Q9, which respond to the positive edge of a clocking waveform as illustrated below.

Basic RGB

Figure 1. Response of the 4017 outputs to the clock input

This is exactly the output required to drive the spindicator LEDs. With the counter sorted, the next task was to figure out how to connect it to the motherboard HDD activity header.

Connecting to the Motherboard HDD Activity Header Pins

I did a bit of digging on the internet to try and determine the nature of the HDD activity signal at the motherboard header. I  found a description of the SATA disk activity signal, with example host side implementations (figure 2) in the Serial ATA specifications.

fig 60 SATA

Figure 2. Example host LED drivers (source: Serial ATA  Specification Revision 2.5, figure 60 )

The specifications state that the device (the SATA hard drive) will provide an open collector (or drain) active low activity signal. Exactly how the host (the motherboard) uses this signal to drive an LED is largely up to the board designer. The two circuits given in figure 2 are examples of possible host implementations. In a circuit of type B,  it would be easy to directly obtain an active low clock waveform from the header by shorting the two header pins, provided the open circuit voltage on the positive pin was the same as the supply voltage used to power the 4017 counter. I later determined that my board (a Gigabyte EP45-UD3R) had a B type circuit, and that the open pin voltage was +5V. However, initially I considered that the easiest way to obtain a signal was to use an optocoupler. That way I didn’t need to know the nature of the motherboard circuit or voltage. An optocoupler, such as the 4N25 that I used, is a nifty device consisting of an infrared LED and photosensitive transistor all contained in a small 6-pin IC. A signal is passed through it by way of light alone, allowing physical separation of parts of a circuit. For this project, the optocoupler’s LED can be connected to the motherboard HDD activity header pins in place of the regular HDD activity LED. When there is disk activity, the LED will light and switch on the opto’s transistor. The switching of this transistor provides the logic pulse to drive the counter clock.

Putting it all Together

Version 1: The Positive Edge Triggered Spindicator

It can get a bit confusing when you try and follow the waveform from device through to counter, but let’s try. The device (hard disk) provides an active low signal to the motherboard. The m/b uses this in such a way that an LED connected to the header will light when the device signal is low, as can be seen from figure 2. So when there is activity, the opto LED will light and switch on the transistor. If the opto’s NPN transistor collector is connected to V+, and emitter connected to ground, then a logic signal taken from the collector will be low when the transistor is on, i.e. when there is activity. The 4017’s count is triggered by the positive edge of a clock waveform applied to the Clock input. From our deduction above, if this input is connected to the collector of the optocoupler’s transistor, the count will advance at the end of each activity period (as the HDD activity LED goes from on to off). Such a device I call a negative edge triggered spindicator, named because it is the high to low transition of the optocoupler LED pulse that advances the count. Now of course there’s absolutely nothing wrong with this, it makes no difference to the operation of the spindicator, but for some reason I felt that the count should be advanced when the LED turns on, not off, which in my nomenclature would be a positive edge triggered spindicator. One way to do this would be to add another transistor as a logic inverter. However it turns out there’s an easier way (apart from not bothering with it at all). If you have a look at the 4017’s datasheet you will see that as well as a Clock input, there’s a Not Clock Enable input (this is usually written as Clock Enable with a bar over it, but I can’t do that here). This input is active low, so if you tie it to logic low, the counter will respond to the positive edge of the clock waveform at the Clock input. If  Not Clock Enable is high, the counter will not respond to the Clock input at all (it will not enable the clock as its name says). The thing that caught my attention was another manufacturer’s datasheet for the 4017. In this one, Not Clock Enable was called Not Clock (written as Clock with a bar over it), indicating that it was the logical inverse of the Clock input — just what I needed to change the triggering edge. Looking at the (simplified) internal logic of the IC, figure 3, you can see how it works.

4017 Waveforms

Figure 3. How the 4017 clock inputs are logically combined

If Not Clock is held low, then the output from the AND gate will exactly mirror the Clock input. If the Clock input is held high, then the output from the AND gate will be the inverse of the Not Clock input, and the counter will effectively become negative edge triggered with respect to a waveform at the Not Clock input. Anyway, the upshot is, that by holding Clock high and connecting the signal from optocoupler to Not Clock I could get my positive edge triggered counter as defined above. In hindsight I shouldn’t have bothered as I later ended up changing it back to negative edge triggered version anyway, as you’ll read below.

For the spindicator output, I chose ten 3mm clear-lens green LEDs. I found that connecting these directly between the outputs of the 4017 counter and ground gave adequate brightness without the need for additional switching transistors. So here then is the circuit as built and tested for the positive edge triggered spindicator.

Spindicator Small

Figure 4. The positive edge triggered spindicator – the count is advanced at the beginning of a disk activity period.

I built and tested the circuit on a breadboard using a 5V power supply, as I planned to tap into the computer’s 5V supply in the final version. To test the circuit I used  either switch pulses, or the output from astable 555 timer to simulate disk activity. After verifying that everything worked, I built up the circuit on a piece of prototyping circuit board and mounted the LEDs on a circle through a 3.5” drive bay cover plate, as can be seen in the photo at the beginning of this post, and the photos below. I should mention that my computer case is a mess after years of mods, and now sports no front cover, so these cover plates are exposed. It’s quite good, as I’m not worried about drilling a few holes. I’ve also taken to using foil tape as a type of grungy exterior case finish, so unused holes just get taped over.


The spindicator circuit board. I used IC sockets so that I could reuse the ICs if the thing turned out to be a failure. A terminal block is used to tie together the LED cathodes (brown wires).


The back of the circular LED array. Some of the LEDs were a bit loose, hence the messy hot melt glue job.

An early modification I made to this particular computer case was to rip out some top-mounted unused firewire/USB/audio ports and install a top window and fan. Handily, the cables for the firewire and audio ports were terminated in lots of individual header pin connectors. These have kept supplied with pin connectors for projects ever since, including those I used here to connect the HDD activity header to my spindicator circuit. The local electronics store provided the 4-pin molex connector needed to connect to the computer’s 5V power supply.

I made the above video clip with my webcam to better show how the first spindicator (the positive edge triggered circuit of figure 4) worked when installed in the computer. In the first part of this clip the hard drive is actively storing a file which is being downloaded. In the second part it is mostly idle (apart from saving the webcam video). As can be seen, the active drive activity consisted of multiple very rapid pulses (some don’t even show in the 30fps video) with longer pulses in between where the light appears to briefly pause. This gives the spindicator an interesting but slightly chaotic looking behaviour. When idling, there are very rapid bursts of usually 8 pulses, resulting in the light appearing to jump backwards by two places every couple of seconds. I couldn’t capture this exactly in the video as the computer was also recording the video. Overall I wasn’t very satisfied with this behaviour, and started to consider how I might be able to filter out the high frequency pulses to give a more consistent rotating look to the spindicator.

Version 2: The Negative Edge Triggered Spindicator with Frequency Cut-Off

It struck me that to remove the very rapid pulse sequences I could use the charging or discharging of a capacitor via a resistor to introduce a time delay in the triggering edge of the counter clock. I’ve since discovered that this arrangement is known as a low pass filter (you can tell I’m an electronics amateur). When I sat down to work out the circuit I realised that the easiest modification to make was to introduce a delay in the rising (positive) clock edge by charging a suitable capacitor through the existing 10K resistor. I did work out and successfully test a circuit for a discharging capacitor delay on the falling clock edge, but it was not as straightforward as the charging capacitor. Of course this meant that the counter needed to be triggered by the positive clock edge, so I also has to switch the wires around and apply the clock signal to the Clock input, and tie the Not Clock input to ground. I built up a test circuit on the breadboard and tested the circuits using a 555 timer generated clock signal of variable frequency. I determined that I probably needed a 0.47µF capacitor to do the job. In the test circuit this seemed to cut off frequencies greater than about 100Hz, although when I tested it in the modified hard wired circuit it cut off frequencies greater than 160Hz. Because I wanted the ability to try different caps in the final version, I wired up some unused pins of the optocoupler’s IC socket and just plugged the capacitor into that. The modified circuit is shown in figure 5 below.

spindicator with charging capacitor

Figure 5. The negative edge triggered spindicator with low pass filter – the count is advanced at the end of a disk activity period, provided the time between pulses exceeds a threshold value determined by the capacitor and resistor.

I should note here that it is of course possible to use a different value for the charging resistor if you want to use a different resistor/capacitor combination. I have used a 10K only because it was already soldered onto my board from the first version of the circuit.

I reinstalled the modified spindicator with a 0.47µF capacitor and found that it worked really well. The jumpy behaviour was now gone and the device had fluid spinning motion. The result can be seen in the video below.

I was so pleased with this version that it has remain installed in my computer. I also disconnected my power LED, as the spindicator has the advantage of acting as both a drive activity indicator and power LED because one of its LEDs is always on.


The modified circuit. Note the white capacitor plugged into the IC socket.

Postscript: Direct Connection Without An Optocoupler

Early on I had though about the possibility of obtaining a clocking signal directly from the motherboard header. Although I decided to use an optocoupler, I wanted to go back and see if I could drive the counter without one. The first requirement was that the positive header pin be at the same open circuit voltage as that used to power the counter. A check with the meter (connected between the open positive pin and the computer case) revealed that the pin was at +5V, so that was ok. The second requirement was that the motherboard driver circuit was of the B type (figure 2). In this case, the two header pins could simply be joined together to provide a driving signal. This turned out to be the case with my motherboard. The problem was, I still wanted to include my low pass filter, and I couldn’t do this if I directly connected the motherboard signal to the counter. I would need to use the signal to switch a transistor, essentially making it the same circuit as above but with a direct connection rather than an optical connection.

I built up the circuit shown in figure 6 on a breadboard (although with just 3 LEDs) and put it beside the open computer case so that I could connect it to the header pins. Sure enough, it worked like a charm, showing that it was possible to connect a transistor directly. However it’s really no more difficult or expensive to use an optocoupler, and it removes any uncertainty regarding the motherboard circuit design. If any reader of this blog should want to build a spindicator, I would recommend the optocoupler route.

spindicator with charging capacitor

Figure 6. An alternative to using an optocoupler – using the motherboard header signal to switch a transistor directly. This may not work in all cases, and use of an optocoupler is recommended.


Testing the direct connection circuit of figure 6 using 3 white LEDs. The green lights in the background are the interior illumination of my computer case.

Well that about concludes this long-winded post. I hope it’s been of interest to someone. I certainly had fun building the circuits. A guess at some stage I should try and figure out how I might build a spindicator from a dekatron tube. If anyone has any ideas about how to do it I love to hear them.

UPDATE: Using Transistors to Drive the LEDs

From the comments it seems that some folks are having trouble driving their LEDs directly from the 4017 counter. The other option is to use some general purpose NPN transistors such as BC 547s to drive the LEDs, although this does add several components to the circuit. The  circuit below should do the trick (only the modified counter output shown, the rest is as before). Note that you should change the value of the LED current limiting resistor (160 ohm below) depending on the characteristics of the LEDs you’re using, and the current you want to run them at.

Converting a 3-Wire Bi-Colour LED into a 2-Wire Bi-Colour LED

I recently noticed that when one of my computers entered a sleep state its power LED went off, leaving no way of telling if the computer was asleep or off. When my other computer enters an S3 sleep state, its power LED flashes to let me know. I pulled out the motherboard manual to see if I could find an answer. It turned out that the motherboard supported a dual-colour power LED, which would switch colours when the computer entered a sleep state. If only a single colour LED was present, as in my case, it would go off when the computer went to sleep.

What was required was a bi-colour LED with two leads. Such an LED contains two LEDs of different colours, which are wired cathode to anode and visa versa. If the current flows one way, one LED will light, and if the current is reversed, the other LED will light. I didn’t have such an LED, and a search of my local electronics store’s web site showed that they didn’t either. What I did have in my box-of-tricks was a fancy three-colour RGB LED with four leads; a cathode lead for each colour LED, and a common anode lead. Sometimes a similar arrangement is used for bi-colour LEDs, i.e. they have three leads, one of which is a common anode or possibly a common cathode. What I needed to do was convert my common anode LED into a bi-colour, two wire type suitable for the motherboard. This can be done with couple of normal diodes, as per the circuits illustrated below.

In this circuit, a 3-wire, common anode red/green LED is converted into a 2-wire red/green LED.

Here’s the equivalent circuit for a common cathode 3-wire LED.

With the circuit worked out, I went out and bought two 1N4004 diodes and wired them up to my RGB LED (using only the red and green cathode leads, as they were the colours I wanted).

The end result. The diodes are wired into the cable and covered with heat-shrink tubing (the bulge at upper right). So did it work?

At top, the computer awake with both the new green power LED and blue hard disk activity LED on, and at bottom, the computer asleep with the power LED switched to red!


Get every new post delivered to your Inbox.