Guide: Arduino based LED controller for Current Satellite LED+ - Page 2
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 07-24-2013, 05:24 PM   #16
O2surplus
Planted Tank Enthusiast
 
O2surplus's Avatar
 
PTrader: (4/100%)
Join Date: Jan 2010
Location: "The Land of Fruits & Nuts"
Posts: 623
Default

Quote:
Originally Posted by Indychus View Post
Yeah, it's certainly possible to do it that way, and that's what I plan to do eventually. Right now, the Arduino is basically just mimicking the remote, so custom functions are not possible. I figured this method would be more appetizing to most people since they wouldn't have to modify their fixture.
I have to admit that I'm not familiar with the remote controls functionality with regards to the Current lighting fixture, but your approach to automating the fixture is novel. Since you've hacked the IR control protocols, it should be relatively easy to program the arduino to act as a "stand in" for the human thumb and perform different commands to the lighting system based on pre programmed code. Since the Micro-Controller controlled IR transmitter and receiver electronics have a much faster reaction time than the human finger, custom lighting effects should be possible.
__________________
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 07-24-2013, 05:29 PM   #17
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 645
Default

Quote:
Originally Posted by O2surplus View Post
I have to admit that I'm not familiar with the remote controls functionality with regards to the Current lighting fixture, but your approach to automating the fixture is novel. Since you've hacked the IR control protocols, it should be relatively easy to program the arduino to act as a "stand in" for the human thumb and perform different commands to the lighting system based on pre programmed code. Since the Micro-Controller controlled IR transmitter and receiver electronics have a much faster reaction time than the human finger, custom lighting effects should be possible.
I hope so... Each color level is individually adjustable... RGB and white... plus you can store 4 custom colors. I intend to use the RGB/White level adjustments to create fades. There are also 3 cloud covers, 3 T-storms, moon lights, dusk/dawn, etc. built in to the current fixture. The effects are decent, but I'll eventually open it up and control the LED drivers directly.

I'm hoping this approach is easy enough for anyone to follow without boring those of you who are familiar with Arduino
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.
Indychus is offline   Reply With Quote
Old 07-24-2013, 05:53 PM   #18
JJBTEXAS
Algae Grower
 
PTrader: (1/100%)
Join Date: Jul 2013
Location: Houston Tx/Auburn Al
Posts: 65
Default

Quote:
Originally Posted by Indychus View Post
With the Current product announcement and their own controllers out now, there isn't much reason to build your own economically speaking (I was a little shocked at how low their MSRP is)
What controllers? I can't find anything about this online.
JJBTEXAS is offline   Reply With Quote
Old 07-24-2013, 07:03 PM   #19
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 645
Default

Quote:
Originally Posted by JJBTEXAS View Post
What controllers? I can't find anything about this online.
They literally just announced it last night at some big expo. They should be on the market soon. MSRP for controlling a single fixture is supposed to be $39... dual is more. This Arduino setup can control an infinite number of fixtures though, provided their IR sensors are within range of the emitter on the Arduino.
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.
Indychus is offline   Reply With Quote
Old 07-24-2013, 07:15 PM   #20
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 645
Default

Software

Ok, so now that you have the basic device built, it's time to make it do something. Again, I'm writing this in case anyone completely new to Arduino wants to follow along. If you're familiar with this stuff, feel free to skip ahead.

Here's the basic premise of the device:
  • Decode IR signal from remote
  • Store IR signal in an Arduino sketch
  • Keep time (now software based, adding an RTC soon)
  • Recall IR signal at set times to activate functions on the fixture

It's really that simple. The Arduino is basically doing the same thing you would do with the remote, but doing it automatically at set times. No modification to the remote or fixture is necessary.

Note that this procedure can be used to control any IR device that operates at 38 khz. That's pretty much everything... your TV, BluRay player, audio equipment, etc. And with a little tweaking and an appropriate receiver, it can work on devices which are not at a frequency of 38 kHz as well. In short, you can automate anything with an IR receiver on it.
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.
Indychus is offline   Reply With Quote
Old 07-24-2013, 07:26 PM   #21
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 645
Default

So first off, go to the Arduino start up page to download the appropriate software and load a blink sketch to test your board. It can be found here:

http://arduino.cc/en/Guide/HomePage

Once that's done, you'll need to download and install a few libraries for this to work. You just download the .zip file, unzip into a folder on your desktop, then move the folder to the libraries folder inside the Arduino folder. Be sure to maintain any folder/subfolder structure in the libraries.

For this to work, you'll need these libraries:
  • Time
  • TimeAlarms
  • DateTime
  • DateTimeStrings

These can be found here (Time) and here (TimeAlarms). I'm pretty sure the other two are included in one of those libraries. If not, they can be found on Arduino Playground or via a quick google search.

As this project progresses, other libraries may be needed. If I write them, I will provide them, but most likely they'll be by someone else and I'll point you to a link to download them.

A lot of errors during compiling are due to libraries being in the wrong spot. Don't get frustrated if you get errors, they are usually easily resolved.
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.
Indychus is offline   Reply With Quote
Old 07-24-2013, 07:30 PM   #22
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 645
Default

Once that's done, you'll need a sketch for decoding the IR signals from your remote. I've already done quite a few of them, but you can use this to operate any IR device, so it's a handy bit of code to know. I can't take credit for this code, as I got it from adafruit.com. That's the beauty of Arduino, for nearly every project you can find something someone else has done and tweak it to suit your needs.

Here's the sketch. Just copy it and paste it into a new sketch in the Arduino software. Save as IR Decoder or something similar. Once saved, change the value "#define IRpin x" to match the channel that your receiver is plugged in to. If you're following step by step, it's already ready to go. Upload to the Arduino, open the Serial Monitor (top right corner), wait for the prompt (Ready to decode IR), then point your remote at your receiver (1-2 inches away) and press a button.

Code:
/* Raw IR decoder sketch!
This sketch/program uses the Arduno and a PNA4602 to
decode IR received. This can be used to make a IR receiver
(by looking for a particular code)
or transmitter (by pulsing an IR LED at ~38KHz for the
durations detected
Code is public domain, check out www.ladyada.net and adafruit.com
for more tutorials!
*/
 
// We need to use the 'raw' pin reading methods
// because timing is very important here and the digitalRead()
// procedure is slower!
//uint8_t IRpin = 2;
// Digital pin #2 is the same as Pin D2 see
// http://arduino.cc/en/Hacking/PinMapping168 for the 'raw' pin mapping
#define IRpin_PIN PIND
#define IRpin 2
// for MEGA use these!
//#define IRpin_PIN PINE
//#define IRpin 4
 
// the maximum pulse we'll listen for - 65 milliseconds is a long time
#define MAXPULSE 65000
 
// what our timing resolution should be, larger is better
// as its more 'precise' - but too large and you wont get
// accurate timing
#define RESOLUTION 20
 
// we will store up to 100 pulse pairs (this is -a lot-)
uint16_t pulses[100][2]; // pair is high and low pulse
uint8_t currentpulse = 0; // index for pulses we're storing
 
void setup(void) {
  Serial.begin(9600);
  Serial.println("Ready to decode IR!");
}
 
void loop(void) {
  uint16_t highpulse, lowpulse; // temporary storage timing
  highpulse = lowpulse = 0; // start out with no pulse length
  
  
// while (digitalRead(IRpin)) { // this is too slow!
    while (IRpin_PIN & (1 << IRpin)) {
     // pin is still HIGH
 
     // count off another few microseconds
     highpulse++;
     delayMicroseconds(RESOLUTION);
 
     // If the pulse is too long, we 'timed out' - either nothing
     // was received or the code is finished, so print what
     // we've grabbed so far, and then reset
     if ((highpulse >= MAXPULSE) && (currentpulse != 0)) {
       printpulses();
       currentpulse=0;
       return;
     }
  }
  // we didn't time out so lets stash the reading
  pulses[currentpulse][0] = highpulse;
  
  // same as above
  while (! (IRpin_PIN & _BV(IRpin))) {
     // pin is still LOW
     lowpulse++;
     delayMicroseconds(RESOLUTION);
     if ((lowpulse >= MAXPULSE) && (currentpulse != 0)) {
       printpulses();
       currentpulse=0;
       return;
     }
  }
  pulses[currentpulse][1] = lowpulse;
 
  // we read one high-low pulse successfully, continue!
  currentpulse++;
}
 
void printpulses(void) {
  Serial.println("\n\r\n\rReceived: \n\rOFF \tON");
  for (uint8_t i = 0; i < currentpulse; i++) {
    Serial.print(pulses[i][0] * RESOLUTION, DEC);
    Serial.print(" usec, ");
    Serial.print(pulses[i][1] * RESOLUTION, DEC);
    Serial.println(" usec");
  }
  
  // print it in a 'array' format
  Serial.println("int IRsignal[] = {");
  Serial.println("// ON, OFF (in 10's of microseconds)");
  for (uint8_t i = 0; i < currentpulse-1; i++) {
    Serial.print("\t"); // tab
    Serial.print(pulses[i][1] * RESOLUTION / 10, DEC);
    Serial.print(", ");
    Serial.print(pulses[i+1][0] * RESOLUTION / 10, DEC);
    Serial.println(",");
  }
  Serial.print("\t"); // tab
  Serial.print(pulses[currentpulse-1][1] * RESOLUTION / 10, DEC);
  Serial.print(", 0};");
}
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.

Last edited by Indychus; 08-12-2013 at 03:41 PM.. Reason: edit
Indychus is offline   Reply With Quote
Old 07-24-2013, 07:48 PM   #23
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 645
Default

Once that's done, you'll get an output that looks like this in your Serial Monitor window:



These numbers are delays, in microseconds, for each flash of the IR emitter in a signal data transfer. I won't get into IR theory (it isn't that complicated and you should definitely check it out) but these are the codes we need to get things going. The first group is raw data, and the second group is the same data, in an easier to look at format. The very first value can be ignored, as it's the delay between starting the sketch and pressing the button.

I suggest creating a spreadsheet to keep the data organized, like the one I am working on here:



I will post the entire spreadsheet once I finish decoding and testing all of the functions. Here, you can see that each transfer is composed of a header, which is a device ID, the actual code, then a footer, which just tells the fixture that the transfer is done and to be ready to potentially expect another packet.

You device ID may be different than mine, though I doubt it. If it is, you just change the values in the control sketch (which I am about to post) to reflect your ID. Since the device ID and footer are identical on every transmission, you can just copy and paste the data and change appropriate values.
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.
Indychus is offline   Reply With Quote
Old 07-24-2013, 08:11 PM   #24
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 645
Default

At this point, more advanced users may be asking where the hex codes are. Well, here you go.

If you're new, you can ignore this post.

Looking at the remote, these are ordered left to right, top to bottom. In every case, the footer is FFFFFFFF. The device ID (20DF) may or may not be the same on all Current products.

Orange 20DF3AC5
Blue 20DFBA45
Rose Pink 20DF827D
Power On/Off 20DF02FD
White 20DF1AE5
Full Spectrum 20DF9A65
Purple 20DFA25D
Play/Pause 20DF22DD
Red Up 20DF2AD5
Green Up 20DFAA55
Blue Up 20DF926D
White Up 20DF12ED
Red Down 20DF0AF5
Green Down 20DF8A75
Blue Down 20DFB24D
White Down 20DF32CD
M1 20DF38C7
M2 20DFB847
M3 20DF7887
M4 20DFF807
Moon 1 20DF18E7
Moon 2 20DF9867
Moon 3 20DF58A7
Dawn/Dusk 20DFD827
Cloud 1 20DF28D7
Cloud 2 20DFA857
Cloud 3 20DF6897
Fading Sun 20DFE817
T-Storm 1 20DF08F7
T-Storm 2 20DF8877
T-Storm 3 20DF48B7
Fade All 20DFC837
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.
Indychus is offline   Reply With Quote
Old 07-24-2013, 08:27 PM   #25
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 645
Default

Now we're ready to automate a light!

Here's my code for the Current fixture. I will update it frequently as the device matures and more features are added. For right now, this is a good place to test your system. Run this code for a few days and make sure everything is working fine. I have had this code running for around 2 weeks now without issue.

How to adapt this code to your system:

There are several things you need to do to ensure this works for you. First, you'll see a value for "int IRLedPin" that's currently set to 13. Change this to whatever channel your emitter is connected to. Next, change the 9600 in "Serial.begin(9600)" to the baud rate you are using to communicate with your Arduino. If you don't know this, you can probably leave it alone and have no issues. Next, change the values in setTime(HR,MIN,SEC,MO,DAY,YR) to match the time right before you upload the sketch. This sets the Arduino's time. If power is lost or you edit the sketch, you will need to update the time again. This will be fixed soon when we add an RTC to the device. Finally, check the IR commands at the end of the code. Make sure the device ID (first 17 number pairs) is the same as the values you got from your remote and change them if necessary. It's ok if they're off by as much as 100. You're looking for values that are off by 500 or more.

In addition to those tweaks to the code, you'll also need to edit the header file for the TimeAlarm library. This is because the header that comes in the library sets the maximum number of alarms to 6. If you try to add more, they won't work. To fix this, open the file TimeAlarms.h in the Arduino > Libraries > TimeAlarms directory with a text editor (NotePad works fine). It will look like this:



In the highlighted area, you'll see mine says 24 and yours should say 6. Change the value to 24 and save the document. This allows you to have 24 alarm triggers. In the future, you can add more, but it's wise to not overdo it as each alarm reserves space in the Arduino's memory.

How it works:
Basically, this is a fancy alarm clock right now. The values under "ALARM FUNCTIONS" are triggers. Each trigger has parameters (HR,MIN,SEC,FUNCTION). The FUNCTION refers to the IR codes at the bottom of my sketch. Whenever the time here is reached, that function is fired. It fires the emitter once, then repeats it 1 second later to be sure the command was received. Change the time to whatever values you desire, using the same syntax as I have used. Note that the clock is 24hr format. The FUNCTION names to use are labeled in the "void XXXXXXX()" lines of the code under "FIXTURE FUNCTIONS."

Right now, these functions are available:
  • PowerButton - toggles power on/off
  • DawnDusk - puts fixture into dawn and dusk mode
  • Cloud2 - heavy cloud cover with full spectrum cycle
  • FullSpec - solid full spectrum light, all-on.
  • Night2 - soft, fading moonlight.



Code:
///////////////////////////////////////////////////////////////////
// Current Satellite LED+ Controller                             //
//   Ken Bunton (Indychus)                                       //
//   This code is public domain.  Pass it on.                    //
//   Confirmed on Arduino UNO 1.0.5                              //
//   Req. Time, TimeAlarms, DateTime, DateTimeStrings libraries  //
///////////////////////////////////////////////////////////////////

////////////SETUP//////////////////////////////////////////////////
#include <Time.h>
#include <TimeAlarms.h>
#include <DateTime.h>
#include <DateTimeStrings.h>

int IRledPin =  13;                  // Pin location for IR output

void setup()               
{ pinMode(IRledPin, OUTPUT);         // Designate IRledPin as Output
  Serial.begin(9600);                // Connect @ (Baud)
  setTime(13,04,00,7,23,13);          // set time (HR,MIN,SEC,MO,DAY,YR)
  
  
////////////ALARM FUNCTIONS/////////////////////////////////////////
  Alarm.alarmRepeat(7,00,0, DawnDusk);
  Alarm.alarmRepeat(7,00,1, DawnDusk);
  Alarm.alarmRepeat(9,00,0, Cloud2);     // (HR,MIN,SEC,FUNCTION)
  Alarm.alarmRepeat(9,00,1, Cloud2);
  Alarm.alarmRepeat(13,00,0, FullSpec);
  Alarm.alarmRepeat(13,00,1, FullSpec);
  Alarm.alarmRepeat(15,00,0, Cloud2);
  Alarm.alarmRepeat(15,00,1, Cloud2);
  Alarm.alarmRepeat(19,00,0, DawnDusk);
  Alarm.alarmRepeat(19,00,1, DawnDusk);
  Alarm.alarmRepeat(21,00,0, Night2);
  Alarm.alarmRepeat(21,00,1, Night2);    }


////////////CLOCK///////////////////////////////////////////////////
void  loop(){                       
  digitalClockDisplay();
  Alarm.delay(1000); }              // Clock display update frequency (msec)

void digitalClockDisplay()          // Digital clock
{ Serial.print(hour());
  printDigits(minute());
  printDigits(second());
  Serial.println(); }

void printDigits(int digits)        // Add :
{Serial.print(":");
  if(digits < 10)
    Serial.print('0');
  Serial.print(digits);}

  
////////////SIGNAL///////////////////////////////////////////////////
// Create Frequency (38khz/26msec)
void pulseIR(long microsecs) 
{  cli();                           // kill interupts
  while (microsecs > 0)
{  digitalWrite(IRledPin, HIGH);    // ~3 msec
   delayMicroseconds(7);            // ~delay
   digitalWrite(IRledPin, LOW);     // ~3 msec
   delayMicroseconds(7);            // ~delay
    microsecs -= 26;  }
sei();  }                           // zombie interupts


////////////FIXTURE FUNCTIONS////////////////////////////////////////
void PowerButton()                             //Fixture power on/off toggle

{ Serial.println("Power Toggle");
     pulseIR(8840);
  delayMicroseconds(4320);
     pulseIR(620);
  delayMicroseconds(480);
    pulseIR(600);
  delayMicroseconds(500);
    pulseIR(540);
  delayMicroseconds(1660);
    pulseIR(580);
  delayMicroseconds(520);
    pulseIR(520);
  delayMicroseconds(560);
    pulseIR(600);
  delayMicroseconds(480);
    pulseIR(620);
  delayMicroseconds(480);
    pulseIR(540);
  delayMicroseconds(540);
    pulseIR(620);
  delayMicroseconds(1600);
    pulseIR(520);
  delayMicroseconds(1660);
    pulseIR(580);
  delayMicroseconds(520);
    pulseIR(520);
  delayMicroseconds(1660);
    pulseIR(600);
  delayMicroseconds(1580);
    pulseIR(620);
  delayMicroseconds(1580);
    pulseIR(540);
  delayMicroseconds(1660);
    pulseIR(600);
  delayMicroseconds(1580);
    pulseIR(600);
  delayMicroseconds(500);
    pulseIR(600);
  delayMicroseconds(500);
    pulseIR(520);
  delayMicroseconds(560);
    pulseIR(600);
  delayMicroseconds(500);
    pulseIR(600);
  delayMicroseconds(500);
    pulseIR(520);
  delayMicroseconds(560);
    pulseIR(580);
  delayMicroseconds(1620);
    pulseIR(540);
  delayMicroseconds(540);
    pulseIR(600);
  delayMicroseconds(1600);
    pulseIR(520);
  delayMicroseconds(1660);
    pulseIR(580);
  delayMicroseconds(1620);
    pulseIR(580);
  delayMicroseconds(1620);
    pulseIR(520);
  delayMicroseconds(1660);
    pulseIR(580);
  delayMicroseconds(1600);
    pulseIR(580);
  delayMicroseconds(520);
    pulseIR(580);
  delayMicroseconds(1620);
    pulseIR(540);
  delayMicroseconds(38980);
    pulseIR(8860);
  delayMicroseconds(2120);
    pulseIR(620);  }

 
void Night2()                                   //Fixture Initialize Night2 Mode
 { Serial.println("Night 2 Mode Initialized");
    pulseIR(8840);
  delayMicroseconds(4320);
    pulseIR(620);
  delayMicroseconds(480);
    pulseIR(600);
  delayMicroseconds(500);
    pulseIR(540);
  delayMicroseconds(1660);
    pulseIR(580);
  delayMicroseconds(520);
    pulseIR(520);
  delayMicroseconds(560);
    pulseIR(600);
  delayMicroseconds(480);
    pulseIR(620);
  delayMicroseconds(480);
    pulseIR(540);
  delayMicroseconds(540);
    pulseIR(620);
  delayMicroseconds(1600);
    pulseIR(520);
  delayMicroseconds(1660);
    pulseIR(580);
  delayMicroseconds(520);
    pulseIR(520);
  delayMicroseconds(1660);
    pulseIR(600);
  delayMicroseconds(1580);
    pulseIR(620);
  delayMicroseconds(1580);
    pulseIR(540);
  delayMicroseconds(1660);
    pulseIR(600);
  delayMicroseconds(1580);
    pulseIR(600);
  delayMicroseconds(1640);
    pulseIR(600);
  delayMicroseconds(500);
    pulseIR(520);
  delayMicroseconds(560);
    pulseIR(600);
  delayMicroseconds(1620);
    pulseIR(600);
  delayMicroseconds(1640);
    pulseIR(520);
  delayMicroseconds(560);
    pulseIR(580);
  delayMicroseconds(540);
    pulseIR(540);
  delayMicroseconds(540);
    pulseIR(600);
  delayMicroseconds(480);
    pulseIR(520);
  delayMicroseconds(1660);
    pulseIR(580);
  delayMicroseconds(1620);
    pulseIR(580);
  delayMicroseconds(500);
    pulseIR(520);
  delayMicroseconds(500);
    pulseIR(580);
  delayMicroseconds(1600);
    pulseIR(580);
  delayMicroseconds(1560);
    pulseIR(580);
  delayMicroseconds(1620);
    pulseIR(540);
  delayMicroseconds(38980);
    pulseIR(8860);
  delayMicroseconds(2120);
    pulseIR(620);  }
  
    
  void Cloud2()                                         //Fixture Initialize Cloud2 Mode
 { Serial.println("Cloud Cover 2 Mode Initialized");
    pulseIR(8840);
  delayMicroseconds(4320);
    pulseIR(620);
  delayMicroseconds(480);
    pulseIR(600);
  delayMicroseconds(500);
    pulseIR(540);
  delayMicroseconds(1660);
    pulseIR(580);
  delayMicroseconds(520);
    pulseIR(520);
  delayMicroseconds(560);
    pulseIR(600);
  delayMicroseconds(480);
    pulseIR(620);
  delayMicroseconds(480);
    pulseIR(540);
  delayMicroseconds(540);
    pulseIR(620);
  delayMicroseconds(1600);
    pulseIR(520);
  delayMicroseconds(1660);
    pulseIR(580);
  delayMicroseconds(520);
    pulseIR(520);
  delayMicroseconds(1660);
    pulseIR(600);
  delayMicroseconds(1580);
    pulseIR(620);
  delayMicroseconds(1580);
    pulseIR(540);
  delayMicroseconds(1660);
    pulseIR(600);
  delayMicroseconds(1580);
    pulseIR(600);
  delayMicroseconds(1580);
    pulseIR(600);
  delayMicroseconds(500);
    pulseIR(520);
  delayMicroseconds(1620);
    pulseIR(600);
  delayMicroseconds(500);
    pulseIR(600);
  delayMicroseconds(1600);
    pulseIR(520);
  delayMicroseconds(560);
    pulseIR(580);
  delayMicroseconds(480);
    pulseIR(540);
  delayMicroseconds(540);
    pulseIR(600);
  delayMicroseconds(560);
    pulseIR(520);
  delayMicroseconds(1660);
    pulseIR(580);
  delayMicroseconds(560);
    pulseIR(580);
  delayMicroseconds(1620);
    pulseIR(520);
  delayMicroseconds(560);
    pulseIR(580);
  delayMicroseconds(1600);
    pulseIR(580);
  delayMicroseconds(1640);
    pulseIR(580);
  delayMicroseconds(1620);
    pulseIR(540);
  delayMicroseconds(38980);
    pulseIR(8860);
  delayMicroseconds(2120);
    pulseIR(620);  }
  
  
    void FullSpec()                                  //Fixture Initialize Full Spectrum Mode
{ Serial.println("Full Spectrum Mode Initialized");
    pulseIR(8840);
  delayMicroseconds(4320);
    pulseIR(620);
  delayMicroseconds(480);
    pulseIR(600);
  delayMicroseconds(500);
    pulseIR(540);
  delayMicroseconds(1660);
    pulseIR(580);
  delayMicroseconds(520);
    pulseIR(520);
  delayMicroseconds(560);
    pulseIR(600);
  delayMicroseconds(480);
    pulseIR(620);
  delayMicroseconds(480);
    pulseIR(540);
  delayMicroseconds(540);
    pulseIR(620);
  delayMicroseconds(1600);
    pulseIR(520);
  delayMicroseconds(1660);
    pulseIR(580);
  delayMicroseconds(520);
    pulseIR(520);
  delayMicroseconds(1660);
    pulseIR(600);
  delayMicroseconds(1580);
    pulseIR(620);
  delayMicroseconds(1580);
    pulseIR(540);
  delayMicroseconds(1660);
    pulseIR(600);
  delayMicroseconds(1580);
    pulseIR(600);
  delayMicroseconds(1580);
    pulseIR(600);
  delayMicroseconds(500);
    pulseIR(520);
  delayMicroseconds(480);
    pulseIR(600);
  delayMicroseconds(1580);
    pulseIR(600);
  delayMicroseconds(1600);
    pulseIR(520);
  delayMicroseconds(560);
    pulseIR(580);
  delayMicroseconds(1600);
    pulseIR(540);
  delayMicroseconds(540);
    pulseIR(600);
  delayMicroseconds(560);
    pulseIR(520);
  delayMicroseconds(1660);
    pulseIR(580);
  delayMicroseconds(1580);
    pulseIR(580);
  delayMicroseconds(540);
    pulseIR(520);
  delayMicroseconds(560);
    pulseIR(580);
  delayMicroseconds(1600);
    pulseIR(580);
  delayMicroseconds(480);
    pulseIR(580);
  delayMicroseconds(1620);
    pulseIR(540);
  delayMicroseconds(38980);
    pulseIR(8860);
  delayMicroseconds(2120);
    pulseIR(620);  }
    
    
    
    
        void DawnDusk()                         //F ixture Initialize Dawn/Dusk Mode
{ Serial.println("Dawn/Dusk Mode Initialized");
    pulseIR(8840);
  delayMicroseconds(4320);
    pulseIR(620);
  delayMicroseconds(480);
    pulseIR(600);
  delayMicroseconds(500);
    pulseIR(540);
  delayMicroseconds(1660);
    pulseIR(580);
  delayMicroseconds(520);
    pulseIR(520);
  delayMicroseconds(560);
    pulseIR(600);
  delayMicroseconds(480);
    pulseIR(620);
  delayMicroseconds(480);
    pulseIR(540);
  delayMicroseconds(540);
    pulseIR(620);
  delayMicroseconds(1600);
    pulseIR(520);
  delayMicroseconds(1660);
    pulseIR(580);
  delayMicroseconds(520);
    pulseIR(520);
  delayMicroseconds(1660);
    pulseIR(600);
  delayMicroseconds(1580);
    pulseIR(620);
  delayMicroseconds(1580);
    pulseIR(540);
  delayMicroseconds(1660);
    pulseIR(600);
  delayMicroseconds(1580);
    pulseIR(600);
  delayMicroseconds(1660);
    pulseIR(600);
  delayMicroseconds(1560);
    pulseIR(520);
  delayMicroseconds(480);
    pulseIR(600);
  delayMicroseconds(1580);
    pulseIR(600);
  delayMicroseconds(1600);
    pulseIR(520);
  delayMicroseconds(560);
    pulseIR(580);
  delayMicroseconds(500);
    pulseIR(540);
  delayMicroseconds(540);
    pulseIR(600);
  delayMicroseconds(560);
    pulseIR(520);
  delayMicroseconds(500);
    pulseIR(580);
  delayMicroseconds(1580);
    pulseIR(580);
  delayMicroseconds(540);
    pulseIR(520);
  delayMicroseconds(560);
    pulseIR(580);
  delayMicroseconds(1660);
    pulseIR(580);
  delayMicroseconds(1580);
    pulseIR(580);
  delayMicroseconds(1620);
    pulseIR(540);
  delayMicroseconds(38980);
    pulseIR(8860);
  delayMicroseconds(2120);
    pulseIR(620);  }

Last edited by Indychus; 07-24-2013 at 08:54 PM.. Reason: Edit
Indychus is offline   Reply With Quote
Old 07-24-2013, 08:38 PM   #26
Michael M
Planted Member
 
PTrader: (0/0%)
Join Date: Sep 2012
Location: Charleston, IL
Posts: 154
Default

Quote:
Originally Posted by crazymittens View Post
Someone in the lighting sub-forum was asking about this...I'm curious if there are any biological benefits to this. Is this cool (it is), or functionally cool?
I can tell you straight up that my african clawed frogs are not fans of the dynamic 'thunderstorm' mode. In fact it scares the crap out of them and sends them swimming around frantically.. they are really skittish animals so maybe fish will not mind as much.

I think the dynamic weather is mostly for the cool factor though.
Michael M is offline   Reply With Quote
Old 07-24-2013, 08:44 PM   #27
O2surplus
Planted Tank Enthusiast
 
O2surplus's Avatar
 
PTrader: (4/100%)
Join Date: Jan 2010
Location: "The Land of Fruits & Nuts"
Posts: 623
Default

Quote:
Originally Posted by Indychus View Post
Now we're ready to automate a light!

Still editing, instructions incoming!
Is the code you posted intended to be a library file?
__________________
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 07-24-2013, 08:56 PM   #28
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 645
Default

Quote:
Originally Posted by O2surplus View Post
Is the code you posted intended to be a library file?
No, but I guess I can package it all together into one. Would probably make it easier to have everything together. I've never had a need to compile a library before, but I'll give it a shot.
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.

Last edited by Indychus; 07-24-2013 at 09:40 PM.. Reason: Edit
Indychus is offline   Reply With Quote
Old 07-24-2013, 10:42 PM   #29
O2surplus
Planted Tank Enthusiast
 
O2surplus's Avatar
 
PTrader: (4/100%)
Join Date: Jan 2010
Location: "The Land of Fruits & Nuts"
Posts: 623
Default

Quote:
Originally Posted by Indychus View Post
No, but I guess I can package it all together into one. Would probably make it easier to have everything together. I've never had a need to compile a library before, but I'll give it a shot.

I was just thinking out loud when I posted, but the thought had occurred to me that all the IR command coding could be placed into a custom library. Since all the "heavy lifting" is done inside the various libraries used in particular sketch, the remaining main sketch could be simplified greatly, and therefore much more user friendly for the end user. Just my thoughts LOL.
__________________
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 07-24-2013, 10:52 PM   #30
Indychus
Planted Tank Enthusiast
 
Indychus's Avatar
 
PTrader: (8/100%)
Join Date: Feb 2013
Location: Irmo, SC
Posts: 645
Default

Quote:
Originally Posted by O2surplus View Post
I was just thinking out loud when I posted, but the thought had occurred to me that all the IR command coding could be placed into a custom library. Since all the "heavy lifting" is done inside the various libraries used in particular sketch, the remaining main sketch could be simplified greatly, and therefore much more user friendly for the end user. Just my thoughts LOL.
I agree, my coding is very clunky and could be greatly simplified. I'll play around with making a library tonight.
__________________
The Fraternity of Dirt
Check out my open-source Arduino-Powered Light Controller Guide for Current LED+ and other IR switchable lights.
Indychus 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 11:42 AM.


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