Calling all DIY LED "Junkies" - Your opinions wanted! - 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 11-28-2012, 04:31 AM   #136
O2surplus
Planted Tank Enthusiast
 
O2surplus's Avatar
 
PTrader: (4/100%)
Join Date: Jan 2010
Location: yorba linda, ca.
Posts: 565
Default

Quote:
Originally Posted by theblondskeleton View Post
And THAT'S why I asked, haha... This should be all I need to do. It's at 100 right now, so that explains why it seems so dim. I was thinking: "this is 1000 mA? No way!" Makes sense now: it WASN'T! Thanks for saving me again!

I may try sink's code, but that may wait until winter break.
LOL It's been a while since I used that code, so naturally I had forgotten to mention that " you may want to turn up this variable a bit". Your comment about the " seemingly dim leds" jogged my memory though, Haha!
__________________
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
Sponsored Links
Advertisement
 
Old 12-02-2012, 07:07 PM   #137
theblondskeleton
Planted Tank Enthusiast
 
theblondskeleton's Avatar
 
PTrader: (13/100%)
Join Date: Aug 2009
Location: Vancouver, WA, USA
Posts: 541
Default

Ha, no problem I thought there was something I didn't know going on. I swapped in sink's code, and combined my two WW strings and CW strings so that they can run through the same 2 PWMs. Now I have what I needed: too much light, haha! So, I'm using the analog control to dim the CW as much as possible, and I'll be tinkering with light levels over the next few weeks. I also set up the CW to run as moonlights at night - that's kind of neat: the color is much more agreeable than the royal blues I was using before. I'm just hoping that it doesn't cause too much algae trouble, I'll keep it low and see how it goes.

Now, to see how I can use this bad boy to control my CO2 - I'm SO sick of my mechanical timers getting jammed. Do you know of anyone who has a code/setup for this?
theblondskeleton is offline   Reply With Quote
Old 12-02-2012, 10:02 PM   #138
O2surplus
Planted Tank Enthusiast
 
O2surplus's Avatar
 
PTrader: (4/100%)
Join Date: Jan 2010
Location: yorba linda, ca.
Posts: 565
Default

Quote:
Originally Posted by theblondskeleton View Post

Now, to see how I can use this bad boy to control my CO2 - I'm SO sick of my mechanical timers getting jammed. Do you know of anyone who has a code/setup for this?
If all you need to do is activate a solenoid- That's easy. Just use a relay that accepts a 5V control signal. You can then switch the power to your solenoid "on/off" with the addition of a little extra code added to your lighting program. Here's some reading material for you-
Controllable Power Outlet - SparkFun Electronics
__________________
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
Old 12-02-2012, 11:28 PM   #139
O2surplus
Planted Tank Enthusiast
 
O2surplus's Avatar
 
PTrader: (4/100%)
Join Date: Jan 2010
Location: yorba linda, ca.
Posts: 565
Default

I've decided to "go back to the drawing board" in an effort to create something new. This little project will be aimed at providing a "one stop solution" for DIY Led lighting that electronics/programming novices can tackle with relative ease. Think- "a DIM4 on steroids" LOL.
I've essentially married the "Typhon" Led controller directly to two different types of led drivers. The controller PCB will mount directly on top of the driver PCB and keep all the "guts" of the led lighting system in one small, tidy arrangement. No programming experience will be needed to make this project work, as it will only need to be programmed once and any further tweaks will be made using the buttons and the LCD interface.


First up is the Controller- It's my version of the "Typhon controller" with 4 channels of lighting control. Each channel can be independently programmed for Start time, end time, Max & Min intensity, ect.. I also include two analog inputs for temp sensing/ PAR measurement, whatever is desired.




Next is the first of two styles of led drivers. The first will contain 4 of the band new Meanwell LDD-H drivers. These drivers can be purchased for less than $10 each and are available with different maximum current ratings up to 1000ma each. They can operate in excess of 48 volts, so long strings of 12 -15 leds are possible. Each of the 4 drivers will take it's dimming signals directly from the controller mounted on top.



The next driver is Based on the National Semi-Conductor LN3409. I designed these drivers to utilize components that will allow them to run led loads up to 60 volts/ 3,000 ma. This design will allow the newer Cree XM-L leds to be run at their Max. Each driver's maximum current output can be custom tailored using the on board trim pot. Since each PCB can only hold 2 LM3409's. The driver PCB will be split to create 2 driver sub boards that will mount under the controller. I include selectable jumpers in the design to allow each driver to be addressable by the controller.



That's it for now- the PCB's needed for this project arrive tomorrow. I'll post some pictures of the finished product after it's put together.
__________________
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
Old 12-05-2012, 02:13 PM   #140
cheesehead
Algae Grower
 
PTrader: (0/0%)
Join Date: Jun 2007
Location: River Falls, WI
Posts: 34
Default

Nice. I'll be following. Hope to work this into a planned full-spectrum build for my 200 gallon! I won't need the controller, but the LM3409 would be great for either XM-L or 100W chinese chip array build.

Quote:
Originally Posted by O2surplus View Post
I've decided to "go back to the drawing board" in an effort to create something new. This little project will be aimed at providing a "one stop solution" for DIY Led lighting that electronics/programming novices can tackle with relative ease. Think- "a DIM4 on steroids" LOL.

The next driver is Based on the National Semi-Conductor LN3409. I designed these drivers to utilize components that will allow them to run led loads up to 60 volts/ 3,000 ma. This design will allow the newer Cree XM-L leds to be run at their Max. Each driver's maximum current output can be custom tailored using the on board trim pot. Since each PCB can only hold 2 LM3409's. The driver PCB will be split to create 2 driver sub boards that will mount under the controller. I include selectable jumpers in the design to allow each driver to be addressable by the controller.

That's it for now- the PCB's needed for this project arrive tomorrow. I'll post some pictures of the finished product after it's put together.
cheesehead is offline   Reply With Quote
Old 12-05-2012, 03:03 PM   #141
O2surplus
Planted Tank Enthusiast
 
O2surplus's Avatar
 
PTrader: (4/100%)
Join Date: Jan 2010
Location: yorba linda, ca.
Posts: 565
Default

Quote:
Originally Posted by cheesehead View Post
Nice. I'll be following. Hope to work this into a planned full-spectrum build for my 200 gallon! I won't need the controller, but the LM3409 would be great for either XM-L or 100W chinese chip array build.
Thanks Cheesehead!

Let me know if you want any PCB build files for the LM3409. I've been playing around with a few different designs lately and found that they're a lot more flexible with their input voltages/ output voltages, than I'd previously thought. I'd built most of mine to drive 50 watt BridgeLux multi-emitter arrays that have a Vf of 24.4v and need 2,000 ma, but I've found that the same drivers will also drive much higher voltages and lower currents 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
Old 12-06-2012, 04:03 AM   #142
biogenetic40379
Planted Member
 
PTrader: (2/100%)
Join Date: Jan 2012
Location: Columbia, MO
Posts: 275
Default

How much does it cost to make something like this to control full spectrum lighting. Looking at making one for my bio cube (reef w/ led retro fit coming soon)
__________________
biogenetic40379 is offline   Reply With Quote
Old 12-06-2012, 02:22 PM   #143
O2surplus
Planted Tank Enthusiast
 
O2surplus's Avatar
 
PTrader: (4/100%)
Join Date: Jan 2010
Location: yorba linda, ca.
Posts: 565
Default

Quote:
Originally Posted by biogenetic40379 View Post
How much does it cost to make something like this to control full spectrum lighting. Looking at making one for my bio cube (reef w/ led retro fit coming soon)
By rough estimate - A controller with 4 MeanWell LDD drivers = $100. The Lm3409 drivers would drive the price up another $30.

I'm in the process of building the first one right now. When I'm done testing it and make any needed changes, I'll post the revised build files along with the Bill of Materials ( with links for purchasing) and the Software.
__________________
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
Old 12-12-2012, 10:33 PM   #144
skanderson
Algae Grower
 
PTrader: (0/0%)
Join Date: Jul 2010
Location: baraboo, wi
Posts: 141
Default

ok been too busy with other projects to mess with the coding and get it working. is there a way that i could download someone elses dimming and timing code to get it up and working. all im looking for is a 1 to2 hour ramp up and down with a 12 hour on/off cycle for all 6 channels. and i will definately be interested in the new build you are putting together. thanks again in advance, steve
skanderson is offline   Reply With Quote
Old 12-12-2012, 10:41 PM   #145
O2surplus
Planted Tank Enthusiast
 
O2surplus's Avatar
 
PTrader: (4/100%)
Join Date: Jan 2010
Location: yorba linda, ca.
Posts: 565
Default

Quote:
Originally Posted by skanderson View Post
ok been too busy with other projects to mess with the coding and get it working. is there a way that i could download someone elses dimming and timing code to get it up and working. all im looking for is a 1 to2 hour ramp up and down with a 12 hour on/off cycle for all 6 channels. and i will definately be interested in the new build you are putting together. thanks again in advance, steve


Here's some code that will get you up and running. Just adjust the variables to your liking and let-her-rip.

Code:
/*
// ATMEG328P-AU Microcontroller LED lighting controller for aquarium use. 
// The programming code uses a DS1307 Real Time clock to set the LED lighting schedule. Current date and time can be accessed with the serial monitor set to 9600 baud.
// sunrise/sunset time,length of fade duration, and the length of the day are selectable via the programmed schedule.  
//  Circuit description
// PWM pins described below connected to dimming circuits on drivers spread among 6 seperate channels.
// DS1307 RTC ( real time clock) connected via I2C protocol.
*/



// Pins to control each channel LEDs. Change these if you're using different pins.

int oneLed = 3;       // LED PWM arduino pin for channel one.

int twoLed = 5;       // LED PWM arduino pin for channel two 

int threeLed = 6;     // LED PWM arduino pin for channel three

int fourLed = 9;      // LED PWM arduino pin for channel four

int fiveLed = 10;     // LED PWM arduino pin for channel five

int sixLed = 11;      // LED PWM arduino pin for channel six


#include <WProgram.h>
#include <DS1307.h> 
// written by  mattt on the Arduino forum and modified by D. Sjunnesson



// Set up RTC

#include "Wire.h"

#define DS1307_I2C_ADDRESS 0x68



// RTC variables

byte second, rtcMins, oldMins, rtcHrs, oldHrs, dayOfWeek, dayOfMonth, month, year;



// Other variables. These control the behavior of lighting. Change these to customize behavior.

int minCounter = 0;         // counter that resets at midnight. Don't change this.



int oneStartMins = 540;     // minute to start channel 1. Change this to the number of minutes past midnight you want to start

int twoStartMins =420;      // minute to start channel 2. Change this to the number of minutes past midnight you want to start                         

int threeStartMins =540;    // minute to start channel 3. Change this to the number of minutes past midnight you want to start 

int fourStartMins =420;     // minute to start channel 4. Change this to the number of minutes past midnight you want to start 

int fiveStartMins =420;     // minute to start channel 5. Change this to the number of minutes past midnight you want to start 

int sixStartMins =420;      // minute to start channel 6. Change this to the number of minutes past midnight you want to start 


int onePhotoPeriod = 720;   // photoperiod in minutes, for this channel. Change this to alter the total legnth of the day

int twoPhotoPeriod = 960;   // photoperiod in minutes, for this channel. Change this to alter the total legnth of the day                           

int threePhotoPeriod = 720; // photoperiod in minutes, for this channel. Change this to alter the total legnth of the day

int fourPhotoPeriod = 960;  // photoperiod in minutes, for this channel. Change this to alter the total legnth of the day

int fivePhotoPeriod = 960;  // photoperiod in minutes, for this channel. Change this to alter the total legnth of the day

int sixPhotoPeriod = 960;   // photoperiod in minutes, for this channel. Change this to alter the total legnth of the day


int fadeDuration = 180;      // duration of the fade on and off for sunrise and sunset. Change
                            
//    this to alter how long the fade lasts.

int oneMax = 255;           // max intensity for this channel. Change if you want to limit max intensity.

int twoMax = 255;           // max intensity for this channel. Change if you want to limit max intensity. 

int threeMax = 255;         // max intensity for this channel. Change if you want to limit max intensity.

int fourMax = 255;          // max intensity for this channel. Change if you want to limit max intensity.

int fiveMax = 255;          // max intensity for this channel. Change if you want to limit max intensity.

int sixMax = 255;           // max intensity for this channel. Change if you want to limit max intensity.

/****** LED Functions ******/

/***************************/

//function to set LED brightness according to time of day

//function has three equal phases - ramp up, hold, and ramp down

void setLed(int mins,    // current time in minutes
            
int ledPin,  // pin for this channel of LEDs
            
int start,   // start time for this channel of LEDs
            
int period,  // photoperiod for this channel of LEDs
            
int fade,    // fade duration for this channel of LEDs
            
int ledMax   // max value for this channel
            
)  {
  
if (mins <= start || mins <= mins > start + period)  {
    
analogWrite(ledPin, 0);
  
}// This is when the led's are off, thus ledVal =0
  
if (mins > start && mins <= start + fade)  {
    
analogWrite(ledPin, map(mins - start, 0, fade, 0, ledMax));
  
}// This is sunrise. Leds slowly brighten to full intensity
    
if (mins > start + fade && mins <= start + period - fade)  {
   
analogWrite(ledPin, ledMax);
  
}//This is when the led's are at maximum intensity
    
if (mins > start + period - fade && mins <= start + period)  {
    
analogWrite(ledPin, map(mins - start - period + fade, 0, fade, ledMax, 0));
  
}// This is sunset. LEDs slowly fade out.

}



/***** RTC Functions *******/

/***************************/

// Convert normal decimal numbers to binary coded decimal

byte decToBcd(byte val)

{
  
return ( (val/10*16) + (val%10) );

}



// Convert binary coded decimal to normal decimal numbers

byte bcdToDec(byte val)

{
  
return ( (val/16*10) + (val%16) );

}



// 1) Sets the date and time on the ds1307

// 2) Starts the clock

// 3) Sets hour mode to 24 hour clock

// Assumes you're passing in valid numbers.



/* //remove the forward slash and asterisk at the far left to activate the time date setting code




void setDateDs1307(byte second, // 0-59 
                   
byte minute, // 0-59
                   
byte hour, // 1-23
                   
byte dayOfWeek, // 1-7
              
byte dayOfMonth, // 1-28/29/30/31
                   
byte month, // 1-12
                   
byte year) // 0-99

{
   
Wire.beginTransmission(DS1307_I2C_ADDRESS);
   
Wire.send(0);
   
Wire.send(decToBcd(second));
   
Wire.send(decToBcd(minute));
   
Wire.send(decToBcd(hour));
   Wire.send(decToBcd(dayOfWeek));
   
Wire.send(decToBcd(dayOfMonth));
   
Wire.send(decToBcd(month));
   
Wire.send(decToBcd(year));
   
Wire.endTransmission();
     
                             

}

*/ //remove the forward slash and asterisk at the far left to activate the time date setting code



// Gets the date and time from the ds1307 via the I2C protocol.

void getDateDs1307(byte *second,
          
byte *minute,
          
byte *hour,
          
byte *dayOfWeek,
          
byte *dayOfMonth,
          
byte *month,
          
byte *year)

{
  
Wire.beginTransmission(DS1307_I2C_ADDRESS);
  
Wire.send(0);
  
Wire.endTransmission();

  

Wire.requestFrom(DS1307_I2C_ADDRESS, 7);

  
*second     = bcdToDec(Wire.receive() & 0x7f);
  
*minute     = bcdToDec(Wire.receive());
  
*hour       = bcdToDec(Wire.receive() & 0x3f);
  
*dayOfWeek  = bcdToDec(Wire.receive());
  
*dayOfMonth = bcdToDec(Wire.receive());
  
*month      = bcdToDec(Wire.receive());
  
*year  = bcdToDec(Wire.receive());

}



void setup()  { 
    


// init I2C  
  
Serial.begin(9600);
  
Wire.begin();
} 
// these functions only occur once.



/***** Main Loop ***********/

/***************************/

void loop() { 

 
 
  

// get time from RTC and put in hrs and mins variables
  
getDateDs1307(&second, &rtcMins, &rtcHrs, &dayOfWeek, &dayOfMonth, &month, &year);
  
minCounter = rtcHrs * 60 + rtcMins;
 
Serial.print(RTC.get(DS1307_HR,true)); //read the hour and also update all the values by pushing in true
  
Serial.print(":");
  
Serial.print(RTC.get(DS1307_MIN,false));//read minutes without update (false)
  
Serial.print(":");
  
Serial.print(RTC.get(DS1307_SEC,false));//read seconds
  
Serial.print("      "); // some space for a more happy life
  
Serial.print(RTC.get(DS1307_MTH,false));//read month
  
Serial.print("/");
  
Serial.print(RTC.get(DS1307_DATE,false));//read date
  
Serial.print("/");
  
Serial.print(RTC.get(DS1307_YR,false)); //read year 
  
Serial.println();


//set LED values
  
setLed(minCounter, oneLed, oneStartMins, onePhotoPeriod, fadeDuration, oneMax);
  
setLed(minCounter, twoLed, twoStartMins, twoPhotoPeriod, fadeDuration, twoMax);
  
setLed(minCounter, threeLed, threeStartMins, threePhotoPeriod, fadeDuration, threeMax);
  
setLed(minCounter, fourLed, fourStartMins, fourPhotoPeriod, fadeDuration, fourMax);
 
setLed(minCounter, fiveLed, fiveStartMins, fivePhotoPeriod, fadeDuration, fiveMax);
   
setLed(minCounter, sixLed, sixStartMins, sixPhotoPeriod, fadeDuration, sixMax);
 
// Get ready for next iteration of loop
  
delay(1000);

}
__________________
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
Old 12-14-2012, 03:49 PM   #146
skanderson
Algae Grower
 
PTrader: (0/0%)
Join Date: Jul 2010
Location: baraboo, wi
Posts: 141
Default

ok now to sound really dumb, how do i get this into the ardino. do i type it in or can i import it?
skanderson is offline   Reply With Quote
Old 12-14-2012, 04:04 PM   #147
jarvitron
Algae Grower
 
PTrader: (0/0%)
Join Date: Aug 2012
Location: Portland, OR
Posts: 114
Default

Quote:
Originally Posted by skanderson View Post
ok now to sound really dumb, how do i get this into the ardino. do i type it in or can i import it?
There's no such thing as a dumb question, but that's a dumb question for an aquarium forum.
jarvitron is offline   Reply With Quote
Old 12-14-2012, 04:42 PM   #148
O2surplus
Planted Tank Enthusiast
 
O2surplus's Avatar
 
PTrader: (4/100%)
Join Date: Jan 2010
Location: yorba linda, ca.
Posts: 565
Default

Quote:
Originally Posted by skanderson View Post
ok now to sound really dumb, how do i get this into the ardino. do i type it in or can i import it?

Copy&Paste my friend!

Highlight all code that I posted, Right Click "COPY" and then Paste it into the Arduino IDE.
Click the button that says VERIFY to make sure that it compiles properly, and then either "Save" the Sketch or "Upload" it to the Arduino.
__________________
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
Old 12-14-2012, 05:07 PM   #149
mistergreen
No more Bow ties
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 13,947
Default

Quote:
Originally Posted by skanderson View Post
ok now to sound really dumb, how do i get this into the ardino. do i type it in or can i import it?
Copy and paste but make sure to download and place libraries in the right place. When you try to compile, the arduino app will yell at you.
mistergreen is offline   Reply With Quote
Old 12-14-2012, 05:27 PM   #150
mistergreen
No more Bow ties
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 13,947
Default

I just noticed something in the code, for those that had a hard time with the code.

This is a release note from the arduino app last year.

Quote:
* The WProgram.h file, which provides declarations for the Arduino API,
has been renamed to Arduino.h. To create a library that will work in
both Arduino 0022 and Arduino 1.0, you can use an #ifdef that checks
for the ARDUINO constant, which was 22 and is now 100. For example:

#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
mistergreen is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not 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 09:30 AM.


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