(Another) DIY LED Controller - Simple Arduino Style

You guys are driving me crazy. I started with the basic sketch and now am working on ReefNinja's sketch and now there is this new one by Liquid arts....UGH.

ReefNinja is there a way to turn on the fans based on the temp of the heat sink? I put temp sensor on my heat sink with out the fans on and it was around 120 so I turned on the fans and went straight down.

Thanks and I really appreciate all that you guys are doing to help all of us to have fun and build something usable.

Thanks again
Rawn

Temp control code:

Code:
// DS18B20 display
sensors.requestTemperatures(); // Send the command to get temperatures
    // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(13, 2);

float temp1=0, temp2=0;


  //lcd.print("Led Temp:");
    temp1= sensors.getTempFByIndex(1);
  lcd.print(sensors.getTempFByIndex(1)); 
  lcd.print((char)223);
  lcd.print("F");
 
  lcd.setCursor(2, 2);
  //lcd.print("Tank Temp: ");
    temp2= sensors.getTempFByIndex(1);
  lcd.print(sensors.getTempFByIndex(0)); 
  lcd.print((char)223);
  lcd.print("F");
  
  if ( (temp1) > 98)
    {
    digitalWrite(fan, HIGH);
      lcd.setCursor(17, 3);
      lcd.print("On ");
    }
else if ( (temp1) < 92)
    {
  digitalWrite(fan, LOW);
  lcd.setCursor(17, 3);
  lcd.print("Off");
    }

if ( (temp2) < 78 )
    {
    digitalWrite(heater, HIGH);
    }
else if ( (temp2) > 82 )
    {
    digitalWrite(heater, LOW);
    } 
   
//  lcd.print(sensors.getTempCByIndex(0));
//  lcd.print((char)223); 
//  lcd.print("C");
  
  //delay(500);
 
but remember if you use that and the sensor doesnt read right you could cook your LED's. im just saying watch your stuff. I would never do it like this after seeing a misreading every so often. its only happened a few times but if the fans dont come on then my rig would cook.
 
Guys what would you think ?

I was looking at my tank with new lighting pattern for a good week now, and I can say that I dont like it very much. During ramp up and ramp down , when blues are more than 30% and whites are off, my tank starts looking more like night clubs dancing floor, than piece of an ocean. Corals looks more happy with ramping light than before though.

Can we change code that whites start to fade in when blues are at say 30% (now 100%) and continue at their own rhythm ? That would dilute royal blue atmosphere to the right level.
 
So, my light is up. Not only reduce the time from 10 hours to 9 hours, I also control the PWM that only power up to 80% max (100%=255). Still lots of algae. Should I cut down the photoperiod?
 
no let it run its course mine had bad algae for a few weeks after the switch to this light cycle then it all worked it self out.
 
Hi All, Firstly let me thank you all for so informative and of helping nature. I am a noob in electronics and software but still i could understand the whole controller. Thanks to katchupoy & TheReefNinja you guys are great.

Further i have built my own LED setup which 10 blue and 10 white each string running on separate ELN 60 48 D and i am really into this controller. I want to start with a basic design for LED and then move forward. After reading the whole topic i have a few questions for you guys.

1. How many Arduino i require to program my LED's (Both Blue and White)
2. Do i need to put LCD now or i can incorporate it later ?
3. What are the best kit for this project (I am running on a budget) i want to minimize the cost moreover i live in UAE and it is very difficult to get the parts locally.

Thanks in advance
 
Hi jag,

Short version:

1. 1 arduino is more than enough.
2. Your choice. LCD is just cool adition.
3. Look on ebay or elsewhere for Duemilanove or similar. I paid $19 including shipping. Very much in budget I thing.
 
1. How many Arduino i require to program my LED's (Both Blue and White)
2. Do i need to put LCD now or i can incorporate it later ?
3. What are the best kit for this project (I am running on a budget) i want to minimize the cost moreover i live in UAE and it is very difficult to get the parts locally.

Thanks in advance

1. You only need one Arduino.For smaller projects use the Uno or Dueo,but for larger projects use a Mega.
2. No, an LCD isn't needed but helps and comes with kits from ebay.The best way to save pins is to use an I2C LCD controller that only uses 2 pins instead of 6 pins.
3. The Cheapest Kit was this one.

So to recap here are the parts again as follows:

I2C LCD Controller Can be added later on with an LCD when your ready.
DS1307 RTC Clock
Dueo Kit Beginner kit for the dueo comes with everything
Enclosure The case I use for my Dueo and 16x2 LCD
Power Supply I recommend using a 2.1mm 9V power supply with at least 600mA that is from your country.
 
Nobody responded to my fantasies so I decided to investigate by myself. And learn a little. There is where I ve got at the moment.

Can experts take a look - if this possible at all ?

I dont know how to get only first two digits printed to lcd if result is like 17.87256823746234 ? I only need 17.

Please dont laugh as it is my first attempt in C++ :reading:

Code:
int bluepercent[16] =  { 0, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255 };
int whitepercent[16] = { 0,  0,  0,  0,  0,  0,  26,  52,  78, 103, 128, 154, 180, 205, 230, 255 };

  /*||||||||||||||||||||||||||||||||||||||||||||||||||||||  L O O P - F A D E  I N |||||||||||||||||||||||||||||||||||||||||||*/



 if (daybyminute >= (ontime*60))
  {
    if (daybyminute <= ((ontime*60) + (blueramptime/15*14))) //if time is in range start fading in
    {

      PumpOn();
      MoonOff();
      backlighton();




      for (int i = 1; i <= 15; i++) 			// setting i value for 10% increment. Start with 0%
      {
        analogWrite(blue, bluepercent[i]);
        lcd.setCursor(13, 1);
        lcd.print(bluepercent[i]/255*100);		// i want it to display % of light output  rather than ramp step
        if (i < 10) lcd.print(" ");

        analogWrite(white, whitepercent[i]);
        lcd.setCursor(18, 1);
        lcd.print(whitepercent[i]/255*100);		// how shell i round-truncate it down to 2 digits ?
        lcd.setCursor(19, 1);
        if (i < 10) lcd.print(" ");

        int countdown = ((rampup*60)/15); 		// calculates seconds to next step
        while (countdown>0)
          {
          onesecond();
          countdown--;
        }
       } 
      }
     }
 
1. You only need one Arduino.For smaller projects use the Uno or Dueo,but for larger projects use a Mega.
2. No, an LCD isn't needed but helps and comes with kits from ebay.The best way to save pins is to use an I2C LCD controller that only uses 2 pins instead of 6 pins.
3. The Cheapest Kit was this one.

So to recap here are the parts again as follows:

I2C LCD Controller Can be added later on with an LCD when your ready.
DS1307 RTC Clock
Dueo Kit Beginner kit for the dueo comes with everything
Enclosure The case I use for my Dueo and 16x2 LCD
Power Supply I recommend using a 2.1mm 9V power supply with at least 600mA that is from your country.

Hi liquid arts thanks for your suggestion will go for the kit.

regards
 
Hi jag,

Short version:

1. 1 arduino is more than enough.
2. Your choice. LCD is just cool adition.
3. Look on ebay or elsewhere for Duemilanove or similar. I paid $19 including shipping. Very much in budget I thing.

Thanks muda for your suggestion.

regards
 
Back
Top