For the previous project I used an Arduino Uno to control the LEDs. It worked fine, but it’s too large to fit inside the frame of this artwork. However, a little searching on the internet came up with the Arduino micro. It has all the same functionality as the Arduino Uno (with a few minor differences here and there), but it’s tiny. In fact, it’s not so easy to attach to anything, so I soldered it to a piece of Veroboard and drilled holes in that to screw it to the metal strip.
Also on this board was a voltage divider (two resistors in series) used to reduce the power supply voltage to 1/4, i.e. 3 Volts. This connects to one of the analogue inputs and allows the software to check that the supply voltage in within a safe range. This is important for the Flash in particular because a few milliVolts increase equates to a large increase in current through the LEDs.
Switching the candles
The Arduino can only deliver 20 milliAmps at 5 Volts, so it can’t run the LEDs directly. For the previous project I used BSS316N MOSFETs to switch the power to the lamps on and off. Since I had to buy a batch of 50 (albeit for less than a tenth of a penny each) I still had plenty left!
The next step was to attach the transistors. For the previous project I soldered them by hand to Veroboard. As the song goes, it’s like threading a needle with boxing gloves. I wanted to improve on that method, so bought a hot air rework station. It’s basically a temperature-controlled paint stripper. The basic process is to apply a blob of “liquid solder” to the copper surface where each of the component’s legs will be, place the component on the blobs of solder, and heat the whole thing up with hot air until the solder changes from a grey goo to silver solder. Let it cool, and, presto! What could possibly go wrong? Ha.
So, I practiced with a few really cheap zener diodes the same size, but this is my first attempt at the transistors. I thought I would do them individually, masking the previous ones with foil:
Here are some of the newbie problems I discovered:
- 1) The air flow moves the component (or sends it flying into the sink, never to be seen again)
- 2) The transistor is overheated and is damaged
- 3) Some of the joints don’t connect
[After lots of practice, I decided that it’s easier to solder them with a soldering iron, a head-mounted magnifier and a bright lamp. The one tip I would give is, don’t try to use stripboard – the holes are in exactly the wrong place. If you want to try the hot air process I recommend some videos on YouTube by people who’ve figured it out!]
Anyway, here’s the result (this was taken after I’d added all the other components). I did test the transistors before I added the other components, and they all seemed to work ok. But when it was all finished I discovered that one of the transistors had stopped working, and another one didn’t fully turn off.
I tried re-soldering the one that had stopped working, and eventually got it to connect, but then found that it, too, didn’t turn off fully (i.e. the LED glowed when the gate was at 0 Volts). So, that’s what happens to these little MOSFETs if you overheat them – they start to “leak” – in fact, once they start they get worse the more you use them.
By this point I had fallen out with Veroboard, and decided on a rather radical solution. I took all the transistors off and built a new board, with just (new) transistors on, and I attached this underneath the Veroboard, connected to it.
I used some blank PCB that I had from when I used to etch my own boards (I really wouldn’t like to say how many years ago that was…) and cut a small piece.
Then I used a rotary file in the Dremel to cut away lines of copper by hand to create tracks. Yes, I know, it’s not very elegant, but it proved to be a better solution than Veroboard.
I’m pleased to say that this worked perfectly, and also, it was much easier to solder on the transistors too. I discovered that it was easier to solder the transistors with the rework station as well.
Building the main circuit board
I used the circuit described in the previous post. The Arduino outputs connect to the right-hand side of the board, through 1k resistors (to limit the current) to the MOSFETs underneath (originally soldered directly to the board, then replaced with a separate board.
Also after the resistors, there are five diodes as input to the logic circuit. Output from the logic circuit goes (again via a limiting resistor) to a high-powered MOSFET. It’s a
TK35E08N1, rated at 55 Amps (yes, fifty-five Amps!) 80 Volts (cost: 33 pence).
There’s a reason for not using the same 1.4 Amp MOSFETs I used for the candles. I realised that, now there’s a temperature sensor attached to the Flash, there’s really no limit to how much heat I can generate there. So I decided to use three LEDs, each running at 1 Amp. (I would have used more, but there wasn’t room.) Below is the circuit layout I created (as seen from underneath – note that the IC pinout diagrams show connections from on top, so it needs to be reversed). The big square thing on the left is the power MOSFET.
This is the main circuit board (before I replaced the transistors (soldered underneath) with a secondary circuit board. Note the small variable resistor, at the top. I used this to calibrate the temperature cut-off point, i.e. 40k. The second mounting screw is underneath the MOSFET heatsink, in line with the hole so I can access the screw head. I used some plastic screws and spacers I bought on eBay.
It worked really well. When I tested the Flash (by turning it on and leaving it on) the temperature took about a minute and a half to reach 62 degrees C, at which point the Flash cut off. It came back on again at about 50 degrees. Interestingly, the range was narrower if i was using PWM with the Flash, suggesting that the hysteresis of the NAND gates is different when they are being turned on and off compared to a fixed state.
One more problem
So, after congratulating my efforts, and testing it with the LEDs at 9Volts (to reduce the LED brightness), I was ready to test it at the full 12 Volts. So I plugged in a 12 Volt mains adapter. Well, it worked for about 3 seconds and then the Arduino died. That’s it, nothing. Dodo.
What happened, I think, is that the voltage regulator on the Arduino micro doesn’t have any heatsink. I think that the current taken by the switches and the logic was too much for the regulator, and it failed. So I had to replace the Arduino. This time I used a nano. These are the same width but slightly longer, cost half the price (about £5 each) and, most importantly, have a visible, if small, heatsink attached to the voltage regulator. The only thing was I had to cut and solder another piece of Veroboard (which has two resistors underneath for the voltage sensor), which was quite a lot of work.
One other thing I discovered. If you connect a USB cable to the Arduino when there’s no power from the mains adapter then you get just under 5 Volts appearing on the Vin pin. In other words, the USB power is connected (back through the Arduino voltage regulator) to the rest of the electronics. Fortunately, that was just the LEDs, and they don’t conduct at 5 Volts, so no harm came of it. It’s a useful thing to know though, because if I had some resistive load connected (or even the external power adapter with a large empty capacitor) then it could well damage / destroy the Arduino’s voltage regulator, maybe even the USB port on the attached computer. From now on, I will power Arduinos through a diode.
[The Arduino micro was fine, until I connected it to 12 Volts (instead of the 9 Volts I’d been testing it with). Although the micro should be rated up to 12 Volts, it seems that the one I had was not. I replaced it with a nano, which is slightly bigger but still fits in the frame.]