Recently a friend of mine asked my help about replacing some 12V light bulbs with LED’s for longer battery life. After doing some searches the cheapest solution was to use a bunch of 5 mm white LED’s powered from a constant current source. A constant current source is not cheap to buy and since were in the spirit of making why not make that also. But where to start ? there are voltage regulators that you can turn into constant current sources, dc-dc converters that you can turn into constant current sources or you can choose a specialized circuit designed exactly for powering LED’s. Obviously the first option is the cheapest and simplest to implement but it comes with its drawbacks.

Anyway, I had everything needed on hand so I proceeded and designed a PCB in Eagle. I used two LM317 voltage regulators because I want to power two sets of LED’s. Each set of LED’s is composed of 28 LED’s tied in parallel. I’m gonna set the current on each LED to 20 mA so that is 560mA for each set of LED’s. I wanted to spread all that load on two LM317 so I used two.

28 x 5mm white LEDs wired in parallel Dual LM317 constant current source schematic

The PCB were easy to route and ended up like this:

28 x white LEDs in parallel PCBDual LM317 constant current source PCB

Kind of small and nice looking. The LED pack could of been smaller but since LED’s don’t spread light on a wide angle I decided to spread the LED’s a bit to spread the light. The LM317 board was designed so that it would fit perfectly under a heatsink I had around. Actually the heatsink is from an old video card I had in my junk box; its nice to reuse these things, its like recycling.

old video card ripped out of heatsink

I proceeded and used my DIY photo etching method but something went wrong and I messed up all of the PCB’s, they ended up looking like this:

messed up PCB

The thing is I stopped using ferric chloride a while ago. Instead I turned to ammonium persulfate which comes as a white powder that you need to dissolve in watter. The watter stays clear, it doesn’t smell and it doesn’t stain (not checked yet). It only catches a blueish color after you’ve used it and copper accumulates in it. The only disadvantage for using ammonium persulfate is that it etches slower than ferric chloride, other than that is great. The problem with mine is that it was mixed with water more than 6 months ago and it turns out it doesn’t last that long when mixed with water, so keep it as powder and only mix it when you need it. Unfortunately I couldn’t get more of it locally so I had to return to the good old ferric chloride. I did all the process again and the boards came out great this time.

The assembled LED packs look like this:

Assembled 28 led packsAssembled 28 led packs back

and the assembled LM317 board look like this:

dual LM317 constant current source assembleddual LM317 constant current source assembled

Notice how I designed the board to fit just over the raised part of the heatsink? its the little things that count 🙂 (and I’m not referring to the heatsink as you will read next). The LM317 pair was mounted on the back so that it sits firmly attached to the heatsink transferring all that heat.

here’s a photo between the heatsink and the pcb:

LM317 constant current source - between heatsink and pcbLM317 constant current source - between heatsink and pcb

I was pretty happy with the overall result until I actually run it. The heatsink got very hot pretty fast and it was clear it was not dissipating enough heat. With 12 V in, LED Vf of 3.4V , 560mA and an ambient temperature of 28 degrees C, the heatsink reached almost 80 degrees C. It turns out The LM317 is not very efficient in this setup and together with the sense resistor has to dissipate allot of heat. And a simple calculation would of shown this from the beginning if I paid attention to it.  (Vin-Vf.Led-Vadj)xIo => (12V-3.4V-1.25V)x0.56A= 4.116 W for each regulator, double that and the heatsink is just too small to dissipate that kind of heat. Not to mention the poor efficiency of the circuit. Its the little things that count , I would of done that calculation earlier I wouldn’t of made that circuit just to realize that is not good for my setup.

At this point I knew this option is not good and I had to find something else to power the LED’s. I could use a specialized circuit like the LM3406 which would give me the best efficiency but I would have to wait for delivery and get some more parts, or I could use a dc-dc converter modified as constant current source which would give me decent efficiency and I could build it with parts that I already have. I decided to go with the dc-dc converter modified as constant current source. I already have the TPS54232 from another project of mine; the TPS54232 is a 2A, 28V, 1MHz, step down SWIFT™ dc-dc converter. Now its time to design a new PCB for the new power source but more about this in the next article.