I realised that there was a problem with the power supply I had built. The LED will be on the end of a long wire; suppose there’s a short circuit in the wiring: the power supply will drop the voltage to keep the current at 600 mA, probably to a few tenths of a Volt – so far so good – but the problem is that the transistor will dissipate quite a bit of energy (13 Volts x 0.6 Amps = 7.8 Watts). That’s the amount that heated things up to 90 degrees in a previous test – and the power supply has a smaller heatsink.
So, I rebuilt the power supply using a different circuit. This time I used an LM317T variable voltage regulator. It does the same thing the old circuit did – adjust its resistance in order to vary the voltage so that the current remains the same. However, a voltage regulator has something the transistor does not – a thermal sensor. If the regulator get too hot it will shut down.
I found this case at Maplins. It’s designed to house a power supply so it has plenty of ventilation. Actually mounting things was a bit of a challenge. Holes need to be drilled in exactly the right place if things are to line up. I found the best way was to stick a piece of paper to the case, mark the location of mounting holes by drawing through the object to be mounted, and then drilling using the marks on the paper as a guide. All together, there are 31 holes plus one square cutout (for the USB connector on the arduino).
The heatsink attached to the right of the photo (which I already had) is for the voltage regulator and covers a large cutout in the case (presumably meant for a mains socket). The heatsink is mounted with a bolt at each end that goes through the heatsink, the case, and a metal strip that I cut to strengthen the case around the cutout. There are two nuts on each bolt to make sure they don’t work loose.
The regulator has a TO-220 case – three wires and a metal end with a hole through – so it could be bolted to the centre of the heatsink using the threaded hole already there. The wires attach to the power supply board just inside the case, on which are the resistors used for current sensing – two 1 Ohm and one 0.1 Ohm resistors in series. The power dissipation of the larger resistors was each 0.36 Watt (0.6 A squared x 1 Ohm) and the smaller resistor was very small (36mW). The 1 Ohm resistors are rated 3 Watts because I couldn’t find that value in less than a 3 Watt rating. In practice they all got pleasantly warm.
The TO-220 case you can see in the picture (next to the big white resistors) is another voltage regulator. Its job is to reduce the 13.2 Volts coming in, to something the Arduino can handle (i.e. 9-12 Volts). It’s actually a 10 Volt regulator. The orange component sticking out is a 0.1 uF capacitor. That’s needed to smooth the input to the regulators.
Fortunately, I have a box of assorted nuts, bolts, screws etc. from previous electronics projects. The arduino is mounted on four nylon spacers with nylon bolts that screw through the arduino onto the top and metal bolts that screw through the case onto the bottom. There is circuitry on the arduino very close to the mounting holes, meaning that any metal mountings could create a short-circuit. The switches are attached to an L-shaped bracket (that I already had) bolted to the side of the case.
In fact, I found drilling such small holes – especially the 2.5mm holes in the heatsink for the self-tapping screws – is rather exacting. Firstly, it’s really not a good idea to use a drill intended for hanging shelves. I bought a Dremel instead. It works really well, now, but I had to resolve two problems first. The chuck it comes with only opens wide enough for Dremel accessories. If you want to drill holes you need to buy a bigger chuck. Fortunately they are a good price on eBay. Secondly, the on/off switch and speed control comprise a slide switch on the body of the drill. Now, having very carefully lined up the drill to exactly the correct place, the last thing you want to do is push it to the side in order to turn it on. So I bought a foot switch and made a little junction box so I could set the speed and then start the drill without disturbing it. I also bought some rotary files for the Dremel that I used to cut out the square hole for the USB socket.
The LEDs are each screwed onto the back of one of the heatsinks (see previous post), and connected to the constant current power supply one side and the MOSFET switches the other. I had intended to have a row of sockets on the side of the case for the five pairs of wires to the LEDs. Then I realised that I was running out of space, and plugs+sockets are actually quite expensive, so in the end I used a terminal strip (at the time you could buy then individually). The problem I had was that the 10 metres of 1 Amp bell wire I bought on eBay is basically plastic with a wisp of wire in the centre. I couldn’t screw the wire into the terminal strip without it breaking. In the end I had to get a thick piece of copper wire, wrap it around the plastic insulation of the bell wire, solder the wire middle to it and screw that into the terminal strip. So far, it’s holding ok.
Finally, the two potentiometers and the switch connect to the Arduino with five wires (positive, negative and three variable voltage outputs) (not shown in the photo). There’s an in-line fuse holder with a 630mA 20mm fuse – just in case – attached to the power socket on the left of the lid. (In fact, it uses about 680 mA because the constant current regulator is set to just over 600 and there’s a few tens of milliamps going to the Arduino, but fuses are not exact.)
So, screwed together, and three coloured knobs later, here’s the finished object: