# My attempt at a professional style DIY light



## eltila

Thanks for the schematics


----------



## Lingwendil

Can't wait to get mine in. I guess that makes me a beta tester?

It'll be nice to have it all on one board! Perfect for the rapidLED enclosures.


----------



## MrMan

Lingwendil said:


> Can't wait to get mine in. I guess that makes me a beta tester?
> 
> It'll be nice to have it all on one board! Perfect for the rapidLED enclosures.


Pretty much  I emailed rapid and couldn't get an extra end cap without the hole so I'm thinking maybe 3d printing an new one with the proper opening for the connector will be my best bet. Just have to learn CAD modeling now lol

Sent from my Nexus 6P using Tapatalk


----------



## Lingwendil

MrMan said:


> Pretty much  I emailed rapid and couldn't get an extra end cap without the hole so I'm thinking maybe 3d printing an new one with the proper opening for the connector will be my best bet. Just have to learn CAD modeling now lol
> 
> Sent from my Nexus 6P using Tapatalk


Maybe try these guys? I used them for some audio gear a while back...

https://www.frontpanelexpress.com


----------



## MrMan

Lingwendil said:


> Maybe try these guys? I used them for some audio gear a while back...
> 
> https://www.frontpanelexpress.com


Might be overkill for what I need but I'll keep them in mind. Hard to tell how much it would end up being since their price options are just examples for much larger pieces.

Found this place:
https://www.elecrow.com/5pcs-acrylic-laser-cutting-service.html

Can do black plastic pieces for pretty cheap, could even get a logo engraved. Are the endcaps plastic or metal?


----------



## Lingwendil

I think its 3/32~1/8" aluminum. Easy to drill at least. They also acted like it was nigh impossible to source extra endplates when I asked too. Strange, but since everyone farms out mfg services nowadays it makes sense.


Silly question, but do you think a relocation of the barrel jack, spaced to fit through the existing hole on the endcaps could work on later revisions? If it's possible to reconfigure the PCB to work that way it could be a viable option I suppose. Otherwise its trivial to drill a hole and simply pop a plastic blockoff plug into the existing hole.


----------



## Kampo

This looks really sweet...if I had not already bought my setups I'd be all over buying one of these boards to test


----------



## MrMan

Lingwendil said:


> I think its 3/32~1/8" aluminum. Easy to drill at least. They also acted like it was nigh impossible to source extra endplates when I asked too. Strange, but since everyone farms out mfg services nowadays it makes sense.
> 
> 
> Silly question, but do you think a relocation of the barrel jack, spaced to fit through the existing hole on the endcaps could work on later revisions? If it's possible to reconfigure the PCB to work that way it could be a viable option I suppose. Otherwise its trivial to drill a hole and simply pop a plastic blockoff plug into the existing hole.


If I moved the connector to the middle the DC-DC circuit would push over and the wemos would have to move. It could work, but might make the board wider which I'd like to avoid to keep as much room for LEDs as possible. Currently the board is 50mm wide which is under 2 inches.



Kampo said:


> This looks really sweet...if I had not already bought my setups I'd be all over buying one of these boards to test


Easy solution, just start another tank :wink2:


----------



## Lingwendil

MrMan said:


> If I moved the connector to the middle the DC-DC circuit would push over and the wemos would have to move. It could work, but might make the board wider which I'd like to avoid to keep as much room for LEDs as possible. Currently the board is 50mm wide which is under 2"


Understandable. I'm braindead with PCB design so I was just curious.



MrMan said:


> Easy solution, just start another tank :wink2:


I am fighting all of my instincts to not grab another 20 long to do another planted. I've got a 55 in storage that is earmarked for a freshwater build once we move in a few months, and the current 20 long reef is slated to be replaced by a 40 breeder or similar (36x18) footprint tank around the same time. Multiple tank syndrome is a hell of a drug :smile:

I think the Petco doller-per-gallon sale is coming up again soon, always a good time to grab a few 10's or 20's to play with :hihi:


----------



## MrMan

Finished building the PCB, heatsink has been shipped and should be ready to pickup on Friday.


----------



## MrMan

So I picked up my heatsink today and went to check the fit of the PCB on the slots and found they're slightly off, which is annoying since I got a drawing from them and did the PCB based on that. I should be able to drill out one edge of the holes and it'll work but shouldn't have been necessary. Also noticed that the board bows a bit when both sides are tightened so I'm going to use a thermally conductive double sided tape between the board and heatsink to ensure everything stays cool.

I'm curious though if the COBs should be installed beside each other or in front/behind eachother. I'm leaning towards this but I suppose I could always change it:


----------



## Lingwendil

:bounce:

Can't wait!


----------



## MrMan

We have light!










I don't have my proper power supply yet so I'm making do with a 50W supply I had which will let me test each LED at full brightness. They all run as expected, fan works properly, havn't tested the daily fading cycle yet but that'll be done soon. The only weird thing is that the warm white COBs are always on even when the dimming is set to 0, it's so dim you can see the individual LEDs in the COB but it's strange. They still work as expected from 1-100 though so I'm sure I can ignore it.

This is the supply I am going to use:
Meanwell GST120A48-P1M


----------



## Kampo

MrMan said:


> We have light!
> 
> I don't have my proper power supply yet so I'm making do with a 50W supply I had which will let me test each LED at full brightness. They all run as expected, fan works properly, havn't tested the daily fading cycle yet but that'll be done soon. The only weird thing is that the warm white COBs are always on even when the dimming is set to 0, it's so dim you can see the individual LEDs in the COB but it's strange. They still work as expected from 1-100 though so I'm sure I can ignore it.
> 
> This is the supply I am going to use:
> Meanwell GST120A48-P1M


love that psu, makes it look even more professional. but wow 50 bucks is a lot of coin for a power brick...that said i've looked and there are not many options for 48v psus that don't look like a metal cage. i found a few chinese built ones that woudl work for my proejct in powerbrick form...but chinese powersupplies always worry me


----------



## MrMan

Kampo said:


> love that psu, makes it look even more professional. but wow 50 bucks is a lot of coin for a power brick...that said i've looked and there are not many options for 48v psus that don't look like a metal cage. i found a few chinese built ones that woudl work for my proejct in powerbrick form...but chinese powersupplies always worry me


Yea there's way cheaper to be had on ebay but they're smaller than they should be for the power rating so I feel it'll only be a matter of time until they fail. Better off buying a quality one from the get-go that'll last. I may go down to the 90W which should be enough to power the 4 COBs, but then again also nice to have some extra power if I want to add any colored LEDs.


----------



## jeffkrol

MrMan said:


> They all run as expected, fan works properly, havn't tested the daily fading cycle yet but that'll be done soon. The only weird thing is that the warm white COBs are always on even when the dimming is set to 0, it's so dim you can see the individual LEDs in the COB but it's strange. They still work as expected from 1-100 though so I'm sure I can ignore it.
> 
> This is the supply I am going to use:
> Meanwell GST120A48-P1M


Check chip to heatsink for bridging..
Doesn't take much leakage voltage to light diodes..

https://www.google.com/url?sa=t&rct...45517149.pdf&usg=AOvVaw20dMqXGEKxIJ4vCE6w9uUR
BajaNomad - ghost voltage? - Powered by XMB


----------



## ChrisX

MrMan said:


> Since it's an ESP using a PCA9685 for PWM there are a couple options for code. I originally looked at the SSLAC code which is very programmable but I don't think you can view anything outside of your network and I don't think it has much for fan control or temperature reading. Then I saw O2's Blynk based controller for the LED he made, decided it looked like a good base for a project like this and started my own code.


How did you integrate the PCA9685 board into a custom PCB? Was their circuit diagram available or did you have to trace and recreate it? 

Edit: Just answered my own question. The PCA9685 boards are just extensions to the chip. All you had to do was duplicate their circuit, create a new PCB layout and have it printed.


----------



## MrMan

jeffkrol said:


> Check chip to heatsink for bridging..
> Doesn't take much leakage voltage to light diodes..
> 
> https://www.google.com/url?sa=t&rct...45517149.pdf&usg=AOvVaw20dMqXGEKxIJ4vCE6w9uUR
> BajaNomad - ghost voltage? - Powered by XMB


Yea I did that right away, everything is high impedence (ie > 1Mohm) to heatsink. It's only the warm white COBs that do it, the freshfish are completely off, which is weird. 












ChrisX said:


> How did you integrate the PCA9685 board into a custom PCB? Was their circuit diagram available or did you have to trace and recreate it?
> 
> Edit: Just answered my own question. The PCA9685 boards are just extensions to the chip. All you had to do was duplicate their circuit, create a new PCB layout and have it printed.


Yup, just need to add the correct footprint and connections. Adafruit sells a PCA9685 breakout board as well if building this setup without the PCB.


----------



## jeffkrol

Out of curiosity did you try it off the heatsink?
Otherwise it's a driver error..
also you could try the shunt resistor thingy.. 

Had similar issues w/ my first puck designs (10W cheapos) and Meanwell AC/DC drivers..
Scrapped the system..


----------



## ChrisX

MrMan said:


> So I figured I'd start a thread for my new DIY project, now that I'm actually building it thanks to some interest from @Lingwendil . It's a wifi enabled LED controller/driver.
> 
> I wanted my light to look more like a professional light, which meant only one cable going to the light, ideally with a connector. So that meant the board needed to take a single voltage and step it down to 12V to run a fan and 3.3/5V for the controller. This is what I came up with:
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Designed to fit the spacings on the RapidLED premium heatsink, barrel connector for power, onboard DC-DC converter steps voltage down to 6.5-12V (adjustable with a pot) and then down to 3.3V for the Wemos. Has 6 drivers although with an on-board connector 8 PWM channels can be brought out for additional drivers. Each driver can accept up to 65V and the DC-DC is also rated for 60V. Output is adjustable from 350mA to 1A.
> 
> Since it's an ESP using a PCA9685 for PWM there are a couple options for code. I originally looked at the SSLAC code which is very programmable but I don't think you can view anything outside of your network and I don't think it has much for fan control or temperature reading. Then I saw O2's Blynk based controller for the LED he made, decided it looked like a good base for a project like this and started my own code.
> 
> The Blynk code is setup to have a dim sunrise/sunset mode, full daylight mode and moonlight. Each channel can be individually adjusted for each of the modes to allow warmer sunrise/sunset and whatever color moonlight. It will read the heatsink temperature from one or more DS18B20 sensors and turn a fan on when the temperature exceeds a controllable setpoint.
> 
> I've started building the first board and tested the DC-DC circuit, over the holidays I plan on finishing the board and testing it out while building my light. Starting with 2 fresh-fish and 2 crisp white COBs, this is over a 36x18x18 tank so each set of COBs basically be over an 18" cube. I'll see how it looks and may need to add more lights or may want to add some supplemental colors.
> 
> Also did up a Fritzing schematic which would let you use the code without the PCB for more DIY style:
> 
> Fritzing schematic
> 
> Blynk code is on Github here.


Are you selling your integrated PCB, or do you advise others to buy the individual boards? It looks like this could be a big DIY win for everyone, the parts (excepting the drivers and power supply) appear to be < $30, and you've already written/adapted code for multi channel dimming and fan control. Very cool.


----------



## MrMan

ChrisX said:


> Are you selling your integrated PCB, or do you advise others to buy the individual boards? It looks like this could be a big DIY win for everyone, the parts (excepting the drivers and power supply) appear to be < $30, and you've already written/adapted code for multi channel dimming and fan control. Very cool.


If everything goes well I'd definitely do up the rest of the boards for those interested, or the bare boards but there's some tricky parts to solder. 

I pulled the hanging kit out of the package finally and i'm not sure how to use it yet, it's clearly designed to install into the ceiling but I already have an electrical tubing setup to hang my current strip light. Maybe just cut the main line and clamp on hooks...



jeffkrol said:


> Out of curiosity did you try it off the heatsink?
> Otherwise it's a driver error..


Just noticed the freshfish COBs also light up but the room needs to be completely dark to see it. I didn't run it off the heatsink but there is a isolating gap pad under the PCB so I'm 100% sure no PCB circuits are connected to the heatsink, so I guess it's a driver thing.


----------



## jeffkrol

Chokes are too close to output... total guess though..


----------



## MrMan

So after looking through the datasheet there is a leakage current on the LX pin (the one that sinks current to run the LEDs) of 6uA, since the pin is connected to Vin through the LEDs it draws that leakage current through the LEDs turning them on very dimly. Good news is this is easily resolved by putting a high resistance value from the LX pin to Vin, so that 6uA will go through the resistor instead of LEDs. Worked like a charm and the LEDs are now completely off when they should be.

Also hooked up my new power supply and ran everything at full power, considering this isn't even double the power of my current light this is super bright! Also good news is that the drivers only got to about 50C since the PCB is mounted to the heatsink. Next is drilling the endcap to fit the barrel connector that sticks out the end, should be pretty much flush once done.










It looks like the stencil I ordered for the PCB got lost in the mail, but they're going to send a new one if it doesn't show by this Saturday.


----------



## jeffkrol

> So after looking through the datasheet there is a leakage current on the LX pin (the one that sinks current to run the LEDs) of 6uA, since the pin is connected to Vin through the LEDs it draws that leakage current through the LEDs turning them on very dimly. Good news is this is easily resolved by putting a high resistance value from the LX pin to Vin, so that 6uA will go through the resistor instead of LEDs. Worked like a charm and the LEDs are now completely off when they should be.


Yea!!! .Glad I was wrong.. easier fix.

What driver IC are you using?


----------



## MrMan

jeffkrol said:


> Yea!!! .Glad I was wrong.. easier fix.
> 
> What driver IC are you using?


It's the LM3414, the ease of changing the current is just awesome vs having to change a resistor out.


----------



## Lingwendil

Man, I can't wait. Let me know when mine are ready, I'm getting sweaty just thinking about wiring up that big build from my original thread!


I still need to play with getting the code compiled, yesterday was my only day off, but I spent it getting my engine back in my car, and getting my carbs synchronized and dialed in (73 super beetle) so no time to play with other stuff, and last week I was sick while handling the rest of the family who was more sick lol.


----------



## MrMan

Lingwendil said:


> Man, I can't wait. Let me know when mine are ready, I'm getting sweaty just thinking about wiring up that big build from my original thread!
> 
> 
> I still need to play with getting the code compiled, yesterday was my only day off, but I spent it getting my engine back in my car, and getting my carbs synchronized and dialed in (73 super beetle) so no time to play with other stuff, and last week I was sick while handling the rest of the family who was more sick lol.


Hopefully the replacement stencil will be sent today and show up on time :icon_frow If you still have issues with compiling let me know and I can try sending you a zip file of all my library folders in case there is a mismatch there.

I'm going to update the Blynk/code to use 0-200 or 500 instead of 0-100 sliders since even at 1% a single COB is too bright to use as a moonlight and that was my plan. I drilled the opening for the connector on the endcap and it looks pretty good. I had asked Rapid for a drawing and a different person answered this time and apparently they did have a couple spares so they're sending me another solid endcap which I'll drill to replace this one so I don't need the tape on it.


----------



## jeffkrol

MrMan said:


> It's the LM3414, the ease of changing the current is just awesome vs having to change a resistor out.


It's a curse.. You mean LM3414HV.. sorry..as I said.. a curse..



Why not add a separate moonlight channel?


----------



## MrMan

jeffkrol said:


> It's a curse.. You mean LM3414HV.. sorry..as I said.. a curse..
> 
> 
> 
> Why not add a separate moonlight channel?


Yes yes, it's the HV version :hihi:

I thought about a moonlight channel but wasn't sure what I'd get, I thought maybe a 3-up with a blue/cyan/cold white as I'm currently using an e-series and like a blue/cyan-ish white vs just blue. Anytime I tried to search for LED moonlights it's either a special LED with no information or royal blue.


----------



## Lingwendil

I'm currently running the white channel of my blueacro setups at 3/4095 steps and the blue at 2/4095 and I like it way better than the blue dominant look of most moonlights, and it's a very nice and dim amount that is perfect.

I think that most moonlight setups are way too blue and way too bright. Running the main channels super low is my preferred way of doing things now.


----------



## jeffkrol

MrMan said:


> I thought maybe a 3-up with a blue/cyan/cold white as I'm currently using an e-series and like a blue/cyan-ish white vs just blue.


A person after my own heart..










Sadly, or ironically, I don't run moonlight on any of my tanks................


----------



## MrMan

Lingwendil said:


> I'm currently running the white channel of my blueacro setups at 3/4095 steps and the blue at 2/4095 and I like it way better than the blue dominant look of most moonlights, and it's a very nice and dim amount that is perfect.
> 
> I think that most moonlight setups are way too blue and way too bright. Running the main channels super low is my preferred way of doing things now.


That's pretty low PWM, I updated the sliders in Blynk to 0-1000 (1 would be 4/4095) and it gets pretty hard to select a specific value. 



jeffkrol said:


> A person after my own heart..
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Sadly, or ironically, I don't run moonlight on any of my tanks................


That looks good, is that using separate LEDs or a RGB strip light?


----------



## jeffkrol

MrMan said:


> That's pretty low PWM, I updated the sliders in Blynk to 0-1000 (1 would be 4/4095) and it gets pretty hard to select a specific value.
> 
> 
> 
> That looks good, is that using separate LEDs or a RGB strip light?


That was a rgb strip. Just an example. Prefer real cyan since the whites have that gap.. Well at least at the time. Killing 2 birds ect.

Real moonlight is like 4000k but looks much higher in K temp because of human eye err..odditys..


----------



## Kampo

jeffkrol said:


> That was a rgb strip. Just an example. Prefer real cyan since the whites have that gap.. Well at least at the time. Killing 2 birds ect.
> 
> Real moonlight is like 4000k but looks much higher in K temp because of human eye err..odditys..



human eye is crazy. I was working on my reef light last night and for a while it was the only light on in the room. may of looked too close at it a few times. for about half hour after everything looked very warm...like warmer than a 2700k lightbulb....my brains whitebalance was all wonky was kinda interesting.


----------



## jeffkrol

Kampo said:


> human eye is crazy. I was working on my reef light last night and for a while it was the only light on in the room. may of looked too close at it a few times. for about half hour after everything looked very warm...like warmer than a 2700k lightbulb....my brains whitebalance was all wonky was kinda interesting.





> When our eyes are exposed to a hue for a prolonged period, the rods & cones become fatigued. You might notice this if you are reading something on colored paper, and then look away—you often see the inverse, or complement, of the image.


After Images, negative images, eye fatigue, the rods & cones


----------



## MrMan

So I'm not totally happy with how the light is hung but it's up and running! 










Hanging from the hooks that were already there it seemed a bit low, I think it's good at the height now but it looks a bit funny. I may try to mount the heatsink directly to the EMT tubes and avoid the hanging kit altogether. The light was super bright too, I turned down the cool whites to 40% and warms to about 20%, and it still seems way brighter than the e-series I was using before.

I also updated the code to use a selectable time for moonlights so I can still have a dark period in the early AM.


----------



## Lingwendil

THAT LOOKS FANTASTIC! Beautiful tank. Is that with the freshfish/crispwhite CoBs?



Interface looks good!


----------



## MrMan

Lingwendil said:


> THAT LOOKS FANTASTIC! Beautiful tank. Is that with the freshfish/crispwhite CoBs?
> 
> Interface looks good!


Yup, love the look of the freshfish, running the crispwhite pretty low during the day but running just the crispwhite for sunrise/sunset and it looks great. Happy with the LED choice for sure, plus I have two channels left if I want to add any colors.

And as a bonus the stencil arrived yesterday so I'll be working on your boards this week :grin2:


----------



## SpringHalo

I only lurk the lighting section so I didn't notice this gem pop up. The PCB design and soldering look great. Did you ever release the PCB designs or BOM? I'm curious as to the cost save compared to a TC-420 and LDD-H drivers. Also I haven't looked at the code, but it might be a good idea to implement a scaling curve for the LED pwm, which will let you better tune the perceived brightness with a slider. An exponential curve expands the low brightness intervals while compressing the high brightness ones:

Pathway Lighting - Blogposts


----------



## jeffkrol

SpringHalo said:


> but it might be a good idea to implement a scaling curve for the LED pwm, which will let you better tune the perceived brightness with a slider. An exponential curve expands the low brightness intervals while compressing the high brightness ones:
> 
> Pathway Lighting - Blogposts


Yea.. "fun" stuff................

Logarithmic scaling for LED dimming?

https://www.google.com/url?sa=t&rct...te+Paper.pdf&usg=AOvVaw1pr6JeBg4zBK3F-COF8R9p

https://www.google.com/url?sa=t&rct...orceDownload&usg=AOvVaw2DbQnn7X2A3z3DaSL8OZfB


----------



## MrMan

SpringHalo said:


> I only lurk the lighting section so I didn't notice this gem pop up. The PCB design and soldering look great. Did you ever release the PCB designs or BOM? I'm curious as to the cost save compared to a TC-420 and LDD-H drivers. Also I haven't looked at the code, but it might be a good idea to implement a scaling curve for the LED pwm, which will let you better tune the perceived brightness with a slider. An exponential curve expands the low brightness intervals while compressing the high brightness ones:
> 
> Pathway Lighting - Blogposts


I haven't posted the PCB files for this project, but it won't be comparable price wise to a TC420/LDDs simply because it's low volume and a custom PCB. 

But it's a single board with 6 adjustable current drivers and an adjustable DC-DC to power fans. The reason I did this was to avoid having parts everywhere (chassis power supply, TC-420, LDD board, DC-DC, large bundle of wires going to the LEDs etc). My cabinet was already full with the filter, CO2 tank and my iAqua build so I wanted everything inside the heatsink.

Since it's using an ESP8266 it's easily programmable for individual wants/needs. I went with Blynk since it was pretty easy to start up but there's other code that would work like the SSLAC code which has way more customization for ramping the LEDs.


----------



## cairo

Just a little trick I learned. To display temperature with one decimal place in the blynk app change label to /pin.#/ C 
or /pin.##/ C for two decimal places


----------



## Kampo

so my raspberry controller is having issues. going to see if i can figure it out but might need to revisit my controller. so if i wanted to build a really simple controller based on the blync code. no fan controller or anything. could I just plop something like this shield on top of a wemos d1?

https://www.tindie.com/products/deshipu/16-channel-servo-shield-for-d1-mini-version-20/


----------



## MrMan

Kampo said:


> so my raspberry controller is having issues. going to see if i can figure it out but might need to revisit my controller. so if i wanted to build a really simple controller based on the blync code. no fan controller or anything. could I just plop something like this shield on top of a wemos d1?
> 
> https://www.tindie.com/products/deshipu/16-channel-servo-shield-for-d1-mini-version-20/


Looks like it! Nice find on that little board. Could still add a temperature sensor just for monitoring the heatsink without control over the fan if you wanted

Sent from my Nexus 6P using Tapatalk


----------



## SpringHalo

MrMan said:


> I haven't posted the PCB files for this project, but it won't be comparable price wise to a TC420/LDDs simply because it's low volume and a custom PCB.
> 
> But it's a single board with 6 adjustable current drivers and an adjustable DC-DC to power fans. The reason I did this was to avoid having parts everywhere (chassis power supply, TC-420, LDD board, DC-DC, large bundle of wires going to the LEDs etc). My cabinet was already full with the filter, CO2 tank and my iAqua build so I wanted everything inside the heatsink.
> 
> Since it's using an ESP8266 it's easily programmable for individual wants/needs. I went with Blynk since it was pretty easy to start up but there's other code that would work like the SSLAC code which has way more customization for ramping the LEDs.


I do like the compactness of it, and was planning my own LED driver board at one point using AL8861 drivers that brought the per-channel cost down to ~2.50, but got bogged down thinking about coding and RTCs. Now that I know there's a pre-established codebase, it might be more feasible. 

I didn't know about the DC-DC for the fans, and was pretty confused about the giant inductor seemingly only used to power the ESP and PWM ICs. Is there a smaller buck converter for the ICs, or just a small linear regulator feeding off the fan voltage?


----------



## MrMan

cairo said:


> Just a little trick I learned. To display temperature with one decimal place in the blynk app change label to /pin.#/ C
> or /pin.##/ C for two decimal places


Good call, changed it to one decimal place, don't need more than that.



SpringHalo said:


> I do like the compactness of it, and was planning my own LED driver board at one point using AL8861 drivers that brought the per-channel cost down to ~2.50, but got bogged down thinking about coding and RTCs. Now that I know there's a pre-established codebase, it might be more feasible.
> 
> I didn't know about the DC-DC for the fans, and was pretty confused about the giant inductor seemingly only used to power the ESP and PWM ICs. Is there a smaller buck converter for the ICs, or just a small linear regulator feeding off the fan voltage?


I was originally looking at the A6211 driver but liked the pot to adjust current feature of the LM3414. That driver looks good too although the 40V max input is a bit limiting when dealing with COBs with a Vf of 35V.

The LM3414s don't need separate power, they internally step down the input voltage to around 5V on the Vcc pin which you just need a capacitor for. So the DC-DC takes the input down to 8-12V (for adjustable fan speed) and then there is a 3.3V LDO to power the ESP/Wemos board.


----------



## SpringHalo

MrMan said:


> I was originally looking at the A6211 driver but liked the pot to adjust current feature of the LM3414. That driver looks good too although the 40V max input is a bit limiting when dealing with COBs with a Vf of 35V.
> 
> The LM3414s don't need separate power, they internally step down the input voltage to around 5V on the Vcc pin which you just need a capacitor for. So the DC-DC takes the input down to 8-12V (for adjustable fan speed) and then there is a 3.3V LDO to power the ESP/Wemos board.


I did notice the 40V limitation of the drivers, but my current supply is nominal 36v with a small trimpot that let me bring it up to 39-40V and allow for voltage drop in the LDDs. Looking at the datasheet, the AL8861 actually gets optimum efficiency (99%) with only 1v drop driving 33V LEDs with a 34V supply. The current adjustability wasn't as big of an issue for me since lower duty cycle is almost identical to lower current (as you mentioned you're running at 40% on yours anyway), and I'd spec out the shunt resistors depending on the recommended LED current. 

I always like trying to reduce costs as much as I can, but I usually end up wasting money on excess parts and the like so sometimes it's wasted effort. The versatility allowing for cheaper and more common 48V supplies in your design is good, and if you have an extra PCB I'd love to assemble one for my ever-growing collection of tanks.

Cheers


----------



## jeffkrol

SpringHalo said:


> the AL8861
> Cheers


hmm. current setpoint changes slightly w/ power supply and V(f)
Like if I use a 36V ps "set" at 985mA that driver will output 985-ish at 33 V(f) but 1012 ish at a string V(f) of 16.5
TSOT25, RS=0.1Ω, L=33μH)

Is that correct? Is it normal for other chips as well???
not a big deal busting thing but curiosity

Never noticed any "drift" w/ LDD's but only checked a few years ago.


----------



## SpringHalo

jeffkrol said:


> hmm. current setpoint changes slightly w/ power supply and V(f)
> Like if I use a 36V ps "set" at 985mA that driver will output 985-ish at 33 V(f) but 1012 ish at a string V(f) of 16.5
> TSOT25, RS=0.1Ω, L=33μH)
> 
> Is that correct? Is it normal for other chips as well???
> not a big deal busting thing but curiosity
> 
> Never noticed any "drift" w/ LDD's but only checked a few years ago.


Looking at the datasheet of the LM3414, it exhibits the same trends. The difference is only a few percent, so it's largely negligible unless you're designing massive arrays with specific power targets. I'd assume it's the same in the LDDs, though they don't give any specific data that supports it. The cause of the current differences might have to do with higher inductive losses due to differing duty cycles and frequencies causing the feedback circuitry to react differently, but without further analysis of the block diagram I can't give a better explanation.









LM3414 current vs voltage


----------



## Kampo

alright i'm going to give it a go building the contorller in the fritz schematics. but its really hard to read what all the components are. what is the red board on the left? also whats the diode to the right of it before the Wemos D1. 










eidt ok i'm an idoit I googled a bit and found this. 
https://www.sparkfun.com/products/13032

so if i'm understanding it one side of the power is 3.3 for the wemos and the other is 5v for the pca9685 essentially?


----------



## MrMan

Kampo said:


> alright i'm going to give it a go building the contorller in the fritz schematics. but its really hard to read what all the components are. what is the red board on the left? also whats the diode to the right of it before the Wemos D1.
> 
> so if i'm understanding it one side of the power is 3.3 for the wemos and the other is 5v for the pca9685 essentially?


You don't need to use that, I just put it in the fritzing schematic to step down the power on a bread board. Basically you need 12V for the fan and 3.3V for the wemos/PCA. The part to the left of the Wemos is a DS18B20 to monitor temperature of the heatsink and turn the fan on/off as needed.


----------



## Kampo

would it be possible to get a bit of handholding on setting up blynk. i orderd a couple NodeMCU (did this because I could get them quicker than a wemos d1 mini, and figured it would work the same i hope.

so anyway quick wired it all up and didn't really work. couldn't get it to send pwm out over the pca9685, and it was terribly intuitive how to setup the levels. now i may have done it wrong. all I did was flash blync with Ardunino IDE with the auth token and my wifi info. it shows online when i bring it up online in the android app but I can't get it to save levels, and it won't send pwm to the leds, they just stay off whatever i do. I started tinkering a bit and I did get it to send pwm via the d1 and d2 pins bypassing the pca9685 is this ok? is there any limitations to this? I only need to channels, kinda like simplifighing the whole mess

I have a hunch i'm supposed to copy the code from github into the ardunio ide "code section" but not sure of the correct way to do that or if that is even needed.


----------



## MrMan

Kampo said:


> would it be possible to get a bit of handholding on setting up blynk. i orderd a couple NodeMCU (did this because I could get them quicker than a wemos d1 mini, and figured it would work the same i hope.
> 
> so anyway quick wired it all up and didn't really work. couldn't get it to send pwm out over the pca9685, and it was terribly intuitive how to setup the levels. now i may have done it wrong. all I did was flash blync with Ardunino IDE with the auth token and my wifi info. it shows online when i bring it up online in the android app but I can't get it to save levels, and it won't send pwm to the leds, they just stay off whatever i do. I started tinkering a bit and I did get it to send pwm via the d1 and d2 pins bypassing the pca9685 is this ok? is there any limitations to this? I only need to channels, kinda like simplifighing the whole mess
> 
> I have a hunch i'm supposed to copy the code from github into the ardunio ide "code section" but not sure of the correct way to do that or if that is even needed.


I think you might have only been loading part of the code, and you don't need to put in your wifi info, it will open an access point you can connect to where you enter that info. Try this:

1. Go to the github page (https://github.com/NineteenFire/ESP-Blynk-LED-Controller)
2. Go to "Clone or Download" and "Download as ZIP"
3. Put the folder "ESP-Blynk-LED-Controller-master" in your Arduino folder and remove the "-master" part
4. Open the file "ESP_Blynk_LED_Controller.ino"
5. Upload to your nodeMCU
6. Check your available wifi networks for "LED AP" and connect to it, it should prompt you to select your wifi network and put in your Blynk token (best to copy it to your clipboard before running as it has a timeout)
7. Once you've put in that info you should be able to connect via the Blynk app

Once the Blynk app is connected go to setup and through the following steps:
1. Select a test mode, ie "Test MaxPWM" which is your brightest mode
2. Move the sliders to the brightness you want
3. Hit the save button, this will save the current slider values to that mode
4. Repeat for the dim levels and moonlight levels
5. Set mode to normal operation and you should be good to go


----------



## Kampo

ok that makes a lot more sence.

now i'm running into compiling issues. 

here is the error code:



> Arduino: 1.8.5 (Windows Store 1.8.10.0) (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 4M (1M SPIFFS), v2 Prebuilt (MSS=536), Disabled, None, 115200"
> 
> C:\Users\kamps\Documents\Arduino\ESP_Blynk_LED_Controller\ESP_Blynk_LED_Controller.ino:4:25: fatal error: SimpleTimer.h: No such file or directory
> 
> #include <SimpleTimer.h>
> 
> ^
> 
> compilation terminated.
> 
> exit status 1
> Error compiling for board NodeMCU 1.0 (ESP-12E Module).


any thoughts?

also onto the pca9685 question. can it be configured without? is there any downsides to it? I made a quick little blynk sketch last night to just control brightness to each channel to test to see if i could get it to work, got it to work setting the D1 and D2 pins to pwm on 2 sliders.

edit: I tried putting the simpletimer.h files in the folder on a whim and no go on that. so not sure what may be causing the error, has anyone else compiled there own version of this yet? is there some libraries I need to setup to get it to work maybe? kinda new to all this i'm muttling thru though

edit:

ok figured it out was looking for libraries loaded them up into the libraries folder, something is still hanging it up though. sorry trying to learn on the fly. 

pastebin link since this error is LONG https://pastebin.com/KH8v6FJe

I think imm getting close though not sure what i'm looking at though


----------



## MrMan

Kampo said:


> ok that makes a lot more sence.
> 
> now i'm running into compiling issues.
> 
> here is the error code:
> 
> any thoughts?
> 
> also onto the pca9685 question. can it be configured without? is there any downsides to it? I made a quick little blynk sketch last night to just control brightness to each channel to test to see if i could get it to work, got it to work setting the D1 and D2 pins to pwm on 2 sliders.
> 
> edit: I tried putting the simpletimer.h files in the folder on a whim and no go on that. so not sure what may be causing the error, has anyone else compiled there own version of this yet? is there some libraries I need to setup to get it to work maybe? kinda new to all this i'm muttling thru though


You need to put the libraries in the libraries folder. I made a zip file of all the libraries you should need (I hope), just extract the zip folder in the libraries folder:

Library zip file

You could certainly bypass the PCA if you only want two channels

Make the following changes to the code:

1. update numCh to 2 instead of 6
2. Update writeLEDs to use the pins you want instead of PCA
3. Update BYNK_WRITE V0 and V1 to use "map(value, 0, 1000, 0, 1023);" (i think, i believe standard PWM on esp is 10 bit)
4. Remove setup code for the PCA9685


----------



## Kampo

MrMan said:


> You need to put the libraries in the libraries folder. I made a zip file of all the libraries you should need (I hope), just extract the zip folder in the libraries folder:
> 
> Library zip file
> 
> You could certainly bypass the PCA if you only want two channels
> 
> Make the following changes to the code:
> 
> 1. update numCh to 2 instead of 6
> 2. Update writeLEDs to use the pins you want instead of PCA
> 3. Update BYNK_WRITE V0 and V1 to use "map(value, 0, 1000, 0, 1023);" (i think, i believe standard PWM on esp is 10 bit)
> 4. Remove setup code for the PCA9685


ok cool thank, i edited my above post figured out the libary part, but i'll double check i got them all, compile is still hanging up, i put a pastebin link above.


----------



## Lingwendil

Arduino has to be the single most frustrating thing on earth. No matter what I do on two different machines, I can't get the code to compile, even with fresh installs and library tomfoolery. The wire library issues seem to the most prevalent issues.

I've got two fancy boards waiting to be used, and nothing works on these damn ESP codesets. I've tried the SSLC code, O2's blynk code, the only thing that I can get working is stuff using regular arduino boards, all the more advanced stuff fails to compile with all sorts of errors, no matter wether or not the libraries are correct.


----------



## jeffkrol

NOT my forte.. but from casual viewing most problems seem to stem from the various versions of the compiler and if it does or does not support certain libraries..

Ordeleting the lib. folder and starting over .

or...
or..

https://community.blynk.cc/t/compiling-error/4069
https://community.blynk.cc/t/compile-error-blynkblink-example/1800


> This is not Blynk library error. Seems like you using some Arduino libraries that are under development. Please try to download stable Arduino IDE and libraries.
> cartercherry
> Sep '15
> 
> Solved! Uninstalling the arduino daily build and reinstalling the stable arduino program fixed the compile error. Thanks!
> Great support.


----------



## MrMan

Lingwendil said:


> Arduino has to be the single most frustrating thing on earth. No matter what I do on two different machines, I can't get the code to compile, even with fresh installs and library tomfoolery. The wire library issues seem to the most prevalent issues.
> 
> I've got two fancy boards waiting to be used, and nothing works on these damn ESP codesets. I've tried the SSLC code, O2's blynk code, the only thing that I can get working is stuff using regular arduino boards, all the more advanced stuff fails to compile with all sorts of errors, no matter wether or not the libraries are correct.


PM or email me your compiling errors and I'll take a look. Kampo had issues compiling the code as well

Sent from my Nexus 6P using Tapatalk


----------



## MrMan

So I decided to pick up a Seneye reef this week so I could check what PAR this light was putting out. Glad I had it turned down since at full brightness it was 160 at the bottom (24" from the light).










I turned down the FreshFish COBs to 40% (although they arn't even running at the full 1A) and warm white to 15% for ~60PAR on the bottom. At the surface level right under the lights is still 150 but the most any of the higher plants are getting is 80 now...


----------



## Kampo

very nice, wish someone in my area had a par meter to borrow, curious what my freshfish is doing par wise mine is the bigger 1211 chip running at 1200ma, and i'm using a vero10 for my warm chip running at 300ma. i notice quite a bit of algea growth when running full out lately so dialed i back to 50% for both.

how are you liking the freshfish led over your tank?


----------



## MrMan

Kampo said:


> very nice, wish someone in my area had a par meter to borrow, curious what my freshfish is doing par wise mine is the bigger 1211 chip running at 1200ma, and i'm using a vero10 for my warm chip running at 300ma. i notice quite a bit of algea growth when running full out lately so dialed i back to 50% for both.
> 
> how are you liking the freshfish led over your tank?


I couldn't find anyone locally with one to borrow but wanted to know since the light seemed super bright. I still like the fresh fish light but the warm white I'm not as crazy about so I ordered a few 660 leds last week. 

Sent from my Nexus 6P using Tapatalk


----------



## zlpa chawngthu

@MrMan a question or two on your lm3414 driver, i assumed you are using 10k trim pot on iadj, my question is what is the value of resistor you use on FS, is it like in the datasheet? I am quite confuse because the datasheet does not use a trim pot and i am not very cleared on the relation of Iadj and FS.


----------



## jeffkrol

Actually it does, sort of variable resistor (thermistor) = trimpot










At least as I understand it..


Just food for thought.



> Analog Dimming Control
> The IADJ pin can be used as an analog dimming signal input. As the average output current of the LM3414
> depends on the current being drawn from the IADJ pin, thus the LED current can be increased or decreased by
> applying external bias current to the IADJ pin. The simplified circuit diagram for facilitating analog dimming is as
> shown in Figure 17. The minimum LED current for analog dimming is 100 mA and the converter must remain in
> continuous conduction mode (CCM). The switching frequency and inductor value must be sized accordingly.
> 
> Figure 18 shows an example circuit for analog dimming control using simple external biasing circuitry with a
> variable resistor.


I assume you need R1ADJ so as to not go below a minimum value.. 
Extended circuitry to tweak the IADJ circuit..


----------



## MrMan

zlpa chawngthu said:


> @MrMan a question or two on your lm3414 driver, i assumed you are using 10k trim pot on iadj, my question is what is the value of resistor you use on FS, is it like in the datasheet? I am quite confuse because the datasheet does not use a trim pot and i am not very cleared on the relation of Iadj and FS.


No important relationship between Iadj and FS. Iadj adjusts the output current of the driver at 100% PWM, section 8.1.2 of the datasheet has this table:

IOUT (mA) RIADJ (kΩ)
350 8.93
500 6.25
700 4.46
1000 3.13

So I used a 3K09 in series with a 5K pot which allows ~400mA to 1A output current. FS is the switching frequency of the driver, higher frequency means a smaller inductor but the minimum output voltage also rises. IE, with 48V in and 500kHz switching frequency (40K Rfs) the minimum output voltage is 9.6V. So you can't run a single LED on a channel. If you raise the frequency to 1MHz the minimum voltage is 19.2V, or 250kHz is 4.8V. You'd have to calculate the inductor value for any given frequency based on how much ripple current you want.

I would suggest sticking with 40K for Rfs and 47uH as shown in their diagram unless you want to optimize for a very specific build.


----------



## jeffkrol

> So I used a 3K09 in series with a 5K pot which allows ~400mA to 1A output current.


so in english you put this at R1ADJ.. 
No need for the transistor circuit....?????

Why do they recommend it???

Sorry learning here..


----------



## MrMan

jeffkrol said:


> so in english you put this at R1ADJ..


Correct.



jeffkrol said:


> Why do they recommend it???
> 
> Sorry learning here..


I don't think they recommend it, just give it as an option. Here is the relevent text from them regarding that circuit:



> This feature is exceptionally useful for the applications with analog dimming control signals such as those from
> analog temperature sensors and ambient light sensors.
> Figure 18 shows an example circuit for analog dimming control using simple external biasing circuitry with a
> variable resistor


So you could use this to automatically reduce the output current if your heatsink/driver get too hot. Useful feature but in our case I don't think we'd want our lights getting dimmer in the hot summer months and brighter in the cold winter months. So I used the more basic example of a fixed resistor on Iadj which changes the current draw from the pin and therefore the output current.

Did that help? (check figure 22 for standard usage)


----------



## jeffkrol

Ok well let me try to show it "as I see it"

you added resistor and pot in green circle..
Both diagrams on the spec sheet show it at position red circle (just pot or varistor)

The transistor circuit does "stuff" left of blue line to affect input to IADJ...
Both fig 18 and 19 use a variation of the transistor circuit..
If someone asked me to guess as to why position red is preferred over position green I'd guess for stability..or a more linear response..

Not that I doubt either works just fine..

both the temp sense circuit and "manual" dimming use it..

BTW NO idea if blue line is drawn in the correct spot...
I like your way, simple and effective btw..


----------



## MrMan

jeffkrol said:


> Ok well let me try to show it "as I see it"
> 
> you added resistor and pot in green circle..
> Both diagrams on the spec sheet show it at position red circle (just pot or varistor)
> 
> The transistor circuit does "stuff" left of blue line to affect input to IADJ...
> Both fig 18 and 19 use a variation of the transistor circuit..
> If someone asked me to guess as to why position red is preferred over position green I'd guess for stability..or a more linear response..
> 
> Not that I doubt either works just fine..
> 
> both the temp sense circuit and "manual" dimming use it..
> 
> BTW NO idea if blue line is drawn in the correct spot...
> I like your way, simple and effective btw..


Think of it more like this, I used a resistor/pot to set Iadj so I can have a range of output current. But in a fixed production lighting design that would be a single resistor to get a fixed current (let's say 1A). That's all that's needed to use the LM3414.

IF you wanted analog dimming you would add the transistor design (note that this is separate from PWM dimming). With this design you have a fixed Riadj to set a fixed output current and use a analog sensor (*not a pot*) in the transistor circuit to dim the output current under certain conditions like a hot heatsink or dim ambient light.

So you would never use a potentiometer in the transistor circuit, only on Riadj if you wanted to be able to change the output current easily in prototyping (or in this case hobby use).



> BTW NO idea if blue line is drawn in the correct spot...


Yes that is in the correct spot, you can remove the stuff in the blue circuit entirely with no issues.


----------



## jeffkrol

analog dimming adjusts current... 
Same difference...
Analog dim affects the same circuit as a resistor/pot would..

Sorry, not trying to be difficult but see no reason you can't analog dim and PWM at the same time..

Seems more a matter of sematics..

your method works, and as I said seems sound..
Thanks for the info.


----------



## MrMan

jeffkrol said:


> analog dimming adjusts current...
> Same difference...
> Analog dim affects the same circuit as a resistor/pot would..
> 
> Sorry, not trying to be difficult but see no reason you can't analog dim and PWM at the same time..
> 
> Seems more a matter of sematics..
> 
> your method works, and as I said seems sound..
> Thanks for the info.


I wasn't trying to say you can't do both. Just that you wouldn't use the transistor circuit for *manual* analog dimming. If you want a pot for analog dimming you'd put it at Riadj like I did. If you wanted automatic (via heat/light) analog dimming you'd use the transistor circuit.


----------



## zlpa chawngthu

So I used a 3K09 in series with a 5K pot which allows ~400mA to 1A output current. FS is the switching frequency of the driver, higher frequency means a smaller inductor but the minimum output voltage also rises. IE, with 48V in and 500kHz switching frequency (40K Rfs) the minimum output voltage is 9.6V. So you can't run a single LED on a channel. If you raise the frequency to 1MHz the minimum voltage is 19.2V, or 250kHz is 4.8V. You'd have to calculate the inductor value for any given frequency based on how much ripple current you want.

I would suggest sticking with 40K for Rfs and 47uH as shown in their diagram unless you want to optimize for a very specific build.[/QUOTE]

Thanks, 40k and 47uH i had to stick with this so i don't had to order these parts, they are lying around at my parts collection box.


----------



## zlpa chawngthu

This design is so neat would you happen to share the schema diagram, just curious of the led driver for i-aqua, don't bother about the wemos etc.


----------



## MrMan

zlpa chawngthu said:


> This design is so neat would you happen to share the schema diagram, just curious of the led driver for i-aqua, don't bother about the wemos etc.


Check out the design example in the datasheet, section 8.2.2. It's got part values and even manufacturer part numbers you could use. Only change to make for adjustable current is using a 5K pot and 3K09 resistor in series from Iadj to gnd.


----------



## ChrisX

MrMan said:


> The Blynk code is setup to have a dim sunrise/sunset mode, full daylight mode and moonlight. Each channel can be individually adjusted for each of the modes to allow warmer sunrise/sunset and whatever color moonlight. It will read the heatsink temperature from one or more DS18B20 sensors and turn a fan on when the temperature exceeds a controllable setpoint.


Does your code interpolate between colors over time, or does it make discrete changes? 

For instance, lets say your sunrise is CH1= 50, CH2= 20..

And your full daylight is CH1=20, CH2 = 80.

Can it gradually change from sunrise to daylight? Or from off to sunrise?


----------



## MrMan

ChrisX said:


> Does your code interpolate between colors over time, or does it make discrete changes?
> 
> For instance, lets say your sunrise is CH1= 50, CH2= 20..
> 
> And your full daylight is CH1=20, CH2 = 80.
> 
> Can it gradually change from sunrise to daylight? Or from off to sunrise?


You can set values for each channel for sunlight/daylight/moonlight and it will ramp from whatever the current color is to the desired color based on the times you've set. So if you set the above values it will ramp channel 1 from 50 down to 20 and ch 2 from 20 up to 80 over the ramp time you've set. 

You can select sunrise/sunset, daylight and moonlight times. Where daylight should be the peak hours in between the sunrise/sunset. The code works so that when it hits the sunset time the channels will all be 0 but you can overlap the sunset time with moonrise time so they never quite get to 0 if you wanted to.

Also, I've updated the code to use 0-100 sliders with 1 decimal place since Blynk updated their side but haven't put it up on git yet as I still need to do one final test.


----------



## ChrisX

MrMan said:


> You can set values for each channel for sunlight/daylight/moonlight and it will ramp from whatever the current color is to the desired color based on the times you've set. So if you set the above values it will ramp channel 1 from 50 down to 20 and ch 2 from 20 up to 80 over the ramp time you've set.
> 
> You can select sunrise/sunset, daylight and moonlight times. Where daylight should be the peak hours in between the sunrise/sunset. The code works so that when it hits the sunset time the channels will all be 0 but you can overlap the sunset time with moonrise time so they never quite get to 0 if you wanted to.
> 
> Also, I've updated the code to use 0-100 sliders with 1 decimal place since Blynk updated their side but haven't put it up on git yet as I still need to do one final test.


I will probably piece one of these together to control my new DIY lights.


----------



## MrMan

ChrisX said:


> I will probably piece one of these together to control my new DIY lights.


You could try this PCA9685 shield for D1 mini, can't see what pins he's using for I2C but the code could be updated if necessary. Then just get a 18B20 temp sensor from the electronic bay and you're good to go. I'll try to get the github page up to date this week...


----------



## Kampo

did this end up going anywhere


----------

