Improved Arduino LED lighting code - Page 10
Planted Tank Forums
Your Tanks Image Hosting *Tank Tracker * Plant Profiles Fish Profiles Planted Tank Guide Photo Gallery Articles

Go Back   The Planted Tank Forum > Specific Aspects of a Planted Tank > DIY


Reply
 
Thread Tools Display Modes
Old 02-21-2013, 05:46 PM   #136
Gisimo
Algae Grower
 
PTrader: (0/0%)
Join Date: Apr 2012
Location: Denmark
Posts: 17
Default

The IRF520 has a max power dissipation at 60w and i have only 10 watt pr channel it is the reason i am concerned that it is hot not much but 45 degrees celsius!!
The IRF520 Has a gate threshold voltage at 4 volts max and the arduino put out 4,8 voltage so i need a resistor between arduino and gate which is 10 ohm or am i wrong ????
Gisimo is offline   Reply With Quote Quick reply to this message
Sponsored Links
Advertisement
 
Old 02-21-2013, 06:04 PM   #137
mistergreen
No more Bow ties
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 13,614
Default

45 C isn't too bad. It's not boiling hot.

R = V/I
5 = (5-4) / .2 ?

5 ohm seems to be it but 10 ohm should work too.
mistergreen is offline   Reply With Quote Quick reply to this message
Old 02-21-2013, 06:13 PM   #138
sink
Algae Grower
 
PTrader: (2/100%)
Join Date: Jun 2011
Location: Boston, MA
Posts: 147
Default

Quote:
Originally Posted by Gisimo View Post
Hi all i was wondering if it is possible to implement auto daylight savings time so it automatic change the time?!
I know I haven't been around much, but I'm thrilled to see people are still using the code!

The main reason there is no auto-daylight savings code is that a library to do that (if a clean one even exists for the Arduino) would take up too much amount of the limited space available on the unit. Given how easy it is to just update the time twice a year I figured it wasn't worth it.
sink is offline   Reply With Quote Quick reply to this message
Old 02-21-2013, 06:48 PM   #139
Gisimo
Algae Grower
 
PTrader: (0/0%)
Join Date: Apr 2012
Location: Denmark
Posts: 17
Default

Thank you for your help !!
Gisimo is offline   Reply With Quote Quick reply to this message
Old 02-21-2013, 07:42 PM   #140
O2surplus
Planted Tank Enthusiast
 
O2surplus's Avatar
 
PTrader: (4/100%)
Join Date: Jan 2010
Location: yorba linda, ca.
Posts: 538
Default

Quote:
Originally Posted by sink View Post
I know I haven't been around much, but I'm thrilled to see people are still using the code!
Hey Sink! Glad to see that you're still around. I'd been wondering where you'd disappeared too?
__________________
225 Gal, Glass "Reef Ready" w/ twin Iwaki Pumps & 2 Ocean Clear inline filters. Custom 320 watt LED Lighting system utilizing a 6' Maker's Heat Sink, 12 BridgeLux Vero 18's,3 purpose built 5 channel A6211 Led driver/Controllers, and a 20lb CO2 system w/ Milwaukee Ph Controller.
O2surplus is offline   Reply With Quote Quick reply to this message
Old 02-21-2013, 08:09 PM   #141
sink
Algae Grower
 
PTrader: (2/100%)
Join Date: Jun 2011
Location: Boston, MA
Posts: 147
Default

Hi buddy. I hope you're well
Work, mostly, with the woods being a close second. Also my tank is well established and the lighting setup Just Works so I haven't spent a lot of time thinking about the internals.
sink is offline   Reply With Quote Quick reply to this message
Old 02-22-2013, 07:08 AM   #142
Gisimo
Algae Grower
 
PTrader: (0/0%)
Join Date: Apr 2012
Location: Denmark
Posts: 17
Default

Hey sink would it be possible to make 3 channels instead of two??
I have one blue light and i would like to use it as a moon light !!
And i alreaddy use the two channels !!
Gisimo is offline   Reply With Quote Quick reply to this message
Old 02-22-2013, 12:01 PM   #143
sink
Algae Grower
 
PTrader: (2/100%)
Join Date: Jun 2011
Location: Boston, MA
Posts: 147
Default

That has been a common request. I may end up adding a binary (just off or 5V) moonlight output eventually, but I am hesitant to add too much complexity. In many ways, the code is already more complex than I want it to be -- the plan was to have a barebones lighting system that was simple enough behind the scenes that by looking at it, reasonably techie people could see how to add their own things (CO2 control, temp, etc) where needed.

In any case, if I had a single moonlight I would just rig it to be on all of the time. Much easier and you won't notice it on during the day anyway with the normal lighting active.
sink is offline   Reply With Quote Quick reply to this message
Old 02-22-2013, 03:55 PM   #144
Gisimo
Algae Grower
 
PTrader: (0/0%)
Join Date: Apr 2012
Location: Denmark
Posts: 17
Default

Ok tanks sink!!
Gisimo is offline   Reply With Quote Quick reply to this message
Old 04-04-2013, 04:50 AM   #145
shrimper23
Algae Grower
 
PTrader: (0/0%)
Join Date: Oct 2011
Location: Franktown,CO
Posts: 5
Default

Hey Sink, so i'm really liking the look of your code and would like to use it on my new pico reef. However, I need 6 channels to control the fixture. How would i go about adding 4 more outputs? It seems to me i'd need to add the libraies for the other 2 timers, but will using different timers effect my dimming between channel's? I'm still very new to arduino, (this is my very first project) so i would very much appreciate your help. Thanks!
shrimper23 is offline   Reply With Quote Quick reply to this message
Old 04-04-2013, 03:26 PM   #146
sink
Algae Grower
 
PTrader: (2/100%)
Join Date: Jun 2011
Location: Boston, MA
Posts: 147
Default

Quote:
Originally Posted by shrimper23 View Post
Hey Sink, so i'm really liking the look of your code and would like to use it on my new pico reef. However, I need 6 channels to control the fixture. How would i go about adding 4 more outputs? It seems to me i'd need to add the libraies for the other 2 timers, but will using different timers effect my dimming between channel's? I'm still very new to arduino, (this is my very first project) so i would very much appreciate your help. Thanks!
The TimerOne library is only there to provide high-resolution output -- if coarser control is fine for your other channels you don't need libraries for them. Dimming for other channels would be the same, except your range would only be 8 bits (0-255) so you'd have to figure the math for that out in the code. As far as how the timers interrelate to each other...I'm not positive It probably varies by device, but Google should be able to provide an answer there. It may be that you are limited to how many PWM outputs you can sent at once using the HW timers.

For making the changes to the code, you'd just basically duplicate what I've done for the two channels for the other four, creating appropriate variables and adding lines where needed in the dimming code etc. It's not that bad.
sink is offline   Reply With Quote Quick reply to this message
Old 04-04-2013, 11:11 PM   #147
shrimper23
Algae Grower
 
PTrader: (0/0%)
Join Date: Oct 2011
Location: Franktown,CO
Posts: 5
Default

So if I added the libraries would I achieve higher resolution outputs on the other 4? What is the resolution of the outputs as the code stands? Could I perhaps add an I2C pwm breakout to my contoller such as this one? http://adafruit.com/products/815
I'd like to retain the higher resolution on all channels if possible. Also, I am using meanwell LDD-L's to drive my LED's if it makes any difference.
shrimper23 is offline   Reply With Quote Quick reply to this message
Old 04-04-2013, 11:46 PM   #148
sink
Algae Grower
 
PTrader: (2/100%)
Join Date: Jun 2011
Location: Boston, MA
Posts: 147
Default

Quote:
Originally Posted by shrimper23 View Post
So if I added the libraries would I achieve higher resolution outputs on the other 4?
Theoretically, but it is awkward. For example, messing with the settings for Timer0 will affect built in functions like delay() and millis() because they get their timing from it under the hood. There might be libraries to compensate for this, but I haven't really looked.
Quote:
What is the resolution of the outputs as the code stands?
Normally Arduino PWM outputs are 8 bits. The TimerOne library allows 10 bits resolution on its two outputs.
Quote:
Could I perhaps add an I2C pwm breakout to my contoller such as this one?
That thing looks sweet! 16 independent outputs with 12 bits of resolution. You'd have to make some changes to the code to use it, but ultimately with 6 (or more) outputs the code would be simpler using something like that. Plus you wouldn't have to deal with the libraries. Do note that at some point the limiting factor for how precisely you can set light level will be the driver itself (and how it interprets the PWM signal) and not the resolution of the PWM output itself.

Quote:
I'd like to retain the higher resolution on all channels if possible. Also, I am using meanwell LDD-L's to drive my LED's if it makes any difference.
The driver does certainly make a difference, but I couldn't speak as to how well the PWM control is for that driver. The control on some drivers is quite nonlinear at the low end (< 10% of light output) and can be inconsistent for fast PWM signals.
sink is offline   Reply With Quote Quick reply to this message
Old 04-05-2013, 03:15 AM   #149
shrimper23
Algae Grower
 
PTrader: (0/0%)
Join Date: Oct 2011
Location: Franktown,CO
Posts: 5
Default

Sounds like I need to order that breakout! I already have 2 slave devices on my I2C, I would think adding this would be alright, correct me if I'm wrong. These are the current devices:
http://www.adafruit.com/products/264
http://www.adafruit.com/product/772
Better yet, I can now get full control on the refugium lights as well! 7 channels over a 4 gallon, gotta love DIY!

I was originally planning on the CAT's, then I got talking to a customer while testing his water. He peaked my interest when he told me about the LDD's. Then brought me 2 of the PCB's he had for them as a Christmas gift! From what I've read they have the best of dimming accuracy so I don't think it should be an issue.
shrimper23 is offline   Reply With Quote Quick reply to this message
Old 04-09-2013, 10:50 PM   #150
shrimper23
Algae Grower
 
PTrader: (0/0%)
Join Date: Oct 2011
Location: Franktown,CO
Posts: 5
Default

Any idea on the I2C capability guys? Also, Sink, a quick question on your code, I see you name the channels with a "k". Such as kChan0Pin, is there a reason for this? Just wondering as I haven't seen this before.
shrimper23 is offline   Reply With Quote Quick reply to this message
Reply

Quick Reply
Message:
Options

Register Now

In order to be able to post messages on the The Planted Tank Forum forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.
User Name:
If you do not want to register, fill this field only and the name will be used as user name for your post.
Password
Please enter a password for your user account. Note that passwords are case-sensitive.
Password:
Confirm Password:
Email Address
Please enter a valid email address for yourself.
Email Address:

Log-in

Human Verification

In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.



Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:13 AM.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright Planted Tank LLC 2012