John's DIY LED/T5 Hybrid Build



I shot a video of the wall as my led ramped up to about 60% and back down to zero. The brightness adjustment near zero is a little choppy, so I will have to see what I can do about it.

Hoping to start building the fixture this weekend (or atleast a prototype to hang over my tank).
 
More progress.

I needed away to keep things together and organized so I came up with this....

20140503_181650.jpg
alt="" />

20140503_181707.jpg
alt="" />

It is just a board with slots that fit the heat sinks, holes for the LEDs, and the components mounted. Planning on an acrylic enclosure of some sort. The board is a cheap and effective way to play with spacing and mounting locations.

Next steps:
1. Power the fans
2. Run PWM lines
 
It's been a minute, but I am back on this project. I have a few questions.

Last night, I determined that I could hear the pwm switching. Is this normal? It was very faint and would otherwise be masked by the fans. I am just curious if anyone else has heard this before.

I am trying to come up with a decent enclosure for the LEDs. I have seen fabricated aluminum, acrylic, and wood enclosures. Using wood doesn't sound like a good option to me. Have you seen anything else?
 
Not really. Looking into a couple different options, including a local place to fabricate an acrylic enclosure.
 
As always, plans change. I started this thread almost a year ago! My 60 gallon tank is still running, but on it's last leg. I've all but let it go because of an unexplained contamination issue. I basically top off the water and feed my fish.

In the last several months, I've been acquiring new equipment for the next build. I've been transitioning my livestock to a 20 gallon tall tank over the last few months and I have been using the LEDs, power supply, and drivers from this thread.

I thought it was time for an update!

I adapted the fixture to be smaller and just LEDs. I've setup two of the 30w chips and 6 of the blue 3 watt LEDs. After using this setup for a number of months now, I can tell you that two of the 30w chips is way over kill for my application. In fact, I've actually only had power going to one of the 30w chips since day one and I've been ramping it up to a lower maximum intensity ever since. I do, however, think I've finally arrived at a decent lighting schedule (time + intensity). Which brings me to the next logical step of this process. Programming the Arduino.

I've already posted links to youtube videos as an introduction to the Arduino environment. I think they are an excellent place to start for those interested.

I've posted my code below. After some googling, and experimenting with different codes, this is the best I could come up with. The code is very basic. The controller's only purpose is to ramp up and down the LEDs on a specified schedule while referencing the clock. Yes, in order to adjust the light schedule and intensity, I have to connect the Arduino to my computer. While I thought this would be a pain, it hasn't been that bad. How often do we really adjust our lighting schedule? As this project progresses, I'll have to consider whether or not it is worth the time, money, and effort to build in some sort of user interface that is more convenient (display, way to adjust the schedule, etc.).

I welcome any feedback on ways to make the code more efficient. Thanks in advance!

<pre class="code">// Date and time functions using a DS1307 RTC connected via I2C and Wire library
#include &lt;Wire.h&gt;
#include &quot;RTClib.h&quot;
RTC_DS1307 rtc;
// PINS 8-10 have an LED connected to it for PWM control
int LED1 = 8;
int LED2 = 9;
int LED3 = 10;
// Set controllable inputs to initial value
// The LED drivers need a full 255 PWM signal to turn off.
int onHour = 0;
int onMin = 15;
int rampPeriod = 90;
int whiteDelay = 90;
int offHour = 9;
int offMin = 30;
int LEDBlueHigh = 150;
int LEDBlueLow = 254;
int LEDWhiteHigh = 220;
int LEDWhiteLow = 253;
int blueLevel = LEDBlueLow;
int whiteLevel = LEDWhiteLow;
int minutes = 0;
// The setup routine runs one time
void setup () {
// Start serial communication for the RTC
Serial.begin(57600);
#ifdef AVR
Wire.begin();
#else
Wire1.begin(); // Shield I2C pins connect to alt I2C bus on Arduino
#endif
rtc.begin();
if (! rtc.isrunning()) {
Serial.println(&quot;RTC is NOT running!&quot;);
// The following line sets the RTC to the date & time this sketch was compiled (uncomment to initially set the clock)
// rtc.adjust(DateTime(__DATE__, __TIME__));
delay (50);
}
//Set pin modes for LED PWM control
pinMode (LED1, OUTPUT);
pinMode (LED2, OUTPUT);
pinMode (LED3, OUTPUT);
// Should lights be on?
DateTime now = rtc.now(); // What time is it?
delay (20);
minutes = now.hour()*60 + now.minute(); // Compute the number of minutes since 0:00
delay (20);
// Should Blue Lights Be On?
if (minutes &gt; ((onHour * 60) + onMin + rampPeriod) && minutes &lt; ((offHour * 60) + offMin - rampPeriod)){
analogWrite (LED2, LEDBlueHigh);
}
else {
analogWrite (LED2, LEDBlueLow);
}
// Should White Lights Be On?
if (minutes &gt; ((onHour * 60) + onMin + rampPeriod + whiteDelay) && minutes &lt; ((offHour * 60) + offMin - rampPeriod - whiteDelay)){
analogWrite (LED1, LEDWhiteHigh);
analogWrite (LED3, LEDWhiteHigh);
}
else {
analogWrite (LED1, LEDWhiteLow);
analogWrite (LED3, LEDWhiteLow);
}
}
// The loop routine runs over and over again forever
void loop () {
//What is the time now?
DateTime now = rtc.now();
delay (20);
minutes = now.hour() * 60 + now.minute(); //Compute the number of minutes since 0:00
delay (20);

//BLUE RAMP UP
if (minutes &gt;= ((onHour * 60) + onMin) && minutes &lt;= ((onHour * 60) + onMin + rampPeriod)) {
blueLevel = map(minutes,(onHour * 60) + onMin,((onHour * 60) + onMin + rampPeriod),LEDBlueLow,LEDBlueHigh);
analogWrite (LED2, blueLevel);
delay(20);
}
//BLUE RAMP DOWN
if (minutes &gt;= ((offHour * 60) + offMin - rampPeriod) && minutes &lt;= ((offHour * 60) + offMin)) {
blueLevel = map(minutes,(offHour * 60) + offMin - rampPeriod,(offHour * 60) + offMin,LEDBlueHigh,LEDBlueLow);
analogWrite (LED2, blueLevel);
delay(20);
}
//WHITE RAMP UP
if (minutes &gt;= ((onHour * 60) + onMin + whiteDelay) && minutes &lt;= ((onHour * 60) + onMin + rampPeriod + whiteDelay)) {
whiteLevel = map(minutes,(onHour * 60) + onMin + whiteDelay,((onHour * 60) + onMin + rampPeriod + whiteDelay),LEDWhiteLow,LEDWhiteHigh);
analogWrite (LED1, whiteLevel);
analogWrite (LED3, whiteLevel);
delay(30);
}
//WHITE RAMP DOWN
if (minutes &gt;= ((offHour * 60) + offMin - rampPeriod - whiteDelay) && minutes &lt;= ((offHour * 60) + offMin - whiteDelay)) {
whiteLevel = map(minutes,(offHour * 60) + offMin - rampPeriod - whiteDelay,(offHour * 60) + offMin - whiteDelay,LEDWhiteHigh,LEDWhiteLow);
analogWrite (LED1, whiteLevel);
analogWrite (LED3, whiteLevel);
delay(30);
}
//Print the lighting levels and number of minutes to the serial monitor for troubleshooting
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println();
Serial.print(minutes);
Serial.println();
Serial.print(blueLevel);
Serial.print(&quot; BLUE&quot;);
Serial.print(whiteLevel);
Serial.print(&quot; WHITE&quot;);
Serial.println();
//
delay(50);
}</pre>
 
Back
Top