The Planted Tank Forum - Reply to Topic
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 > Guide: Arduino based LED controller for Current Satellite LED+

Thread: Guide: Arduino based LED controller for Current Satellite LED+ Reply to Thread
Title:
  
Message:
Post Icons
You may choose an icon for your message from the following list:
 

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.



Additional Options
Miscellaneous Options

Topic Review (Newest First)
Yesterday 01:47 AM
Curt_Planted 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!
04-22-2014 02:52 PM
zodduska Thanks guys! Curt I really like your tank, very cool fish too!
04-19-2014 06:29 AM
Curt_Planted Beautiful tank!! Here's mine...
04-18-2014 07:41 PM
Mustang5L5 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.
04-16-2014 02:39 PM
zodduska
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.

04-16-2014 05:15 AM
Curt_Planted 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.
04-15-2014 03:46 PM
zodduska 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)
04-15-2014 01:23 PM
Curt_Planted 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!
04-15-2014 04:04 AM
zodduska 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?
04-14-2014 04:29 AM
Curt_Planted 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....
04-12-2014 03:08 AM
Curt_Planted 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.
04-11-2014 02:05 PM
Mustang5L5
Quote:
Originally Posted by Curt_Planted View Post
I know what you mean about adding stuff! I'm about to add a darn touch screen! Lol
I'm making one for myself and a friend....and he just requested a PH probe in addition to CO2 relay...


So looks like I'm going to wait for my 128x64 display to show up, and figure out how to modify the code to display on that and then add CO2 and PH to the Temp
04-11-2014 01:38 PM
Mustang5L5
Quote:
Originally Posted by Curt_Planted View Post
Just finished up the relay... was a bit perplexed by this! I wanted it to keep the power off when the arduino is reset or the control pin is not configured (or comes unplugged) so the relay doesn't keep the co2 on 24-7 in event of a connection issue. One would assume that the relay would then of course be operating in normally off mode. Umm... not so much. In order to do that I had to set the relay up to turn on when the pin is low and turn off when high otherwise if the control line is unplugged or arduino is powered off the relay turns on... makes no sense! but I have it working! lol, I tried it wired up to the opposite way as well and it is off when voltage is low, on when high, but when the pin is disconnected it turns on... . I gotta be missing something! For a mechanical relay does it matter if I connect the power wires to the same terminals but switch them around? Maybe because this relay uses an second 5v source to reduce the control current, the control voltage disconnects that second 5v source that actually powers the relay coil? then the high off low on would still be normally off...
I assume this is the relay you are using?



I just got one myself yesterday. I haven't wired it up, or played with code, but looking at the 4 relays, it looks like there is a normally open, and normally closed position.

Looks like if you use the two left pots, it's normally closed, and using the two right, it's normally open?

Again, have yet to put power to it, but that's how I took it. I was going to put the line in the center and have the relay ON when powered so it fails normally open if the power goes out.

Could be wrong though
04-10-2014 06:56 AM
Curt_Planted Just finished up the relay... was a bit perplexed by this! I wanted it to keep the power off when the arduino is reset or the control pin is not configured (or comes unplugged) so the relay doesn't keep the co2 on 24-7 in event of a connection issue. One would assume that the relay would then of course be operating in normally off mode. Umm... not so much. In order to do that I had to set the relay up to turn on when the pin is low and turn off when high otherwise if the control line is unplugged or arduino is powered off the relay turns on... makes no sense! but I have it working! lol, I tried it wired up to the opposite way as well and it is off when voltage is low, on when high, but when the pin is disconnected it turns on... . I gotta be missing something! For a mechanical relay does it matter if I connect the power wires to the same terminals but switch them around? Maybe because this relay uses an second 5v source to reduce the control current, the control voltage disconnects that second 5v source that actually powers the relay coil? then the high off low on would still be normally off...

I also configured a second pin to act as a second output that outputs high when co2 is on to light an led to act as an indicator. That may also work well for anyone with a more logically operating relay than my Sainsmart!

My plan is to keep this relay (a sainsmart 4 channel mechanical relay $7.99) and all the higher voltage stuff in the nice little $8 project box I got from radioshack and just velcro a proper case for the arduino on top. I was surprised how well the outlet plug-in seated in the side wall! I grabbed the output plug from the $4 walmart analog timer and wired the hot black line straight to the relay and then bypassed earth ground and ground straight into the power input wires.

The code has a user set co2 prestart (before lighting turns on) and prestop (before lighting turns off). For my setup the inline reactor takes a while to dissolve the CO2 in it, so I notice my fish gasping if I wait til the lights turn off to shut off CO2. I'll post pics and code tomorrow. Hopefully I will wake up to that indicator led lit and the co2 on with the lights.
04-08-2014 11:19 PM
Curt_Planted I know what you mean about adding stuff! I'm about to add a darn touch screen! Lol
This thread has more than 15 replies. Click here to review the whole thread.

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


All times are GMT. The time now is 04:27 AM.


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