(Another) DIY LED Controller - Simple Arduino Style

I'd like to do what the folks here have done and kill it's power at night with a relay. Did you do that?

I made mine very simple. put a mechanical timer.

1) If the program fails, your light will automatically shut off via mechanical timer.
2) Arduino power supply is also on the same mech timer, so if it indeed froze, then this mech timer will reset it at the same time. Every night it will reset the arduino.


This is only ok when you dont have wavemaker as part of the controller function. If you are, then during mech timer off, your wavetimer will not function too.

On the other hand, it might be good too, since at night, you are trying to simulate less flow?

Also in terms of modularity. I have 3 major parts.
1) The LED lights + the wiring that goes to the controller.
2) The Box that includes all the LED drivers, etc.
3) The controller.

Remember, the controller only needs several wires.
1) The power supply. + and - wires.
2) And the two negative wires.

a) the wire from negative 10v power supply to the "emitter leg" of the NPN transistor.
b) the wire from negative "led driver" to the "collector leg" of the NPN transistor.

WiringDiagNPN.jpg



Hope this helps.
 
This is specially functional when you need to remove the controller out of the tank. You just need to short the two negative wires (10v power supply and led driver) and it will function as full manual.

this is also helpful to do a "show and tell" when reef friends are over. Thats is also why I kept my potentiometers.

Cesar
 
I white boarded it out on my lunch today. I was trying to minimize the. Connections between the different sections. I think I accomplished that. I started to dismantle the mess on my desk tonight and permanently mounted my LEDs onto the heatsink. I used that heat sink epoxy as I didn't want to screw around with trying to drill those itty bitty holes.

I like your idea of using a simple timer on the meenwell. I think I will do that for now. I plan on getting one of those opto isolated relay boards from yourduino but not right now.

I don't want to put the Arduino on the timer though because have temp sensors on there and plan on controlling the led
Fan with it and maybe the heater and moon lights.

I started playing with the code for moonlights and phases of the moon but it seems not to match what the moon is actually doing and always spikes to a certain level at midnight. I don't know enough about it to be able to fix it. Anyway the moon comes up at different times during the day so... I think I'm just going to do a simple on and off of the moonlights.

So I guess I am going to cherry pick the parts of the code I wan and try to get it to suite my needs.
 
Hi all,

i'm still confused choosing LED driver between meanwell and CAT LED driver.

May i know for ELN 60-48P and CAT LED driver can handle how many LEDs? Coz i'm planning make 12Leds/sting.

Before i order it i need input from you guys. And i want the LED can be use in future upgrade.

Thanks
 
Hi there. Im new in here but the arduino project looks cool.
How hard is it to get it working for an newbie in the world of open source electronics.
What i want is control of led lights(sunset/sunrise) and moon light of 1 tank maybe 1 more tank later on. The first project is only 8 cree and 1 Mean Well ELN-60-4 maybe the pwm version

I like the idea that i can add new stuff if i need it, like temp, ph probe and so on.

Im going to read the thread in the next couple of days :thumbsup:
 
Ok, Im not trying to booh people from making their own arduino controller.

BUT....

Not all people are aware that you can actually run your dimmable LED lighting rig without a controller. I just want to make a "shout out" to all that this is not a compulsory to your driver to make work.

If you want to DIY your lights and not yet ready with the controller, this is fine. Yes, this is fine and it will work without controller. I have my lights without controller for two months.

REMEMBER...

That the dimmable meanwell driver only needs a 10vdc signal to run whether it is an ANALOG or a PWM meanwell driver. 10vdc signal means 100% intensity, and 0vdc means 0% intensity or the lights is off.

You just need a 10vdc adapter. And put your dimmable driver on a mechanial timer to control when to turn ON or OFF.

Sorry i just want to make it crystal clear for everybody...

WHAT THIS MEANS?

Now that your lights can run without the arduino controller for now...
Then I suggest you to have fun, take your time and learn Arduino. Its really fun and addicting.

thats all...lol....

Cesar
 
I don't want to put the Arduino on the timer though because have temp sensors on there and plan on controlling the led
Fan with it and maybe the heater and moon lights.

Haha, this is very true. I did not think that when arduino is off, the temp is out too... DUH!!!!

Need to make note on that. Since Im adding the temp feature on my (5th) arduino, i never thought about it.

Thanks.
 
Hi all,

i'm still confused choosing LED driver between meanwell and CAT LED driver.

May i know for ELN 60-48P and CAT LED driver can handle how many LEDs? Coz i'm planning make 12Leds/sting.

Before i order it i need input from you guys. And i want the LED can be use in future upgrade.

Thanks

Not familiar with CAT but i use the meanwell and have 12 xpg cree leds on it.
Check it on my build here.

I believe the "48" in there means it can run 48 volts, or around 44 volts if you consider the safety headroom.

A reefer asked me which one, D or P...

There are Pros and Cons.

D (analog) -
Pros - can go down 5% intensity and then off.
Cons - Its not linear in PWM signal. It means 50% PWM signal is not 50% intensity.

P (pwm)
Pros - perfectly linear. it means you can have 100 steps from dim to max.
Cons - can only go down 25% intensity.

I like the D better. Mainly because it can go down 5%. You have to consider that these LEDs are so bright even at their lowest. But that is driver limitation. I have lived with it for 19 months and I think they are not that bad.

Now imagine if you use P which can only go down at around 20-25%, and then after that is off. So example... the light is dimming and dimming, and then off. But how do you define dimming? Yes 25% is so bright that you thought, wait what happened? Yes its like, it barely dimmed down and then out.

The problem with D now is its not linear. What do you mean? I mean you cannot do 100 steps from min to max. My rig has 10 steps from min to max. Maybe i can do 20, just maybe. Because at the low end, there is not much resolution for the driver to interpret.

Some people are so anal, they hate it. they say that they can tell the 10% steps. Sure you can tell, but that is when you are watching your light and not your tank. To me its ok, at least i can tell that the program works.

And if you look at the code, I have my min to max at 1 hour or 60 minutes. Divide by 10 steps, that is roughly 6 minutes every steps.

This is still way way better than the old mechanical timer which is ON and then OFF.

Now the decision is yours. If you search Reefcentral, you will see a lot of people complaining about the P not getting any lower. I guess there is a price to pay? Linear, 100 steps or more, but the minimum intensity is 20% Or, Steps maybe 10 or 15, but the minimum is 5% intensity.

In reference to 5% intensity, its like moonlighting but way more brighter. this is 12 cree LEDs on a 4 feet tank.

Hope this helps.
 
Hi there. Im new in here but the arduino project looks cool.
How hard is it to get it working for an newbie in the world of open source electronics.
What i want is control of led lights(sunset/sunrise) and moon light of 1 tank maybe 1 more tank later on. The first project is only 8 cree and 1 Mean Well ELN-60-4 maybe the pwm version

I like the idea that i can add new stuff if i need it, like temp, ph probe and so on.

Im going to read the thread in the next couple of days :thumbsup:



TJALFE,

WELCOME!
WELCOME!
WELCOME!


Hey, please read my LED build first (link post above). And if your still not dead because of boredom, lol, continue on this thread specially the first 5-10 pages.

Take it slow, dont rush, and read, read, read.

Here is a very good read on ARDUINO.......

Also, for reference, here is my site that also includes the LED build and the Controller build.

And also my latest arduino project.





Thanks for dropping by and hope you will stay with us here.





.
 
Thank you :)

Im going to make an order at mouser in next month and they have the AVR ARDUINO UNO REV 3 so its going in my cart, free shipment for me.
I need to try it, its just cool.
The other stuff im going to buy on ebay. Its cheaper.

The only thing that scares me is the code. But it should be easy enough when i got the parts in front of me
 
Hello I'm new to the forum from Perth Western Australia so please forgive me for asking this question, I have now got my program running and testing with just small single LEDs per channel at the moment straight off the Arduino set up as PWM output.
The problem I have is that I also have dimmers that use 5 volts but are from Mornsun type KC24W -700 http://www.mornsun-power.com/UploadFiles/pdf/KC24W_EN.pdf .
As you will see from the data sheet on their site if the PWM or the analogue pins are left open the dimmer goes into full brightness, putting the pin down to GND shuts the dimmer down.
This is opposite to the Mean Well units that you are using over there in the States so can you please help me sort this issue out.
I'm using 4 channels of White Cree XP-G R5 (20 LEDs) which I want to drive at the same time and 1 channel of Royal Blues (6 LEDs). So using one transistor per channel from the two output pins one for the blue and the other for white will this be ok??
My biggest problem is the driver at the moment"¦"¦.Please can you Help Me???
 
Control voltage range (from the site)
Full on 0.2V±50mV
Full off 4.5V±200mV


It looks like you need to control the driver within this range. Are you using a mosfet for the drivers?
 
CaptMalc,

WELCOME!
WELCOME!
WELCOME!


Glad you could join us.

Regarding to your question, but it seems that what you are using is very similar to BuckPuk? And I believe that this is doable.
a) The only difference is that your driver is the opposite in terms of signal.
b) Also your driver can easily accept 5 volts which means you can directly used it to your arduino pwm pins.
c) not an expert with coding, but you just need to change the values and reverse it?

What code are you using anyway?

d) also you can certainly use NPN transistor to control more than one driver assigned on a single arduino pin. Arduino may not be able to provide enough power to signal with different drivers, but i might be wrong. I believe Terahz was using 2 driver per 1 pwm arduino pin.

try re-reading this part. I believed we talked about the 5v buckpuk here.
http://reefcentral.com/forums/showthread.php?t=1987110&page=20

.
 
Hi Katchupoy,

For your second controller build can you active the push button to create menu?

so we can input and change time.

thanks
 
Thanks katchupoy. I'm using yours the caddnima Version 1 2012-03-13 I'm trying an opto coupler at the moment just on one channel but I'm waiting for the program to go through its cycle so I can see what happens to the LEDS.

The opto couplers output is being fed at 5 volts through a 1 K resistor with a 1k across the output to stop the LEDs flickering

I have no idea if we can get the Buckpuk drivers down under I'll have to do a search for them. Thank you so very much for your speedy reply and if you think of anything else please let me know in the mean time I'll keep reading the forum I'm learning heaps.
 
Hi again katchupoy I have checked out the availability of the BuckPuck drivers down under and I find that Cutter Electronics deal with them. They do the range from 350 to 1000 mA so I think I’ll get some of those and stop messing around with these from Mornsun.
The BuckPuck 3021 D-E – 1000 looks like it will fit the bill if my choice is incorrect can someone come up and give me directions for driving Cree XP – G R5 ……5 LEDs in each channel 4 channels of White and 1 channel of royal Blues so 5 drivers should work out just fine.
I feel if I can use equipment that others are using I have a better chance of getting things working.
Thank you for the WELCOME to the site. Malc
 
Hi Capt. Malc

I'm not very familiar with the ins and outs of this particular build's code as I wrote my own.

That aside it is entirely possible to use the current drivers you have with the arduino, you just need to set the PWM output correctly. This is controlled by the TCCR*A register. The * is replaced by a number, which is dependant upon which PWM pins you are using to drive the LED drivers. They can be set by putting the code below into the setup section at the beggining of your code.

Please bear in mind this is all for an arduino mega2560, so if you are using an UNO etc you will need to check the registers are still the same, and also which numbers to put in. I can give you further guidance if you get stuck trying to figure out the data sheet.

What you are looking for is a non-inverted phase correct 8-bit or 10-bit PWM output. Those who are more familiar with this projects code will need to chime in as to whether it uses 8-bit or 10-bit PWM. My own code uses 10-bit as it works better with the RECOM drivers which I bought from cutter.

As a side note, the data sheet you linked to also makes mention of keeping the PWM frequency above 100hz to prevent the visible flashing you can see.

The TCCR*B register controls the PWM frequency based on a pre-scaler, but you need to be careful when fiddling with this as it can break other parts of the program if you change the wrong one. By moving the frequency above the 100hz range you will get rid of the flickering. I had the same problem with the Recoms till I upped the Freq. on the PWM pins, was all good after that.


"

TCCR3A = B00000000; // sets the Timmer/Counter Control Register 3A to all zero's

TCCR3A = B11111111; /* sets the Timmer/Counter Control Register 3A to allow an inverted phase correct 10-Bit PWM output mode to be set on the PWM output pins 2, 3, and 5.*/

TCCR3B = B00000000; // sets the Timmer/Counter Control Register 3B to all zero's

TCCR3B = B00000010; /* sets the Timmer/Counter Control Register 3B to allow a prescaller of 256, lowering the PWM freq. on the PWM output pins 2, 3, and 5.*/

TCCR4A = B00000000; // sets the Timmer/Counter Control Register 4A to all zero's

TCCR4A = B11111111; /* sets the Timmer/Counter Control Register 4A to allow an inverted phase correct 10-Bit PWM output mode to be set on the PWM output pins 6 7, and 8.*/

TCCR4B = B00000000; // sets the Timmer/Counter Control Register 4B to all zero's

TCCR4B = B00000010; /* sets the Timmer/Counter Control Register 4B to allow a prescaller of 256, lowering the PWM freq. on the PWM output pins 6, 7, and 8.*/

"

Cheers
 
Back
Top