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

Might be a bit on the RTC, didn't realize it was so small and after my small soldering iron died I attempted it with a more broad tipped one... that is so not happening on the IC, lol! So I have to order a new iron before I can even hope to clean up the solder mess I made of my RTC kit!

Anor: If you look in my code I have already coded the sunrise and sunset as cases as in the original code, they can also be directly called as functions! Look at the main loop. For the customaccent fade the only issue is updating all the other functions to keep count of the light trackers. There is no way for the arduino to know what the light level is without doing that. To get it somewhere you want it to be it has to know where its at. I will work on adding in light tracker updates to the other functions and comment/uncomment the right spots for full manual control so you can see what I mean (Case 33 and 34 are sunrise and sunset if memory serves.) Not sure what to do with the dynamic effects... can't really assign a light level to them so may need to terminate them with a full sunrise or sunset to get to a known light level.

bcarl: I think it would be pretty straight forward to add in random t storms. Just a random number generator that initiates a break from the if-else statements, starts the tstorm function and then returns to previous lighting condition after. The issue I have with doing that is having already observed how bad the flashes freak out my fish! I certainly wouldn't use it for fear of stressing them!
Curt_Planted is offline   Reply With Quote Quick reply to this message
Sponsored Links
Advertisement
 
Old 03-08-2014, 09:13 AM   #437
Curt_Planted
Algae Grower
 
PTrader: (0/0%)
Join Date: Feb 2014
Location: San Diego, CA
Posts: 35
Default

On another note, I am working on a much broader plan to automate my tank with a pair of arduinos with full redundancy. My eventual goal is to have one arduino controlling lighting, dosing, water changes, and co2 as well as acting as a tank/hose leak alert system. The second arduino will act as a fail safe, using pressure sensors, redundant water level sensors and photoresistors to confirm directly conditions are within the primary arduino's parameters and implementing a limp mode to minimize damage/risk to fish. It will also control a redundant solenoid to shut down CO2 if needed, and will control a relay controlling the power supply for the dosing system to shut it down if it fails, and a tertiary sprinkler valve to shut off water for the auto water change system ( there will already be a mechanical valve for fill control and electrical controls in place from the primary arduino). It will also include an ethernet shield to send me text alerts in the event of a failure. I have already set up a web cam and remote control of my pc with my phone so I can check the tank at work to confirm any issues. I just finished an outline plan for different phases of each control aspect and the key coding/technical issues to be solved. See what happens when a rocket scientist falls in love with planted tanks? I want to build it so there is no single point of failure and I will know within minutes if something goes wrong. It all started with me reading about how unreliable CO2 solenoids were. People suggested using 2 series pairs in parallel, and all I could think was: well it's great it will keep working if a valve fails, but what good is that? if you don't know there's a problem to fix, you've lost redundancy and your just delaying a system failure. So I want to solve that issue using sensors, and extend that idea to other damage/fauna critical systems in the controller.
Curt_Planted is offline   Reply With Quote Quick reply to this message
Old 03-08-2014, 07:55 PM   #438
Aquatechtoo
High Tech Redneck
 
Aquatechtoo's Avatar
 
PTrader: (0/0%)
Join Date: Mar 2013
Location: South Central PA
Posts: 48
Default IR Emitter

I used much of this code and equipment from @Indychus, @Dalhammer, et. al. original posts to build a controller that's firing to two Satellite LED+ fixtures. I'm wondering if you guys know why the emitter doesn't fire consistently to both of the Satellite IR receivers. I'm assuming the emitter is the problem because randomly, either one of the fixtures appears not to receive the command from the controller because that fixture will be on one of the previous settings from earlier in the day. Some days, both lights work fine. Other days, either light can be sitting on another light setting, generally from earlier in the day. As a visual, here is how the setup looks.
Attached Images
 
Aquatechtoo is offline   Reply With Quote Quick reply to this message
Old 03-08-2014, 08:37 PM   #439
Curt_Planted
Algae Grower
 
PTrader: (0/0%)
Join Date: Feb 2014
Location: San Diego, CA
Posts: 35
Default

Aquatech2, the emission angle is not that wide. I have my two receivers staggered diagonally so the clear part of them is right next to eachother as seen from the emitter. Even then I still have them about 4 inches from the emitter. HTH
Curt_Planted is offline   Reply With Quote Quick reply to this message
Old 03-08-2014, 08:51 PM   #440
Aquatechtoo
High Tech Redneck
 
Aquatechtoo's Avatar
 
PTrader: (0/0%)
Join Date: Mar 2013
Location: South Central PA
Posts: 48
Default

Thanks, it does, sorta. If I recall correctly when I was building the controller, the emitter only had a range of maybe an inch. Do I need to boost that signal strength by using different hardware?
Aquatechtoo is offline   Reply With Quote Quick reply to this message
Old 03-08-2014, 10:24 PM   #441
Curt_Planted
Algae Grower
 
PTrader: (0/0%)
Join Date: Feb 2014
Location: San Diego, CA
Posts: 35
Default

If your range is that short you may have too high a resistance with the LED. Look at the spec sheet for the ir led and see what the voltage requirement (V_ir) is. Then subtract the voltage requirement from 5 (the output voltage from the arduino I believe). That will give you the voltage left across your resistor. Since you know the current you want through the circuit (just shy of the 20 mA limit for the arduino) then the resistance is just that voltage divided by the current.

In equation form: R=(5-V_ir)/.02

For my IR led: (5-1.35)/.02=182.5 ohms

The IR led I am using needs 1.35 volts (its the forward voltage lower limit on the data sheet), and I rounded the resistance I calculated up to 200 ohms which gives me 18 mA current (slightly below the limit on the arduino). I have about a foot or so range.
Curt_Planted is offline   Reply With Quote Quick reply to this message
Old 03-09-2014, 11:08 PM   #442
Aquatechtoo
High Tech Redneck
 
Aquatechtoo's Avatar
 
PTrader: (0/0%)
Join Date: Mar 2013
Location: South Central PA
Posts: 48
Default

Thanks, Curt_Planted. I'm using the IR led from one of Indychus' first posts. Its a LTE-5208A and according to the spec sheet, the typical V_ir is 1.2 (there's no minimum listed). I am using a 150 ohm resistor. Based on the resistance formula, it is 190. However, I'm not sure what this tells me?
Aquatechtoo is offline   Reply With Quote Quick reply to this message
Old 03-11-2014, 07:20 PM   #443
Curt_Planted
Algae Grower
 
PTrader: (0/0%)
Join Date: Feb 2014
Location: San Diego, CA
Posts: 35
Default

Perhaps the lower resistance is preventing the arduino from maintaining proper voltage accross the led due to overdrawing current. Try 200 ohms (im using 2 100 ohms in series) and see what happens.
Curt_Planted is offline   Reply With Quote Quick reply to this message
Old 03-12-2014, 09:18 AM   #444
kman
Wannabe Guru
 
kman's Avatar
 
PTrader: (0/0%)
Join Date: Dec 2013
Location: Los Angeles
Posts: 1,051
Default

Hi guys! I'm just about ready to jump on the bandwagon. Can someone confirm that the parts I've selected will get the job done before I pull the trigger?

Arduino UNO R3 board with DIP ATmega328P - $28
http://amzn.com/B006H06TVG

SainSmart I2C RTC DS1307 AT24C32 Real Time Clock module+board for AVR ARM PIC - $9.20
http://amzn.com/B006J4FZW4

SainSmart LCD Module For Arduino 20 X 4, PCB Board, White On Blue - $12.29
http://amzn.com/B003B22UR0

Super-bright 5mm IR LED - 940nm - $1.50 (for two... Or I may just buy local)
http://www.adafruit.com/products/387

So just over $50 for the majority of what I need.

Resistors (local purchase, once I confirm what's needed)

I have plenty of USB chargers and cables so I think power is not an issue. I have a couple of different soldering irons/guns (minor wiring, been nearly 30 years since I soldered a circuit board but I doubt much has changed). I think some wire for jumpers and perhaps a small breadbox is all I need to get going?

Does this current software do ramping on/off yet? I have the simple ramp timer but I want to incorporate sunrise and sunset lighting to the schedule, and perhaps moonlight for a couple of hours. It would be nice if I could still have the lights ramp on and off, though. A second lighting period that just brings the sunrise mode on for feeding time before work would be icing on the cake, else I can manually trigger it with the remote as I do now.
__________________
kman is online now   Reply With Quote Quick reply to this message
Old 03-12-2014, 07:35 PM   #445
zodduska
Planted Member
 
zodduska's Avatar
 
PTrader: (4/100%)
Join Date: Aug 2013
Location: Oswego, IL
Posts: 289
Default

Thanks for the new code to play with Curt_Planted, I'm excited to try it out tonight.
__________________
zodduska is offline   Reply With Quote Quick reply to this message
Old 03-12-2014, 09:59 PM   #446
Dragonfish
Planted Tank Obsessed
 
Dragonfish's Avatar
 
PTrader: (5/100%)
Join Date: Apr 2011
Location: Pleasant Prairie, WI
Posts: 308
Default

It does not do ramping as written, it uses alarms to change modes at designated times. In the section below you can specify what mode you want at what time. You are allowed up to 24 alarms as it is set up now (as outlined in the first few posts of this thread) so in theory you could use your custom colors to have a 4 step "ramp" up to your brightest setting. The max number of alarms is 255 (if you modify the library) but each one uses 12 kb memory so if you set up too many of them you will run out of memory. There may be other creative ways to accomplish this but that seems the simplest. You would also put any moonlight settings in here. I just got my kit so I'll put it together in the next couple days and post my settings once I settle on them, as I had similar ideas to you.

void SetAlarms()
{
// Set up your desired alarms here
// The default value of dtNBR_ALARMS is 6 in Alarms.h.
// This code sets 12 alarms by default, so you'll need to change dtNBR_ALARMS to 12 or more
Alarm.alarmRepeat(7,00,0, DawnDusk);
Alarm.alarmRepeat(9,00,0, Cloud2); // (HR,MIN,SEC,FUNCTION)
Alarm.alarmRepeat(11,00,0, FullSpec);
Alarm.alarmRepeat(15,00,0, Cloud2);
Alarm.alarmRepeat(19,00,0, DawnDusk);
Alarm.alarmRepeat(21,00,0, Moon2);

// Comment these out if you don't want the chance of a random storm each day
Alarm.alarmRepeat(12,00,00, ThunderStorm);
ThunderStorm(); // Sets up intial storm so we don't have wait until alarm time
__________________
"Hopefully everything doesn't turn out horribly ironic"
Dragonfish is offline   Reply With Quote Quick reply to this message
Old 03-12-2014, 10:19 PM   #447
Dragonfish
Planted Tank Obsessed
 
Dragonfish's Avatar
 
PTrader: (5/100%)
Join Date: Apr 2011
Location: Pleasant Prairie, WI
Posts: 308
Default

Interesting, in the FAQ for TimeAlarm library they state that each Alarm.alarm uses 12 bytes up to a max of 255, but Alarm.timerOnce is released immediately and there is no reset limit so maybe we can use them to fire WhiteUp or other colors repeatedly until the desired setting is acheived for a ramped effect with no performance hit? Kind of like this:

Alarm.alarmRepeat(7,00,0, DawnDusk);
Alarm.timerOnce(30, WhiteUp); // called once after 30 seconds
Alarm.timerOnce(30, WhiteUp);
Alarm.timerOnce(30, WhiteUp);

This would in effect start at DawnDusk, then press the white up button every 30 seconds until you've hit max (you'd have to figure out how many times that would be). You could of course use the other colors Up functions to finish at a specific color. In the evening you would then simply reverse the order with WhiteDown until you hit your dusk color eventually hitting moonlight. I can see I'm going to have to play with this some more.


Q: How many alarms can be created?
A: Up to six alarms can be scheduled.
The number of alarms can be changed in the TimeAlarms header file (set by the constant dtNBR_ALARMS, note that 12 bytes of RAM are required for each timer)

onceOnly Alarms and Timers are freed when they are triggered so another onceOnly alarm can be set to trigger again.
There is no limit to the number of times a onceOnly alarm can be reset.
Dragonfish is offline   Reply With Quote Quick reply to this message
Old 03-13-2014, 06:51 AM   #448
Curt_Planted
Algae Grower
 
PTrader: (0/0%)
Join Date: Feb 2014
Location: San Diego, CA
Posts: 35
Default

I went straight with loops for the sunrise/sunset. To assure any missed transmissions dont lead to a drift in the actual lights brightness I followed the sunrise with a full spectrum command and the sunset with a call to M4 that I set on the remote to be a zero light setting.

Using if's to activate lighting changes made it pretty straight forward to test counters for each color to adjust lighting to user chosen settings for the custom accent function. I think you should be able to directly grab the sunrise, sunset, and custom accent functions and use them in the original code. You'll just have to bring over the global lighting counter variables and update them after any other lighting changes as well. Or you can just delete them if you don't want the customaccent function. Just give sunrise and sunset the right inputs ( the time delay in ms between adjustments) as described in the notes and I'm sure the IDE will point out anything else you need to do to get it to work!
Curt_Planted is offline   Reply With Quote Quick reply to this message
Old 03-15-2014, 03:31 AM   #449
Curt_Planted
Algae Grower
 
PTrader: (0/0%)
Join Date: Feb 2014
Location: San Diego, CA
Posts: 35
Default

Oh and 42 lighting steps through arduino transmissions, 21 with the remote. They must have included the answer to the universe in our lights I noticed that the dynamic effect transitions were much smoother than the manual adjustments and now we know why. The built in controller in the light uses the 42 steps and the remote sends a double transmission with each adjustment button press.
Curt_Planted is offline   Reply With Quote Quick reply to this message
Old 03-18-2014, 06:59 PM   #450
Mustang5L5
Algae Grower
 
PTrader: (0/0%)
Join Date: Feb 2004
Location: Boston, MA
Posts: 138
Default

Found this thread about 3 weeks ago. Hard to believe I've never heard of an arduino before, but I educated myself in a hurry and have been enjoying them. Went from buying 1, to having 4 at the moment.

Anyway was fun to follow this thread and learn a few things. Currently wrapping up my controller for my 48" Satellite LED+ and want to add a few things and test it before building it into a project box.

Want to add a temperature display, and PH probe as a bit of info, as well as perhaps wire in a red LED as a warning if certain parameters fall outside of a specific range I want. I figure it will allow me to glance at a distance.


I am interested in a ramp sort of lighting schedule though. I'll wait until i get all my sensors and display tested and finalized before working on schedule.

These things are fun. Already have plans for my other 3. Currently planning on an OBD2 display with readouts and GPS for my car.
__________________
-Mike
Mustang5L5 is offline   Reply With Quote Quick reply to this message
Reply

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

Quick Reply
Message:
Options

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:
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.



Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 08:50 AM.


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