DIY LED driver for reef lighting

Just use the autorouter in Eagle. It will be good enough for this circuit and with 2 layer boards you are almost guaranteed to get 100% routing even if you cram all parts together. At least that's what I'm doing for a PH module and it seems to work. I can also recommend BatchPCB for their prices. The boards are good quality and my guess is for this circuit it will cost you less than $20 total. Last note, if you use BatchPCB and the sparkfun job file, make sure you endable the names layer on the silkscreen as it is disabled by default :)

However, if you're going to be putting any significant power through the device (and you are [grin]), make sure you set the trace widths to be appropriately wide to handle the current. Eagle will (by default) use trace-widths more appropriate for digital electronics than for power-carrying.

There's a nice calculator here that gives you a good idea of what to use. Typical board-house copper is 0.5oz/ft^2 thickness, so use that as the thickness, type in the current, and look at the lower results block for 1- or 2-layer boards. I usually round up if there's a fractional mil width (and add some extra mil for peace-of-mind).

It's also worth noting that some board-houses will take an Eagle .BRD file (they're listed on the cadsoft.de site). I tend to use PCB-pool for my orders because it takes one more item off the list of things I can screw up, and you get to see all the stages your PCB is going through, as well as getting a free solder-mask sheet with the order.

EDIT: I envy you all with routing machines at home :)

[grin] They're very expensive, but worth every penny imho. I managed to get a "good" deal on mine and got ~$6k off the list price because the guy selling it was no longer the EverPrecision dealer and didn't want it any more. Still cost $4k though.

ok we now have three PCB experts who is going to step up and help out

Well, I'm already working on one that uses the STCS1, but I can help out with advice perhaps...

Simon
 
But, autorouters don't make "pretty" tracks. :lol:
:lol: I still don't understand pretty tracks :)

der_wille_zur_macht said:
BatchPCB would probably be my choice for smaller runs (i.e. prototyping this) but since I'll need at least 20 or 25, and some other folks will need at least a few dozen, I bet we could cut their price by half if we went with a shop meant for bigger volumes.
True, for bigger volume it makes sense to use other fab houses.

SpacedCowboy said:
However, if you're going to be putting any significant power through the device (and you are [grin]), make sure you set the trace widths to be appropriately wide to handle the current. Eagle will (by default) use trace-widths more appropriate for digital electronics than for power-carrying.

Wow, according to that calculator if the thickness is 0.5oz/ft^2 for 1 amp it will require 62mil traces! Dang! A 8mil trace handles about 200mAh.
 
Wow, according to that calculator if the thickness is 0.5oz/ft^2 for 1 amp it will require 62mil traces! Dang! A 8mil trace handles about 200mAh.

Well, actually that's for inner tracks on greater-than-two layer boards (those tracks which are not exposed to air). It takes a 23.7mil track to handle 1A on an external layer (and of course both layers on a 2-layer board are external layers). Still significantly wider than 8 mils though :)

Simon
 
Sorry for the off-topic post, but is that *really* your milling resolution and not your table resolution ? If so, colour me impressed!

If I spec an area to route, it is usually within 0.001" of what I requested. Much to my surprise actually. I believe the machine spec is worse than that (0.003") but 0.0015" is what I get consistently.

My machine is very heavily built. It's a K2 that is 48"x24". The gantry is massive and I use a full size Porter Cable router.

Your Z profiling is sorely needed. It's hell to route a circuit board because of board flex. The copper thickness should not vary measurably but the FRP substrate is always sporting some warpage.

If I ever get serious about routing boards I really need to make a vacuum chuck. Then I'll surface the vacuum chuck and IT will hold the copperclad down flat.

Thanks for the further info on your tool's SW.


DWZM; All the boards I normally get are 1oz not 1/2oz. That helps with your widths a lot. You can also request 2oz

I've gone clear up to 4oz but that costs a bunch.
 
If I spec an area to route, it is usually within 0.001" of what I requested. Much to my surprise actually. I believe the machine spec is worse than that (0.003") but 0.0015" is what I get consistently.

My machine is very heavily built. It's a K2 that is 48"x24". The gantry is massive and I use a full size Porter Cable router.

Wow. What colour is "impressed" ? [looks down]. Oh, that colour!

When I first got the router, I made a "circuit" which was basically sets of 20 parallel lines at 1mil track/gap then 2mil, then 3 mil, ... 10mil with 4" length and test-points at the ends. The 4 mil ones (and above, obviously) were all 100%, the 3 mil ones were about 90%, the 2 mil ones were about 50%. I had thought it was more to do with the copper not adhering sufficiently to the FR4 than the table accuracy at *really* low track/gap, but if you're seeing it work, I guess not.

To be honest, that's "good enough" for my requirements. I can fit 2 traces in-between two pads separated by a 0.5mm gap which helps fanning out from BGAs significantly. I just have to remember that the board-house I usually use only offers 6mil track/space :)

Your Z profiling is sorely needed. It's hell to route a circuit board because of board flex. The copper thickness should not vary measurably but the FRP substrate is always sporting some warpage.
Yeah, that's the (ahem) accurate way to describe what I was trying to say. At the moment, my high-tech method of holding the copper on the routing table is ... Duct tape, but with the z-profile, I just set it up and leave it to route :)

DWZM; All the boards I normally get are 1oz not 1/2oz. That helps with your widths a lot.

I just checked my board-houses, and you're right, they're all 1oz. That does help a lot. Apologies for the miscommunication.

Simon
 
Back on topic. . .

(Sorry guys, I'm green with envy :lol: )

I've been doing a little light reading on capacitor selection and I think I'll be keeping the two electrolytics, but changing to a different part. Even though we're not running these at their limits, the parts used in OnSemi's reference designs are all spec'd "better" than the parts I used, in terms of life, ESR, and/or ripple current ratings. The good news is that better parts (on all these specs, not just lifetime) are only like 10 or 20 cents more.

So, instead of the 100uF cap I spec'd on the output, I'll probably use this:

http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=565-1601-ND

And instead of the 220uF cap on the input, probably this:

http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=493-1905-ND

Unless someone can talk me out of it, that is.

Also, I have the components fit on a 1" x 1" PCB in Eagle and am fooling with the routing. It doesn't look like it'll be too hard at all. I get way too much satisfaction out of playing with boards and schematics in Eagle, despite the fact that I'm probably REALLY bad at it. :lol:
 
...I was wondering if anyone has found a different material to mount these lights to...

I've used Wakefield 658-35AB individual heatsinks in my 10G nano and they work well. I'm planning a 40 breeder and I think I'll do the same (otherwise I'll need two 8.5x36" heatsinks from heatsinkusa...). 72 heatsinks will cost you about $60 bucks. I'll be doing 60 leds (30 white, 30 RB) and I'm planning to use individuals mounted on strings :)

Which brings me to the drivers:
Der, how are you planning to dim 25 drivers using a single Arduino? :) I'm guessing port extenders? I'll probably take 10 PCBs when we get to that phase but was thinking about the dimming part.
 
I've used Wakefield 658-35AB individual heatsinks in my 10G nano and they work well. I'm planning a 40 breeder and I think I'll do the same (otherwise I'll need two 8.5x36" heatsinks from heatsinkusa...). 72 heatsinks will cost you about $60 bucks. I'll be doing 60 leds (30 white, 30 RB) and I'm planning to use individuals mounted on strings :)

I'm really on the fence about heatsinks. The heatsinkUSA option is certainly enough heatsinking, but it's gigantic and expensive. Building a rig on it doesn't give you much flexibility.

Which brings me to the drivers:
Der, how are you planning to dim 25 drivers using a single Arduino? :) I'm guessing port extenders? I'll probably take 10 PCBs when we get to that phase but was thinking about the dimming part.

I'm going to do it in banks. Don't know how many yet, but I won't be using 25 individual channels.

If I need more channels than I have (which is pretty much guaranteed to happen) I'll use a port expander. The TLC59xx products have really good support on the Arduino, and I have some of them laying around, so I'll probably use that. Ironically, they are meant to be LED drivers themselves, but can operate as a 16 channel PWM port expander, too. The other option is to just get a Mega or Mega clone, I suppose.
 
I'm really on the fence about heatsinks. The heatsinkUSA option is certainly enough heatsinking, but it's gigantic and expensive. Building a rig on it doesn't give you much flexibility.

Yeah, we can certainly do better than these gigantic heatsinks....


I'm going to do it in banks. Don't know how many yet, but I won't be using 25 individual channels.
That makes sense but if you want to do a nice simulation of sun movement in the sky you want to be able to control all of them :D


If I need more channels than I have (which is pretty much guaranteed to happen) I'll use a port expander. The TLC59xx products have really good support on the Arduino, and I have some of them laying around, so I'll probably use that. Ironically, they are meant to be LED drivers themselves, but can operate as a 16 channel PWM port expander, too. The other option is to just get a Mega or Mega clone, I suppose.

That's interesting. I have not seen PWM port extenders before. Will the arduino have enough current to handle all drivers? I have not looked at the current requirements.

RGibson said:
who sales wakefield heatsinks?
I got mine from Mouser. Part # 567-658-35AB. As der_wille_zur_macht said, they have the best price for them when you go above 10.
 
That makes sense but if you want to do a nice simulation of sun movement in the sky you want to be able to control all of them :D

Depends on exactly what features of sunlight you want to model, and how, I guess.

That's interesting. I have not seen PWM port extenders before. Will the arduino have enough current to handle all drivers? I have not looked at the current requirements.

There are lots of PWM port expanders - I'm considering this one because there are some good Arduino examples for it, including a library full of useful functionals. It can do 16 channels, and only consumes 2 or 3 pins on the Arduino. I will have some I2C devices (consume 2 analog in pins), some one-wire devices (consume 1 GPIO pin), these TLC chips (a few GPIO), a pH meter (one analog in), and some general purpose digital inputs and outputs - float switches, relays, etc. (probably using a port expander). So I should have plenty of pin capacity overall.

The datasheet for the NCP3066 specs the ON/OFF pin current at 5V to be 15 microamps. That's pretty insignificant.
 
Hi Willi,

Can you control more than one driver off one pwm port? I thought you could but want to be sure. I will have 15 banks of 8 and I'm using the Mega board.

I think I spotted a minor error in the schematic you posted. Shouldn't C3 be the electrolytic and C5 be a standard disc?

So does anyone have some code for the arduino written yet that they want to share? I'm just getting started writing mine but it's always nice to see how others are doing things.
 
Hi Willi,

Can you control more than one driver off one pwm port? I thought you could but want to be sure. I will have 15 banks of 8 and I'm using the Mega board.

Absolutely. The drivers draw very low current on the ON/OFF pin so it should work fine.


I think I spotted a minor error in the schematic you posted. Shouldn't C3 be the electrolytic and C5 be a standard disc?

Perhaps. I've actually revised the schematic for my own use, and re-named all the components from scratch. The names I used on that schematic were a mixup of names on the example schematics from the vendor, and my own corrections/additions. This was tough, because their own schematics have lots of typos, so trying to mix in my own names made it messy. The new schematic doesn't match up to their documentation, but it's a little more standard.

I've also done a version of the driver that combines two on a single PCB. I'm pretty sure this is what I'll use in production. It cuts the number of power connections in half, but it's still a reasonable power load on the board that you don't have to use outrageous trace widths. I'm going to include a jumper that lets you run both off the same PWM signal, or separate them out. Also, I'll include space for some "extra" features so it should work for the widest audience. It's a 5cm x 5cm board that should cost around $2 in reasonable quantities (i.e. a few dozen). That means it's very close to the same cost as the cheapo protoboards I've been using to date, but vastly cleaner and more functional. The design is still all through-hole, and it's roomy enough that it should be very easy to build for people like me who aren't soldering savants. Once I'm happy with this PCB I'll get a few prototypes, then probably order three times more than I need to get the cost way down and have extras available.

I also did a PCB for a single instance of the driver, crammed on to a 1" x 1" board. It would probably be difficult or impossible to actually build at that size (the components are pretty much mashed up against eachother), but it was a fun exercise.

So does anyone have some code for the arduino written yet that they want to share? I'm just getting started writing mine but it's always nice to see how others are doing things.

I have way more than I can keep track of (literally - it's spread across three PCs and I have no reasonable version control, so it's a big mess). Most of my code assumes there's a DS1307 RTC on I2C to get a time and date from, then does various things from there (dimming for sunrise/sunset, sun moving across the sky, moonlights, refugium lights, different lengths of day throughout the year, cloud cover and "stormy" days, etc). Each implementation will be different enough that people will probably have to adopt code to a specific build, but it shouldn't be hard to do, especially since there are lots of people using Arduinos to control LED drivers. Once I have this driver design squared away, I'm going to start a thread specifically about Arduinos for LED control, and hopefully people will be willing to share there.
 
So does anyone have some code for the arduino written yet that they want to share? I'm just getting started writing mine but it's always nice to see how others are doing things.

The problem with arduino code is, everyone seems to have a slightly different set of functions/chips and the code is not universal, so unless we get together and do standard reef it will not be too useful to read others' code.

My sunset/sunrise also depends on a RTC (DS1302) and also uses a remote control to manually move the LED intensity up or down.

I'm not home now, but tonight I'll post what I have so far in terms of dimming.

In reality it comes down to writing a value between 0 and 255 to the PWM pin, the rest is just noise :)
 
Comments from the EE's please:

ncp3066_2brd.gif


The labels need to be cleaned up, and I need to add holes for mounting the thing on standoffs. Did I commit any sins?

I used a ground plane, tried to keep small caps near the ICs, and routed the PWM signals on the bottom of the board. All other traces are 24 mil, which should be more than enough (checked with the calculator provided a page or two back).
 
Comments from the EE's please:

ncp3066_2brd.gif


The labels need to be cleaned up, and I need to add holes for mounting the thing on standoffs. Did I commit any sins?

I used a ground plane, tried to keep small caps near the ICs, and routed the PWM signals on the bottom of the board. All other traces are 24 mil, which should be more than enough (checked with the calculator provided a page or two back).

By no stretch of a tortured imagination could I be described as an EE, but in the good-old tradition of going where angels fear to tread [grin] here's a few comments, though this is mainly personal style. I do think it looks good overall.

  • I prefer to pour a ground-plane on both sides (top and bottom). Eagle will figure out where it makes sense to have one, and where the circuit becomes too busy. You can end up with lots of vias doing this though, so YMMV. For me, it means I mill less copper :) If you do pour copper on 2 sides, you can put vias close by the heating elements (excuse me: chips) and they can dissipate heat on two copper planes, not one.
  • If you're getting this board made professionally, it doesn't really matter because the holes will be plated-through, but putting tRestrict boxes around the hidden solder points (eg: under the capacitors) will make it easier for the home-brewer because they can then be soldered from the non-component side.
  • I prefer to not run traces along the edge of the board (see JP2).
  • Since you're not space-constrained, I might bump-up the separation between tracks/vias in the aurorouter - D1 looks like it doesn't need to be so close, for example. This is nit-picking though...
  • I tend to put a revision number as text on the top, so I know whether the circuit is the latest version, 3 months later :)

Really, it looks fine to me. None of the above are crucial changes, and it's mainly a matter of style. I'm sure there'll be people who disagree with some of the above anyway :)

Just a back-of-the-envelope calculation to get the worst-case power usage:

  • Assume the output is 700mA => 700 mA
  • Assume output variability of 10% => (700 * 1.10) => 770 mA
  • Assume input-to-output efficiency of 90% => (770 / 0.9) => 856 mA
  • 2 channels of this => 2 * 856 => 1.712 A

    =>PCB track width required = 24.8 mils (from calculator)

Now, I'm obviously making some assumptions here, and they may not be correct; I haven't read datasheets or anything and your output variability might be a lot less than 10% (which would make a big difference) but if that central red trace that goes by C10,C5 is carrying VCC (which it looks like it might be) I might make the tracks a little wider, just to be sure.

You can get variability in the output from ripple in the output signal or from cumulative errors in ancillary components (resistors, capacitors, thermal effects etc). The STCS1 datasheet assumes 10%, your chip may be far better - this is why I was shooting for 900mA in my design, 900+90 is still less than 1000 :) I couldn't remember your circuit's efficiency either, so I guessed at 90%.

Simon.
 
BIG NOTE: I'm not even close to an EE
My suggestions:
- I would suggest you skip tValues and just place tNames inside the blueprint of the part where possible and close to it where not. It makes it very easy to populate with just a BOM.
- The caps you are using are polarized, so please indicate which pin is positive :D
- Also I think it makes sense to allow for 1A driving traces. Back on the topic of longevity, after about 5000hrs the leds will lose their first 5% so it would make sense to up the current by 35mA to compensate (and keep doing about 1% increases every year or so)
That's about all I can add to Simon's notes
 
Simon and tera have vetted things pretty dang well.

1) I'll add agreement with board edge traces. You can have them but keep them back from the edges 50mil. Move that connector inboard a little.

2) Right angle turns in traces are not allowed. Naughty, naughty. This causes electron bruising as they smash into the walls.
It also causes etching problems as the inside corners hold etchant and over-etch.

3) Label some test points even if they just point to a resistor lead or something. V+, GND, etc.

4) Turn R5 and its pal 90 degrees.

5) In every case where you have a big cap and you run the trace by sending a diagonal off to a cap lead - don't. Run the trace thru the cap lead directly. If you have some procedural issue with this then make the stubs as short as you can. C1 is a disaster in the making BTW.

6) I don't know about that NCP chip but usually you want bypass caps associated with most ICs. I see none. (0.1uF)

Looks good otherwise. Nice job.

Oh, you could cut that board down by at least a 1/3 possibly 1/2 if you wanted to.
 
The arduino's internal clock is simply a milliseconds counter, so it's not really THAT bad - you just need to convert or do math to get things right, and be prepared for when it resets (it overflows the variable it's stored in every 9 days or so). Also, since it resets when the chip is power cycled, you need to program it with some flexibility. And it's probably a few seconds a month inaccurate.

I used an RTC (real time clock) to avoid some of these problems - it's a little more accurate, and can store a full date and time, plus if you provide it with a coin cell backup it won't lose it's memory when the power goes out.

I'm going to go ahead and do an arduino thread, but probably not till next week or after New Year's, so stay tuned.

Did you start your arduino thread yet?
 
Back
Top