Guide: Arduino based LED controller for Current Satellite LED+ - Page 32
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 04-12-2014, 03:08 AM   #466
Curt_Planted
Algae Grower
 
PTrader: (0/0%)
Join Date: Feb 2014
Location: San Diego, CA
Posts: 34
Default

Mike, that's the same one. Your right about the normally opened/closed but the control voltage is inverted for normally closed. High=off, Low=on, and it turns off if the control signal is disconnected or the arduino looses power. Not sure if this has to do with using the jumper across the vcc pins (not using a second power supply and forgoing the opto-isolation).

BTW, the updated code is working great, no issues in 2 days. I'm still lagging on commenting the changes properly so maybe sometime this weekend I will get around to it and upload it. I have also added additional robustness to the code. No more issues no matter if you load it just prior to a lighting change.

There is also a new moonlighting function that comes on at sunset in the evening (the second sunset). The user sets how long it stays on after sunset and can set it to zero if it's not wanted. It uses some tricky math to go from full moon at month start to no moonlight at mid month and then back to full moonlight for the end of the month (16/42 blue, 8/42 red and green). Any higher lighting and I notice my fish don't reduce their activity. I have 2 of these lights (36") above my 36" long/24" high 50g so that may differ based on other peoples lighting.
Curt_Planted is offline   Reply With Quote
Sponsored Links
Advertisement
 
Old 04-14-2014, 04:29 AM   #467
Curt_Planted
Algae Grower
 
PTrader: (0/0%)
Join Date: Feb 2014
Location: San Diego, CA
Posts: 34
Default

Here is the latest code with moonlight and co2 control. Hope someone finds it useful. Had to zip the text doc as the limits on text docs are pretty skimpy on this forum. There is plenty of cleaning up to do in the code to minimize the file size but it's not even using half the memory of my arduino so if it aint broke....
Attached Files
File Type: zip Lighting_w_CO2_RTC_Cust_Accent_V2.zip (5.8 KB, 42 views)
Curt_Planted is offline   Reply With Quote
Old 04-15-2014, 04:04 AM   #468
zodduska
Planted Member
 
zodduska's Avatar
 
PTrader: (4/100%)
Join Date: Aug 2013
Location: Oswego, IL
Posts: 289
Default

IThe full spectrum ended up being too intense for my tank so I reverted to non ramping code for now. Curt, would it be possible for me to change something simple in your code to have it ramp up to say 50% intensity?
__________________
zodduska is offline   Reply With Quote
Old 04-15-2014, 01:23 PM   #469
Curt_Planted
Algae Grower
 
PTrader: (0/0%)
Join Date: Feb 2014
Location: San Diego, CA
Posts: 34
Default

That should be pretty simple. Anywhere you see a sunrise command swap it for a custom accent function with the lighting level you want. FYI I'm down to 9 hours lighting on my tank. These lights are brighter than they appear!
Curt_Planted is offline   Reply With Quote
Old 04-15-2014, 03:46 PM   #470
zodduska
Planted Member
 
zodduska's Avatar
 
PTrader: (4/100%)
Join Date: Aug 2013
Location: Oswego, IL
Posts: 289
Default

like this?

Code:
//these variables below store the number of steps each color is above completely dark for 
//your custom accent color. To get this number, set your tank to the lighting you want 
//then go through each color one by one and reduce the lighting to dark counting the number of 
//times you had to press the down button to do so. There are about 21 steps in brightness for the 
// remote for each color but they can vary with the length of the button press. This code uses the light's max 
// resolution of 42 steps so you will have to multiply the number of button presses by 2 with
// 42 being the max and zero meaning the led color is off. 

int Blue1=0;
int Red1=42;
int Green1=10;
int White1=6;

int Blue2=21;
int Red2=21;
int Green2=21;
int White2=21;
Code:
if ((Tnow > LowSunriseT) && (Tnow < BrightenUpT))
   {
   CustomAccent(Red1,Green1,Blue1,White1,tstep1);
   
   }
   else if ((Tnow > BrightenUpT) && (Tnow < SunsetT))
   {
    CustomAccent(Red2,Green2,Blue2,White2,tstep1);
   }
   else if ((Tnow > SunsetT) && (Tnow < SunriseT))
   {
   Sunset(tstep1);
   }
   else if ((Tnow > SunriseT) && (Tnow < BrightenDownT))
   {
   CustomAccent(Red2,Green2,Blue2,White2,tstep1);
   }
 else if ((Tnow > BrightenDownT) && (Tnow < LowSunsetT))
 {
    CustomAccent(Red1,Green1,Blue1,White1,tstep1);
   }
 else if ((Tnow > LowSunsetT) && (Tnow < LowSunsetT+Evening_Moon*60)){
   MoonPhase(tstep1);
   }
   else if ((Tnow > LowSunsetT+Evening_Moon*60) || (Tnow < LowSunriseT)){
   Sunset(tstep1);
   }
   }
this part too?

Code:
else if ((Tnow >= BrightenUpT) && (Tnow < SunsetT)){
   Serial.print("Tnow ");
   Serial.println(Tnow);
   Serial.print("BrightenUpT ");
   Serial.println(BrightenUpT);
  RedNow=0;
GreenNow=0;
BlueNow=0;
WhiteNow=0;
digitalWrite(CO2RelayPin, LOW);
digitalWrite(CO2RelayLED, HIGH);
   Serial.println("CO2 On");
   CustomAccent(Red2,Green2,Blue2,White2,tstep1);
   }
else if ((Tnow >= SunsetT) && (Tnow < SunriseT)){
Serial.print("Tnow ");
   Serial.println(Tnow);
   Serial.print("SunsetT ");
   Serial.println(SunsetT); 
 digitalWrite(CO2RelayPin, HIGH); 
 digitalWrite(CO2RelayLED, LOW);
   Serial.println("CO2 Off"); 
   
Sunset(initial_tstep);
}
else if ((Tnow >= SunriseT) && (Tnow < BrightenDownT)){
  Serial.print("Tnow ");
   Serial.println(Tnow);
   Serial.print("SunriseT ");
   Serial.println(SunriseT); 
  digitalWrite(CO2RelayPin, LOW);
  digitalWrite(CO2RelayLED, HIGH);
  Serial.println("CO2 On"); 
  RedNow=0;
GreenNow=0;
BlueNow=0;
WhiteNow=0;
   CustomAccent(Red2,Green2,Blue2,White2,tstep1);}
Code:
//initialize color counters to full lighting to assure sunset is completed smoothly
RedNow=21;
GreenNow=21;
BlueNow=21;
WhiteNow=21;
Another quick question, would setting the timers to extend beyond midnight (for the final sunset) screw with the programs time tracking triggers? (ex, 1am is now < than 4pm, rather than 11pm > 4pm)
__________________

Last edited by zodduska; 04-15-2014 at 06:36 PM.. Reason: ..
zodduska is offline   Reply With Quote
Old 04-16-2014, 05:15 AM   #471
Curt_Planted
Algae Grower
 
PTrader: (0/0%)
Join Date: Feb 2014
Location: San Diego, CA
Posts: 34
Default

Looks good. The change to the counter initialization isn't needed, but will speed up any initial sunset (assuming it is never set above 21 lighting level when you start the program). In the interest of robustness at the cost of an extra bit of time to fade down and then fade back up to another color (depending on when you start the code) it may be better to just leave it at 42.
The cross over from one day to another is something I didn't anticipate would be an issue... but if someone works night shift I guess that could come up. Is that a hypothetical question, or a real issue for you? :P

So half lighting is enough? What plant's are you growing?

Edit: Actually since the sunset is followed with a zero light M4 command, the lighting counters don't matter for the initialization... there would at worst case be a sudden jump to darkness if the lighting level was above 21 for any of the colors.

Last edited by Curt_Planted; 04-16-2014 at 05:20 AM.. Reason: Thought of something
Curt_Planted is offline   Reply With Quote
Old 04-16-2014, 02:39 PM   #472
zodduska
Planted Member
 
zodduska's Avatar
 
PTrader: (4/100%)
Join Date: Aug 2013
Location: Oswego, IL
Posts: 289
Default

Quote:
Originally Posted by Curt_Planted View Post
Looks good. The change to the counter initialization isn't needed, but will speed up any initial sunset (assuming it is never set above 21 lighting level when you start the program). In the interest of robustness at the cost of an extra bit of time to fade down and then fade back up to another color (depending on when you start the code) it may be better to just leave it at 42.
The cross over from one day to another is something I didn't anticipate would be an issue... but if someone works night shift I guess that could come up. Is that a hypothetical question, or a real issue for you? :P

So half lighting is enough? What plant's are you growing?

Edit: Actually since the sunset is followed with a zero light M4 command, the lighting counters don't matter for the initialization... there would at worst case be a sudden jump to darkness if the lighting level was above 21 for any of the colors.
Great, thank you I'll give it a go tonight!

The light is suspended about 10-12" over the substrate on a 12 gallon long Mr. Aqua which a couple days ago switched to low-medium light, stopped dosing and turned off co2 for my shrimp's sake. I've got downoi, fissidens, xmas moss, rotala indica, rotala mini butterfly, hydrocotyle tripartita, Alternanthera reineckii, anubias nana petite and dwarf hairgrass. I'm sure some of them won't make the transition. Even with co2 and lots of ferts the Full Spec was too much, so 50% is just a starting point for this. Currently I'm using Cloud4.

Ideally I like the light to be on when I get home from work or shortly after (around 4pm) and sunset at midnight, after that accent light or moonlight until 1 or 2am since I'm usually still awake.

__________________
zodduska is offline   Reply With Quote
Old 04-18-2014, 07:41 PM   #473
Mustang5L5
Algae Grower
 
PTrader: (0/0%)
Join Date: Feb 2004
Location: Boston, MA
Posts: 138
Default

That's a nice tank.

I'm using a 48" fixture over a 24" deep Oscar tank...so my plant growth isn't as good. But unfortunately i'm pretty limited on what I can grown in there anyway that won't become Oscar-fodder.

Still trying to assemble my setup into something a bit visually appealing. Waiting on long 3Meter temp probes

The relay is for Co2 on a friend's planted tank, so I'll need to dig into that at some point. Just pretty much waiting on parts from China right now with a prototype sitting on my work bench waiting for me to make 2 final versions from it.
__________________
-Mike
Mustang5L5 is offline   Reply With Quote
Old 04-19-2014, 06:29 AM   #474
Curt_Planted
Algae Grower
 
PTrader: (0/0%)
Join Date: Feb 2014
Location: San Diego, CA
Posts: 34
Default

Beautiful tank!! Here's mine...
Attached Thumbnails
Click image for larger version

Name:	Phone_Backup_4_18_14 057.jpg
Views:	42
Size:	155.7 KB
ID:	307666  

Curt_Planted is offline   Reply With Quote
Old 04-22-2014, 02:52 PM   #475
zodduska
Planted Member
 
zodduska's Avatar
 
PTrader: (4/100%)
Join Date: Aug 2013
Location: Oswego, IL
Posts: 289
Default

Thanks guys! Curt I really like your tank, very cool fish too!
__________________
zodduska is offline   Reply With Quote
Old 04-24-2014, 01:47 AM   #476
Curt_Planted
Algae Grower
 
PTrader: (0/0%)
Join Date: Feb 2014
Location: San Diego, CA
Posts: 34
Default

Thanks Zodduska! It's definately a different look than yours. Yours is more aquascape art, mine is more just jungle with too many fish! I don't even need to dose KN04. Currently my stock is:

2 Bolvian Rams
2 Denisonii Barbs
1 Pearl Gourami
3 Otos
2 Serpaes
1 Black Phantom
1 Rummy nose tetra
5 harlequins
5 pristellas
2 Saemese Algae eaters
7 Amano shrimp (always hiding on the heater)
4 Nerrite Snails
Some MTS

I still want more! lol, I have such a variety thanks to the loss of previous schools from a callamus worm infection when I first got into fish keeping! Thats a rare and brutal worm that will take out half your tank if your lucky! I've only been at it since last July and jumped from 10 to 29 and now to 50 gallon for the last 5 months or so.

Have you had to fight bba yet? Was still battling it in that pic but it has been staying away nicely now that the co2 is more dialed in and consistent from the relay control. A bit of excel overdosing (cheating... I know, I know) with a flagfish and 2 SAE's cleared it up something fast!
Curt_Planted is offline   Reply With Quote
Old 04-25-2014, 03:44 PM   #477
zodduska
Planted Member
 
zodduska's Avatar
 
PTrader: (4/100%)
Join Date: Aug 2013
Location: Oswego, IL
Posts: 289
Default

Thanks! That 50 looks huge, I love the Denisonii Barbs. BBA is a a real pain, I haven't had to deal with it much in this tank but I have in the past. Usually increasing Co2 stability and amount is the key, it'll actually disappear on its own once its dialed in. The trick is you want enough surface agitation to be able to achieve a high concentration and equilibrium. You don't want it starting low and continually creeping up throughout the photo period. I used a diy Rex Reactor and started my co2 about three to four hours before lights on. Another method if you can't increase co2 for the fish's sake is to reduce light intensity. Once you get those dialed in you won't see much BBA.

Also increased surface agitation allows higher concentration of co2 before fish begin to show signs of stress because there's more oxygen in the water to offset the suffocation effects of co2.

Edit: just noticed you've got a HOB filter so you should be set as far as surface agitation goes, might just need to start the co2 earlier or up the amount a bit.
__________________

Last edited by zodduska; 04-25-2014 at 10:06 PM.. Reason: .
zodduska is offline   Reply With Quote
Old 04-27-2014, 04:43 PM   #478
Curt_Planted
Algae Grower
 
PTrader: (0/0%)
Join Date: Feb 2014
Location: San Diego, CA
Posts: 34
Default

Oh I've got it covered now. The issue was the co2 was driven off of a very cheap mechanical timer and the lights a precision microcontroller. There was alot of timing drift from the timer and turning the co2 on early was always a crap shoot with the 30 minute steps on the mechanical timer. Now that I have the lighting and co2 controlled from the arduino with precise prestart times the tank is the cleanest I've ever seen! Really brings out the bright greens when the leaves are perfectly clear of algae.
Curt_Planted is offline   Reply With Quote
Old 04-30-2014, 05:19 PM   #479
Mustang5L5
Algae Grower
 
PTrader: (0/0%)
Join Date: Feb 2004
Location: Boston, MA
Posts: 138
Default

Biggest holdup for me was how to display the LCD panel. Didn't find much for a 20x4, so ended up making my own. I should have a pic soon.
__________________
-Mike
Mustang5L5 is offline   Reply With Quote
Old 05-04-2014, 06:17 PM   #480
chinton
Newbie
 
PTrader: (0/0%)
Join Date: Apr 2014
Location: United States
Posts: 1
Default

I wanted to say thank you to everyone who contributed to this thread. I had been wanting to get into arduinos for awhile now but hadnt had a use up until now.

I purchased by Satellite+ a month or so ago when it was onsale. I believe this may be the newer model since the IR receiver is different than what I have seen posted here. It is a small LED at the end of the lead. I did not have to modify frequency or IR codes. Below is the information from for my build.

Parts I used:
-Sainsmart Uno R3 (amazon)
-Sainsmart TinyRTC w/ scl/sda passthrough (amazon)
-Sainsmart 20x4 LCD with I2C (amazon)
-bread board (amazon)
-IR Detector/Emitter set (radioshack)
-100 ohm resistor (radioshack)

Code Base: 4.1b
-commented out thermometer code for now but will implement later
-added alarms to poweron/off in the am, afternoon, and after midnight to provide "siesta"
-added alarms to turn on/off lcd backlight when I am away
-modified functions to display current mode on LCD

Troubleshooting:
1. LCD would not display via pass-through on RTC. This may be due to my jumpers. My fix was to wire the lcd in series via the breadboard.
2. Time was displaying 2hrs and some minutes ahead. Had to manually set the time on the RTC.

Future plans:
-implement thermometer reading
-control outlet for heater based on temperature (over temp protection if heater sticks ON)
chinton is offline   Reply With Quote
Reply

Tags
arduino, automation, current led+, diy, light controller

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 10:26 AM.


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