DIY LED driver for reef lighting

(In reference to the STCS1) Stu, I'm thinking about doing some prototypes with that chip right now. At least one or two other forum members are already using that chip. I avoided it in the first round because of the lack of a through-hole package, plus it's (likely) not as efficient since it's a linear reg. However, matched very carefully to a PS so the voltage was close to what the LEDs need I'm sure it would be close.

Those chips have a ground pad for thermal management under the chip, though. I suppose you could use conductive epoxy to glue that pad down, then solder the actual connections?

And it is *crucial* to match the PSU voltage to the circuit requirements, or at "high" power (0.7A), the chip *will* overheat and *will* shut itself down briefly, then on again, then off again, ad nauseum. Not only that, but Rin will have to cope with all the excess power that the STCS1 doesn't need. I burnt my hand by accidentally touching Rin while reaching to turn the power off... This is even with a lot of copper around to dissipate the heat.

Having gone through a couple of prototypes now, it's pretty cool (in every sense of the word :) ) when it finally works, but getting there needs some thought. [sulk] I prefer digital electronics to all this analogue stuff :D

Of course I managed to make things worse by using the Luxeon Rebels I had lying around (3.15v forward voltage drop) in a circuit designed for Cree XRE's (3.6v forward voltage drop) without re-reading the datasheet. With Vin at 19.95 volts (3.15x6 + 0.7v for the diode + 0.35v for the chip), everything runs nice and cool now... When I was pushing 24v through it, I got about 2 minutes before things started going haywire...

Just a precautionary tale :)

Simon
 
An updated "real" schematic as promised:

ncp3066driver.gif


This is just the schematic I posted on the first page with the modifications I mentioned when I posted it (ditching their dimming scheme and condensing R1 into a single resistor, etc.) Also, I corrected some of the part names - their schematic has some silliness (two C2's for example) so these names are a bit wonky, but correspond to the BOM I posted on the first page. I will revise that and post again soon if people are interested.
 
And it is *crucial* to match the PSU voltage to the circuit requirements, or at "high" power (0.7A), the chip *will* overheat and *will* shut itself down briefly, then on again, then off again, ad nauseum. Not only that, but Rin will have to cope with all the excess power that the STCS1 doesn't need. I burnt my hand by accidentally touching Rin while reaching to turn the power off... This is even with a lot of copper around to dissipate the heat.

Having gone through a couple of prototypes now, it's pretty cool (in every sense of the word :) ) when it finally works, but getting there needs some thought. [sulk] I prefer digital electronics to all this analogue stuff :D

Of course I managed to make things worse by using the Luxeon Rebels I had lying around (3.15v forward voltage drop) in a circuit designed for Cree XRE's (3.6v forward voltage drop) without re-reading the datasheet. With Vin at 19.95 volts (3.15x6 + 0.7v for the diode + 0.35v for the chip), everything runs nice and cool now... When I was pushing 24v through it, I got about 2 minutes before things started going haywire...

Just a precautionary tale :)

Simon

Thanks for the input. It's interesting to hear, since I remember that another user was posting about that chip a while ago (over the summer) and also complained that it shut down after a few minutes. IIRC, their solution was to put an LM317 in front of it to knock some of the voltage down. I suppose a better longterm solution would be to take your route - just match the power supply "correctly" in the first place.

I did go through a few iterations with my driver, but I was lucky enough that things more or less "just worked" other than a few basic adjustments - swapping different Rsense to get different drive currents, etc. Plus one hilarious mistake that had me stumped for nearly a week early on: I misread the spec for the timing cap, and was using a cap that was about 100 times too big. :lol: Needless to say, the driver didn't function AT ALL like that. :D

I'm also still on the fence about how to actually build these for my big tank. I'm going to need 25 of them. All my prototypes are on the cheapo protoboards I mentioned earlier in the thread. It feels like a bit of a hacked way to do this, but it works and it's cheaper and quicker than doing a "real" PCB. So I'm just not sure if it's worth the effort to design one and get a board house to make it for me.
 
Last edited:
just curious how well the pwm curciut worked? did you get any noise when dimming? also it might be worth it if you offered a group buy or something, i might be in for 20. also it might be helpfull if someone did a full picture run through if you did get the boards printed of how to wire them since there are alot of people to who have no idea what a schematic is much less how to read one.
jeff
 
The PWM dimming works totally fine. I'm using it with an Arduino. Basically, you connect a PWM pin from the Arduino to the PWM pin on the driver. Then, connect the Arduino's ground to the power supply's ground. Program the Arduino to provide whatever dimming profile you want.

There is a TINY bit of noise from the driver itself, but it's VERY quiet. You can't hear it when it's in an enclosure unless you lean right over next to it.

Most of these parts have quantity discounts from digikey or other suppliers so a group buy wouldn't save much there. And for the PCBs I'm not really interested in going through the effort of setting something up publicly, but I would definitely share the design if I go that route in case others wanted it.

If someone else wants to do a step by step photo tutorial that would be awesome. :lol: I'll do one the next time I build some of these (probably a month or more off) if no one else has by then.
 
Thanks for the input. It's interesting to hear, since I remember that another user was posting about that chip a while ago (over the summer) and also complained that it shut down after a few minutes. IIRC, their solution was to put an LM317 in front of it to knock some of the voltage down. I suppose a better longterm solution would be to take your route - just match the power supply "correctly" in the first place.

Yes, well the MPJA Potrans PSU's have a trimmer with which you can adjust the voltage over a reasonable range. Enough that I can get the output to what I want anyway :) Saves on worries about overheating resistors and whatnot :)

I did go through a few iterations with my driver, but I was lucky enough that things more or less "just worked" other than a few basic adjustments - swapping different Rsense to get different drive currents, etc. Plus one hilarious mistake that had me stumped for nearly a week early on: I misread the spec for the timing cap, and was using a cap that was about 100 times too big. :lol: Needless to say, the driver didn't function AT ALL like that. :D

Yeah. If you read the STCS1 datasheet, it specifies a Cbypass of 0.1uF in the application diagram - see the diagram Stugray used in this thread - it's the same one. Then you look in the revision history buried on the next-to-last page, and you see that Cbypass ought to be 1uF not 0.1uF. Only an order of magnitude there...

I'm also still on the fence about how to actually build these for my big tank. I'm going to need 25 of them. All my prototypes are on the cheapo protoboards I mentioned earlier in the thread. It feels like a bit of a hacked way to do this, but it works and it's cheaper and quicker than doing a "real" PCB. So I'm just not sure if it's worth the effort to design one and get a board house to make it for me.

Well, I'm forging ahead, assuming the 24-hour test goes well. Once there's a working design, it's easier (IMHO) to have them made. There's nothing to beat having the milling machine for prototypes though - last night (at 9:30) I decided to create a breakout board for the STCS1, so I could try different circuit setups and to make it easier to test. I'd designed it, milled it, and soldered everything by 10:15 :)

Simon.
 
i was thinking more of having a manufacture make a board and have it availiable to buy directly from them. not sure how much that cost since i have only ordered boards from honeywell and those were in the thousands. i would be curious how much small single lam boards cost. depending on price it might comeout that having the boards made now runs about the same as a meanwell that run in the $30 range for 10 or more drivers
jeff
 
Are you scribing? What are you using to generate the trace paths?

Eagle (http://cadsoft.de). If you run drillcfg.ulp and then export to Gerber RS274X, the milling machine (an EP2002H) software just reads those files and generates the isolation path (to get the resolution) and then the milling path if you want to remove copper. I generally do a GND copper-pour, so there's not too much copper to remove :) Accuracy is ~ 4mils track/gap width, though I rarely need to go so fine.

Simon
 
Well, I'm forging ahead, assuming the 24-hour test goes well. Once there's a working design, it's easier (IMHO) to have them made.

Agreed. There's just the big tradeoff during the prototyping stage - do I hope that a design works and pay a bunch for a board house to make it (risky!), or do I hand-etch a few (messy and time consuming!)

There's nothing to beat having the milling machine for prototypes though

LUCKY!

i was thinking more of having a manufacture make a board and have it availiable to buy directly from them. not sure how much that cost since i have only ordered boards from honeywell and those were in the thousands. i would be curious how much small single lam boards cost. depending on price it might comeout that having the boards made now runs about the same as a meanwell that run in the $30 range for 10 or more drivers
jeff

Jeff, I'm thinking about that, too. There are a few board houses that would probably be able to make this cheap enough to be worthwhile, assuming we had a known-good design and were ordering dozens at a time vs. trying to get two or three prototypes. One thing I'd probably do is design a board that could hold two or three of these circuits to get some efficiency of scale.

I know people who have used seeedstudio for small board runs. We're talking about the kind of volume where we'd probably be around $3-4 per board. That's for double sided boards. I dunno of any place that does single-sided but would be interested in hearing if someone else knows.
 
I did go through a few iterations with my driver, but I was lucky enough that things more or less "just worked" other than a few basic adjustments - swapping different Rsense to get different drive currents, etc.

Did you actually measure the current flowing through the LEDs ? I've just done that for the STCS1 and I get 547mA, rather than the 769mA the formula in the datasheet suggests I ought to get with a 0.13R sense resistor...

Rf = Vfb / Ileds according to the datasheet, with Vfb = 100mV

Using Rf = 0.13 ohms, Ileds should be 100mV / 130 mOhms or 769 mA, but the multimeter in series with the LEDs shows only 547mA. Oh well, time to send off for a collection of resistors around that value to see which one *really* gives me something around 900mA...

Simon.
 
Last edited:
Eagle (http://cadsoft.de). If you run drillcfg.ulp and then export to Gerber RS274X, the milling machine (an EP2002H) software just reads those files and generates the isolation path (to get the resolution) and then the milling path if you want to remove copper. I generally do a GND copper-pour, so there's not too much copper to remove :) Accuracy is ~ 4mils track/gap width, though I rarely need to go so fine.

Simon

Thanks for the info! Nice machine.
I have a CNC-router good for about 1.5mils. I'm going to check to see if they just sell the converting software.
 
Thanks for the info! Nice machine.
I have a CNC-router good for about 1.5mils. I'm going to check to see if they just sell the converting software.

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

The EP2002 quotes an X/Y resolution of 0.005mm (or 0.2 mil) but by the time you've taken account of the mechanics of the process, you're actually at ~4mil in the real world of rotating spindles and milling copper. I can repeatedly do 4 mil circular tracks, and see them as continuous, and line them up on double-sided boards, but getting real results at 1.5mil resolution would be something else!

The EP2002 does a surface-scan of the copper-plated FR4 before it mills the copper away, so it can judge the precise depth needed for the Z axis at any given point on the circuit. It does that by making the drill-bit complete a continuity circuit with the copper-plate at regular grid-points before actually drilling/milling. I can't get 4mil accuracy without doing this because the copper-plate surface height varies too much, and the software has to cope with embedding just the correct fraction of the 90-degree or 60-degree head into the copper-plate to reliably get 4mil accuracy.

Having said that, PCAM (the EverPrecision s/w) really doesn't do itself any favours. I work at Apple, where there's a huge focus on how the software interacts with the user. I could use PCAM as a worked example of how not to write software for many many reasons... Once you've learnt all the foibles and gotchas, it's actually very powerful under the hood, but it takes some time to find the hidden menus and the same menu giving different options on different screens...

Simon.
 
Did you actually measure the current flowing through the LEDs ?

Nope. I can't really confirm this, but in a few of the app notes or datasheets for switching LED drivers I saw references that it's hard to measure current on the output side with typical hobbyist tools because of the high-frequency ripple. I don't know if that's true or not, but I have confirmed that the output is roughly correct by two methods: measuring voltage on the output and extrapolating based on the voltage the LEDs should be running at certain currents, and measuring current/voltage on the input side of the driver, figuring watts consumed, then using the estimated efficiency to determine watts making it to the LEDs. These methods both suggest that the drive current is correct.

Also, a note to anyone thinking about building these - I should have said this earlier I suppose, but if you're not planning on using the PWM pin for dimming, you MUST provide a voltage on that pin to get the thing to turn on. Otherwise the driver won't work. This is easy though. Assuming you're using a 24v DC supply, you can just connect the +Vin pin to the PWM pin and it'll run at 100% (as if it was getting a full duty cycle PWM signal). You could just hardwire this on your PCB, but in case you ever decide to add dimming, it might be better to bring the pin out and use a jumper from Vin.

In the next week or so I'm going to try some other versions with different caps, based on some of the discussion on this thread. I'll report my findings. I'm going to try with smaller caps, and with no (big) cap on the output side. I'm also going to try two drivers on one PCB with only one (electrolytic) input cap. If these experiments show that you can use smaller caps and/or fewer caps, it would make the circuit simpler/cheaper for people doing several of them.

Also going to go ahead and design a "real" PCB in Eagle. I'm a very weak PCB chef so I might be calling on some of the more experienced folks to help me with this. :D
 
Also going to go ahead and design a "real" PCB in Eagle. I'm a very weak PCB chef so I might be calling on some of the more experienced folks to help me with this. :D
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 :)

EDIT: I envy you all with routing machines at home :)
 
I have seen that - it's an interesting project to be sure. But it's so closely designed for the buckpucks that IMHO it would be hard to use with these drivers - you'd have to run leads from the drivers to the shields, and at that point you might as well just run leads to the Arduino itself, or use a proto board. The onboard power is nice on that board, but it assumes you want to power the buckpucks and the Arduino off the same source, which I don't want - I want to be able to cut power to the drivers totally (NOT just send them a zero duty cycle, which still results in some power consumption) but keep the Arduino running for other purposes.

In the end, if you want to dim a buckpuck or these drivers from an Arduino, it's just two connections (PWM pin and GND) so it's easy enough to just do with wire; no shield required (unless you want other functionality, like sharing the power source.)
 
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 :)

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

But, autorouters don't make "pretty" tracks. :lol:

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.
 
Also going to go ahead and design a "real" PCB in Eagle. I'm a very weak PCB chef so I might be calling on some of the more experienced folks to help me with this. :D[/QUOTE]

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