The Planted Tank Forum banner

Calling all DIY LED "Junkies" - Your opinions wanted!

41K views 155 replies 22 participants last post by  O2surplus 
#1 ·
I was bored to death at work today, so I designed this just to keep my brain busy and pass the time. It's a 4 channel LED driver- that's very similar to ones that I built in the past, but with a new twist. I integrated a micro-controller/ real time clock into the design that will allow full programmable control of each channel. The controller features an I2C connection that will enable multiple driver boards to be connected together to communicate with, and act as slaves to a "master controller," or simply wired up to leds and left to run a user defined LED dimming "sketch". The controller is programmed using the standard ARDUINO IDE. I see this design being a really great way to have high resolution control over large groups of leds, or as a "stand alone" driver contoller for Nano Tank led builds. I personally have 90 leds over my tank being driven and controlled in groups of 30. This set up leaves me with only 3 channels of control. If I built this design, I'd have 15 channels of control to play with and be able to create seriously high resolution dimming and other lighting effects. Does anyone else see a value to this design? Thoughts?

Here's a photo/schematic of the driver


 
See less See more
1
#84 ·
Yeah- I'll probably just have to spend the time necessary to learn how to use my digital camera. It's a CANON "Power Shot" SD880 IS "Digital Elph". I bought it just to take photos on my job, which it does just fine. I'm not a photographer, so there's a bit of a learning curve for me when it comes to doing more creative things involving a camera. "White balance","F-stop" and all that camera jargon is still Greek to me -LOL.
 
#85 ·
After a quick glance through your camera's manual (http://gdlp01.c-wss.com/gds/8/0300001448/01/PSSD880IS_IXUS870IS_CUG_EN.pdf), it doesn't look like you get a choice of shooting video with a fixed exposure. This is a bad thing as that's what you need to be able to show off your drivers abilities. I may have missed something.
Grab a mate with a dSLR that has video. Sadly I'm a bit far away otherwise I'd be more than happy to do it.
I'm definitely interested in these drivers as they offer the "stage lighting" options I'd like to be able to use to dramatise my tank. Having them optimised for plant welfare while I'm out and for viewing whilst I'm in sounds fantastic. Not to mention the ability to rearrange lighting patterns to go with rescapes...
 
#86 ·
After a quick glance through your camera's manual (http://gdlp01.c-wss.com/gds/8/0300001448/01/PSSD880IS_IXUS870IS_CUG_EN.pdf), it doesn't look like you get a choice of shooting video with a fixed exposure. This is a bad thing as that's what you need to be able to show off your drivers abilities. I may have missed something.
Grab a mate with a dSLR that has video. Sadly I'm a bit far away otherwise I'd be more than happy to do it.
I'm definitely interested in these drivers as they offer the "stage lighting" options I'd like to be able to use to dramatise my tank. Having them optimised for plant welfare while I'm out and for viewing whilst I'm in sounds fantastic. Not to mention the ability to rearrange lighting patterns to go with rescapes...
Thanks for taking a look at the "camera issue". Sadly, I don't know anyone that owns a DSLR camera that could help me out. The way I see it- the real advantage to this driver is the "packaging". It will behave just like any other arduino controlled led driver, but with less of the wiring mess normally involved. I've already passed a couple of these out to other members to play with, hopefully one of them will be able to make a video as part of their build thread.
 
#90 ·
You're Welcome- I'm glad you like it. Here's a copy of a "sketch" that will take advantage of all 6 channels. Give it a try when you're ready.
 

Attachments

#91 ·
Warning: barrage of noob questions coming:

Ok, so for a power supply... I need around 48v to run my emitters. Specifically, would a pair of these work? I think 1.1A is plenty of current, as 500mA is already more than I need, haha...

1. Do I just plug this into the Power Input on the board?
2. What if I need more than 2 power supplies? How/where do I wire those in?

I'm also a total noob when it comes to programming one of these things. I have a Mac, but that doesn't seem to be an obstacle. Just my ignorance.

1. What do I need to connect this to my computer? Also, to what inputs on the board do I connect it?
2. Do I just use the Arduino software to load the sketch?

Last questions:

1. Not sure what the extra connectors are for... do these connect the drivers to the controller via the input pins?
2. If so, do I need to connect drivers I do not use (I will only need 4)?

Thanks for the help on these - I'm very inexperienced with PCB's, so I'm not too sure what I'm looking at. However, I'm clever enough to get myself into trouble if I try to figure it out on my own, haha...
 
#92 ·
OK- Here we go! I can't post a FleaBay link for obvious reasons, but go there and look for a MeanWell RS-150-24 power supply. They're available for around $32 brand new and can supply enough current to drive the "SmartyCat" to full power, should you ever choose to. You'll also need a USB to FTDI adapter to program the board and you can find those on flea bay too. Here's a photo of the board with the programming adapter connected.


If you don't already have the arduino software it's available here. http://arduino.cc/en/Main/Software look for the "older IDE Version 23" not Version 1.0. Version 23 works well with the "Sketch" that I posted earlier.

The jumper wires that I sent you get connected from any one of the six available PWM output pins (Arduino ) to the PWM input header (Cat4101). You don't need to connect all six, if you're only using 4 channels.
I'll draw up a photo of the SmartyCat with all typical connections and post it later. Hopefully I've provided enough info to get you started.
 
#97 ·
Thanks for the compliments, I'm glad you like it. I wish it were that simple but, each CAT4101 needs it's own reference resistor to work properly. The chip attempts to maintain 1.2 volts across the resistor and the current needed to attain that voltage ends up being 1/400 of the actual current driven through the leds.
 
#99 ·
You'll need a PCB as the CAT4101 is only available in a surface mount package. Be aware that you'll need to design in provisions for adequate cooling. The Cat chips are linear current regulators that can quite hot if their source voltage isn't closely matched to their led load.
I only used 6 per PCB because that matched the number of PWM outputs available from the Atmega 328. If you haven't done so already, download the freeware version of EAGLE available here- Downloads | Get The Latest Version of EAGLE | CadSoft EAGLE |and use the design files that I posted earlier in this thread to create your own schematic and PCB. You can edit my schematic using the "copy" command to add as many CAT4101s as you wish. Good Luck
 
#101 ·
My PCB's were manufactured by Seeedstudios in China. They'll make you 10 pcb's measuring 10cm x10cm for as little as $25. Here's a link- Services : Seeed Studio Bazaar, Boost ideas, extend the reach
Just be aware that their "free shipping" can take up to 6 weeks. I paid considerably more for mine because I went with expedited shipping, full testing of the PCB's and a non standard color. My order came in at $87.
 
#102 ·
This...is...just...AWESOME!!!

I've been following this for a while now, and it's looking more and more exactly what I need. Do you have any left?

I'm waiting on the LED's and have been holding off on the drivers 'cuz I'm still going back and forth with design/layout and power/driver. As soon as I get close to a decision on one, something about the other doesn't match, changing decision one, which changes decision 2.....Vicious cycle. Problem may have been solved right here.

Oh, and the WAF is an issue also. I'll make that work, though. It'll probably be a situation where it is easier to ask for forgiveness than to ask for approval.

Also, how easy to add Temp, PH, etc?

Dave
 
#104 ·
Have you had a chance to set yours up yet? I've passed out 4 of these so far. So I'm just waiting patiently to see how well these work for others.
 
#106 ·
So, found my first issue, haha...

I'm trying to upload the sketch, and I am getting an error.

I'm not sure what I'm missing here. I have the Time.h file, so I'm not sure what it means by "no such directory". Am I missing a file? It's bound to be something idiotically simple. This is my first go with any kind of coding, so I feel like I'm playing with fire a bit. Here's what it looks like:



I saved it as a separate file and renamed it "B" in case I screwed something up. Which I probably did.
 
#107 ·
Ok, I had apparently installed the libraries incorrectly. That's fixed. Now, I'm getting a new set of errors, and I don't know what the fix is:

SmartyCat_6_channel_codeB:84: error: 'byte second' redeclared as different kind of symbol
/Users/seankelly/Documents/Arduino/libraries/Time/Time.h:93: error: previous declaration of 'int second(time_t)'
SmartyCat_6_channel_codeB:84: error: 'byte month' redeclared as different kind of symbol
/Users/seankelly/Documents/Arduino/libraries/Time/Time.h:99: error: previous declaration of 'int month(time_t)'
SmartyCat_6_channel_codeB:84: error: 'byte year' redeclared as different kind of symbol
/Users/seankelly/Documents/Arduino/libraries/Time/Time.h:101: error: previous declaration of 'int year(time_t)'
SmartyCat_6_channel_codeB:268: error: expected unqualified-id before '/' token
SmartyCat_6_channel_codeB:268: error: expected constructor, destructor, or type conversion before '/' token
SmartyCat_6_channel_codeB.cpp: In function 'void loop()':
SmartyCat_6_channel_codeB:345: error: cannot resolve overloaded function 'second' based on conversion to type 'byte*'
SmartyCat_6_channel_codeB:349: error: 'DS1307_HR' was not declared in this scope
SmartyCat_6_channel_codeB:353: error: 'DS1307_MIN' was not declared in this scope
SmartyCat_6_channel_codeB:357: error: 'DS1307_SEC' was not declared in this scope
SmartyCat_6_channel_codeB:361: error: 'DS1307_MTH' was not declared in this scope
SmartyCat_6_channel_codeB:365: error: 'DS1307_DATE' was not declared in this scope
SmartyCat_6_channel_codeB:369: error: 'DS1307_YR' was not declared in this scope

Anyone? I'm a hopeless noob, here. I have never done any coding, and I just want this thing to work, haha...
 
#109 ·
It looks to me like you may have the "wrong" library installed in your library folder. I can compile that copy of the sketch without issue, so I'd imagine that there has to be an incompatible library that's installed on your pc. I'll try to put together a folder with all the needed "stuff" to get you up and running. Might take some time though - I gotta chase the kids today
 
#108 ·
I looks to me like you're trying to compile and load a "library" file. Library files can be identified by the ".h" at the end of the file name. Make sure to place that file and any others with the same ".h" into the Arduino 23 "Library" folder. The actual Program "Sketch" will have ".cpp" at the end of the file name. When you open and then "verify/compile" the sketch, the libraries that are called out in that sketch will be accessed and integrated into the actual binary code that is transferred to the chip.

Here's some code that "Sink" wrote. It makes setting the time a breeze. Just copy and paste this into the Arduino23 IDE and name it the "Time_set" sketch. Load this one first to set the time and then load the "Smartycat" sketch( be sure to adjust the start/stop/fade duration/max led intensity values to your liking before loading)

Code:
/*
 * Name:	timeset.pde
 * Author:	User "sink" at plantedtank.net forums
 * URL:		http://bitbucket.org/akl/tank-control
 *
 * This code sets the time on a DS1307 RTC chip attached to an Arduino
 * microcontroller board.  The time is set to the system time when the
 * sketch was compiled (using preprocessor macros), so make sure that:
 *
 *     1. Your system (PC) time is accurate.
 *     2. You recompile the sketch and then upload immediately.
 *
 * The time is skewed forward some seconds to accomodate for compilation and
 * upload time.  If you find the time is consistently off by the same amount,
 * you can modify the adjustment constant below.
 *
 * This code requires the following libraries: Wire, Time, DS1307RTC
 *
 * The latest version of this code can always be found at above url.
 */

/*
 * Copyright (c) 2011, User "sink" at plantedtank.net forums
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice,
 *    this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.

 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.  
 */

#include <Time.h>
#include <Wire.h>
#include <DS1307RTC.h>

/*
 * Time adjustment forward in seconds.  Used to compensate for
 * compilation/upload time.
 */
const int kAdjustment = 20;

/*
 * Utility function for pretty digital clock time output
 * From example code in Time library -- author unknown
 */
void printDigits(int digits) {
  Serial.print(":");
  if(digits < 10)
    Serial.print('0');
  Serial.print(digits);
}

/*
 * Display time
 * Adapted from example code in Time library -- author unknown
 */
void digitalClockDisplay() {
  Serial.print(hour());
  printDigits(minute());
  printDigits(second());
  Serial.print(" ");
  Serial.print(month());
  Serial.print("/");
  Serial.print(day());
  Serial.print("/");
  Serial.print(year()); 
  Serial.println(); 
}

void setup() {

  // convert compilation time and set system clock
  char const *date = __DATE__;
  char const *time = __TIME__;
  int sec, min, hour, day, month, year;
  
  char s_month[5];
  static const char month_names[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
  sscanf(date, "%s %d %d", s_month, &day, &year);
  month = (strstr(month_names, s_month)-month_names)/3;
  sscanf(time, "%d:%d:%d", &hour, &min, &sec);

  setTime(hour, min, sec, day, month+1, year);
  adjustTime(kAdjustment); // crude fwd correction
  time_t t = now();

  // set RTC
  RTC.set(t);

  Serial.begin(115200);
}

void loop () {
  digitalClockDisplay();  
  Serial.println(); 
  delay(1000);
}
 
#111 ·
It may have something to do with it, but I'm not sure. Have you tried loading some of the more basic sketches, like "Blink", just to see what happens? The red LED is already connected to digital pin 13 on the Smartycat, just like an "off the shelf" Arduino, so there's no need for any other connections. Just run the sketch and see what happens.
 
#113 ·
That's weird. Try this copy. There are only two Libraries included, so if it doesn't compile properly, maybe the library you have is wrong or corrupted in some way.


Code:
/*
// ATMEG328P-AU Microcontroller LED lighting controller for aquarium use. 
// The programming code uses a DS1307 Real Time clock to set the LED lighting schedule. Current date and time can be accessed with the serial monitor set to 9600 baud.
// sunrise/sunset time,length of fade duration, and the length of the day are selectable via the programmed schedule.  
//  Circuit description
// PWM pins described below connected to dimming circuits on drivers spread among 6 seperate channels.
// DS1307 RTC ( real time clock) connected via I2C protocol.
*/



// Pins to control each channel LEDs. Change these if you're using different pins.

int oneLed = 3;       // LED PWM arduino pin for channel one.

int twoLed = 5;       // LED PWM arduino pin for channel two 

int threeLed = 6;     // LED PWM arduino pin for channel three

int fourLed = 9;      // LED PWM arduino pin for channel four

int fiveLed = 10;     // LED PWM arduino pin for channel five

int sixLed = 11;      // LED PWM arduino pin for channel six


#include <WProgram.h>
#include <DS1307.h> 
// written by  mattt on the Arduino forum and modified by D. Sjunnesson



// Set up RTC

#include "Wire.h"

#define DS1307_I2C_ADDRESS 0x68



// RTC variables

byte second, rtcMins, oldMins, rtcHrs, oldHrs, dayOfWeek, dayOfMonth, month, year;



// Other variables. These control the behavior of lighting. Change these to customize behavior.

int minCounter = 0;         // counter that resets at midnight. Don't change this.



int oneStartMins = 540;     // minute to start channel 1. Change this to the number of minutes past midnight you want to start

int twoStartMins =420;      // minute to start channel 2. Change this to the number of minutes past midnight you want to start                         

int threeStartMins =540;    // minute to start channel 3. Change this to the number of minutes past midnight you want to start 

int fourStartMins =420;     // minute to start channel 4. Change this to the number of minutes past midnight you want to start 

int fiveStartMins =420;     // minute to start channel 5. Change this to the number of minutes past midnight you want to start 

int sixStartMins =420;      // minute to start channel 6. Change this to the number of minutes past midnight you want to start 


int onePhotoPeriod = 720;   // photoperiod in minutes, for this channel. Change this to alter the total legnth of the day

int twoPhotoPeriod = 960;   // photoperiod in minutes, for this channel. Change this to alter the total legnth of the day                           

int threePhotoPeriod = 720; // photoperiod in minutes, for this channel. Change this to alter the total legnth of the day

int fourPhotoPeriod = 960;  // photoperiod in minutes, for this channel. Change this to alter the total legnth of the day

int fivePhotoPeriod = 960;  // photoperiod in minutes, for this channel. Change this to alter the total legnth of the day

int sixPhotoPeriod = 960;   // photoperiod in minutes, for this channel. Change this to alter the total legnth of the day


int fadeDuration = 180;      // duration of the fade on and off for sunrise and sunset. Change
                            
//    this to alter how long the fade lasts.

int oneMax = 100;           // max intensity for this channel. Change if you want to limit max intensity.

int twoMax = 100;           // max intensity for this channel. Change if you want to limit max intensity. 

int threeMax = 100;         // max intensity for this channel. Change if you want to limit max intensity.

int fourMax = 100;          // max intensity for this channel. Change if you want to limit max intensity.

int fiveMax = 100;          // max intensity for this channel. Change if you want to limit max intensity.

int sixMax = 100;           // max intensity for this channel. Change if you want to limit max intensity.

/****** LED Functions ******/

/***************************/

//function to set LED brightness according to time of day

//function has three equal phases - ramp up, hold, and ramp down

void setLed(int mins,    // current time in minutes
            
int ledPin,  // pin for this channel of LEDs
            
int start,   // start time for this channel of LEDs
            
int period,  // photoperiod for this channel of LEDs
            
int fade,    // fade duration for this channel of LEDs
            
int ledMax   // max value for this channel
            
)  {
  
if (mins <= start || mins <= mins > start + period)  {
    
analogWrite(ledPin, 0);
  
}// This is when the led's are off, thus ledVal =0
  
if (mins > start && mins <= start + fade)  {
    
analogWrite(ledPin, map(mins - start, 0, fade, 0, ledMax));
  
}// This is sunrise. Leds slowly brighten to full intensity
    
if (mins > start + fade && mins <= start + period - fade)  {
   
analogWrite(ledPin, ledMax);
  
}//This is when the led's are at maximum intensity
    
if (mins > start + period - fade && mins <= start + period)  {
    
analogWrite(ledPin, map(mins - start - period + fade, 0, fade, ledMax, 0));
  
}// This is sunset. LEDs slowly fade out.

}



/***** RTC Functions *******/

/***************************/

// Convert normal decimal numbers to binary coded decimal

byte decToBcd(byte val)

{
  
return ( (val/10*16) + (val%10) );

}



// Convert binary coded decimal to normal decimal numbers

byte bcdToDec(byte val)

{
  
return ( (val/16*10) + (val%16) );

}



// 1) Sets the date and time on the ds1307

// 2) Starts the clock

// 3) Sets hour mode to 24 hour clock

// Assumes you're passing in valid numbers.



/* //remove the forward slash and asterisk at the far left to activate the time date setting code




void setDateDs1307(byte second, // 0-59 
                   
byte minute, // 0-59
                   
byte hour, // 1-23
                   
byte dayOfWeek, // 1-7
              
byte dayOfMonth, // 1-28/29/30/31
                   
byte month, // 1-12
                   
byte year) // 0-99

{
   
Wire.beginTransmission(DS1307_I2C_ADDRESS);
   
Wire.send(0);
   
Wire.send(decToBcd(second));
   
Wire.send(decToBcd(minute));
   
Wire.send(decToBcd(hour));
   Wire.send(decToBcd(dayOfWeek));
   
Wire.send(decToBcd(dayOfMonth));
   
Wire.send(decToBcd(month));
   
Wire.send(decToBcd(year));
   
Wire.endTransmission();
     
                             

}

*/ //remove the forward slash and asterisk at the far left to activate the time date setting code



// Gets the date and time from the ds1307 via the I2C protocol.

void getDateDs1307(byte *second,
          
byte *minute,
          
byte *hour,
          
byte *dayOfWeek,
          
byte *dayOfMonth,
          
byte *month,
          
byte *year)

{
  
Wire.beginTransmission(DS1307_I2C_ADDRESS);
  
Wire.send(0);
  
Wire.endTransmission();

  

Wire.requestFrom(DS1307_I2C_ADDRESS, 7);

  
*second     = bcdToDec(Wire.receive() & 0x7f);
  
*minute     = bcdToDec(Wire.receive());
  
*hour       = bcdToDec(Wire.receive() & 0x3f);
  
*dayOfWeek  = bcdToDec(Wire.receive());
  
*dayOfMonth = bcdToDec(Wire.receive());
  
*month      = bcdToDec(Wire.receive());
  
*year  = bcdToDec(Wire.receive());

}



void setup()  { 
    


// init I2C  
  
Serial.begin(9600);
  
Wire.begin();
} 
// these functions only occur once.



/***** Main Loop ***********/

/***************************/

void loop() { 

 
 
  

// get time from RTC and put in hrs and mins variables
  
getDateDs1307(&second, &rtcMins, &rtcHrs, &dayOfWeek, &dayOfMonth, &month, &year);
  
minCounter = rtcHrs * 60 + rtcMins;
 
Serial.print(RTC.get(DS1307_HR,true)); //read the hour and also update all the values by pushing in true
  
Serial.print(":");
  
Serial.print(RTC.get(DS1307_MIN,false));//read minutes without update (false)
  
Serial.print(":");
  
Serial.print(RTC.get(DS1307_SEC,false));//read seconds
  
Serial.print("      "); // some space for a more happy life
  
Serial.print(RTC.get(DS1307_MTH,false));//read month
  
Serial.print("/");
  
Serial.print(RTC.get(DS1307_DATE,false));//read date
  
Serial.print("/");
  
Serial.print(RTC.get(DS1307_YR,false)); //read year 
  
Serial.println();


//set LED values
  
setLed(minCounter, oneLed, oneStartMins, onePhotoPeriod, fadeDuration, oneMax);
  
setLed(minCounter, twoLed, twoStartMins, twoPhotoPeriod, fadeDuration, twoMax);
  
setLed(minCounter, threeLed, threeStartMins, threePhotoPeriod, fadeDuration, threeMax);
  
setLed(minCounter, fourLed, fourStartMins, fourPhotoPeriod, fadeDuration, fourMax);
 
setLed(minCounter, fiveLed, fiveStartMins, fivePhotoPeriod, fadeDuration, fiveMax);
   
setLed(minCounter, sixLed, sixStartMins, sixPhotoPeriod, fadeDuration, sixMax);
 
// Get ready for next iteration of loop
  
delay(1000);

}
 
#114 ·
Ok, so here's a bit of a breakdown of what's going on.

I cut and pasted the code you posted and verified it. This is what came up:

'RTC' was not declared in this scope

SmartyCat_6_channel_codeB.cpp:65:21: error: DS1307.h: No such file or directory
SmartyCat_6_channel_codeB.cpp: In function 'void loop()':
SmartyCat_6_channel_codeB:337: error: 'RTC' was not declared in this scope
SmartyCat_6_channel_codeB:337: error: 'DS1307_HR' was not declared in this scope
SmartyCat_6_channel_codeB:341: error: 'DS1307_MIN' was not declared in this scope
SmartyCat_6_channel_codeB:345: error: 'DS1307_SEC' was not declared in this scope
SmartyCat_6_channel_codeB:349: error: 'DS1307_MTH' was not declared in this scope
SmartyCat_6_channel_codeB:353: error: 'DS1307_DATE' was not declared in this scope
SmartyCat_6_channel_codeB:357: error: 'DS1307_YR' was not declared in this scope

So, I add this: #include <DS1307RTC.h> and this is what I get:

'class DS1307RTC.h' has no member named 'get'

In file included from SmartyCat_6_channel_codeB.cpp:1:
/Users/seankelly/Documents/Arduino/libraries/DS1307RTC/DS1307RTC.h:9:18: error: Time.h: No such file or directory
SmartyCat_6_channel_codeB.cpp:67:21: error: DS1307.h: No such file or directory
In file included from SmartyCat_6_channel_codeB.cpp:1:
/Users/seankelly/Documents/Arduino/libraries/DS1307RTC/DS1307RTC.h:17: error: 'time_t' does not name a type
/Users/seankelly/Documents/Arduino/libraries/DS1307RTC/DS1307RTC.h:18: error: 'time_t' has not been declared
/Users/seankelly/Documents/Arduino/libraries/DS1307RTC/DS1307RTC.h:19: error: 'tmElements_t' has not been declared
/Users/seankelly/Documents/Arduino/libraries/DS1307RTC/DS1307RTC.h:20: error: 'tmElements_t' has not been declared
/Users/seankelly/Documents/Arduino/libraries/DS1307RTC/DS1307RTC.h:23: error: 'uint8_t' does not name a type
/Users/seankelly/Documents/Arduino/libraries/DS1307RTC/DS1307RTC.h:24: error: 'uint8_t' does not name a type
SmartyCat_6_channel_codeB.cpp: In function 'void loop()':
SmartyCat_6_channel_codeB:339: error: 'class DS1307RTC' has no member named 'get'
SmartyCat_6_channel_codeB:339: error: 'DS1307_HR' was not declared in this scope
SmartyCat_6_channel_codeB:343: error: 'class DS1307RTC' has no member named 'get'
SmartyCat_6_channel_codeB:343: error: 'DS1307_MIN' was not declared in this scope
SmartyCat_6_channel_codeB:347: error: 'class DS1307RTC' has no member named 'get'
SmartyCat_6_channel_codeB:347: error: 'DS1307_SEC' was not declared in this scope
SmartyCat_6_channel_codeB:351: error: 'class DS1307RTC' has no member named 'get'
SmartyCat_6_channel_codeB:351: error: 'DS1307_MTH' was not declared in this scope
SmartyCat_6_channel_codeB:355: error: 'class DS1307RTC' has no member named 'get'
SmartyCat_6_channel_codeB:355: error: 'DS1307_DATE' was not declared in this scope
SmartyCat_6_channel_codeB:359: error: 'class DS1307RTC' has no member named 'get'
SmartyCat_6_channel_codeB:359: error: 'DS1307_YR' was not declared in this scope

So, I add: #include <Time.h> and I end up with:

SmartyCat_6_channel_codeB.cpp:69:21: error: DS1307.h: No such file or directory
SmartyCat_6_channel_codeB:76: error: 'byte second' redeclared as different kind of symbol
/Users/seankelly/Documents/Arduino/libraries/Time/Time.h:93: error: previous declaration of 'int second(time_t)'
SmartyCat_6_channel_codeB:76: error: 'byte month' redeclared as different kind of symbol
/Users/seankelly/Documents/Arduino/libraries/Time/Time.h:99: error: previous declaration of 'int month(time_t)'
SmartyCat_6_channel_codeB:76: error: 'byte year' redeclared as different kind of symbol
/Users/seankelly/Documents/Arduino/libraries/Time/Time.h:101: error: previous declaration of 'int year(time_t)'
SmartyCat_6_channel_codeB.cpp: In function 'void loop()':
SmartyCat_6_channel_codeB:337: error: cannot resolve overloaded function 'second' based on conversion to type 'byte*'
SmartyCat_6_channel_codeB:341: error: 'DS1307_HR' was not declared in this scope
SmartyCat_6_channel_codeB:345: error: 'DS1307_MIN' was not declared in this scope
SmartyCat_6_channel_codeB:349: error: 'DS1307_SEC' was not declared in this scope
SmartyCat_6_channel_codeB:353: error: 'DS1307_MTH' was not declared in this scope
SmartyCat_6_channel_codeB:357: error: 'DS1307_DATE' was not declared in this scope
SmartyCat_6_channel_codeB:361: error: 'DS1307_YR' was not declared in this scope

My head hurts, haha... Does this help at all, or am I just making things more difficult? should I shoot Sink a message?
 
#115 ·
Ok, I think you have the wrong version of the DS1307 RTC library version installed. Try the ones attached. You should be able to place both of these folders (unzipped of course) into your library folder and the Arduino IDE should be able to pick the correct one.
 

Attachments

#118 ·
Well now I have a bit of a wiring issue - I think. The emitters were working fine until I installed my splash guard. After that, some weird stuff was going on. I was unplugging the jumpers from the inputs, and the lead for channel one touched the heat sink - and the emitters for that channel turned on. Sure enough, I checked all of them and all four channels were doing the same thing. I'm not really sure what to think, so I left it. I don't want to hijack this thread any more than I already have so I'll leave it at that until I can get it repaired. It may be next week before I get things up again, as I have no idea where to begin.
 
#120 ·
ok starting to wire up my build and have a few questions. firstly i have 3 meanwell power supplies that i got cheap a while ago and was wondering if i could use one to power the chip. i have a s-320-24 meanwell. i puts out 24 volts at 12.5 amps. next i see that there are 2 power inputs on the driver. do i need to supply power to one or both. my ftdi to usb adaptor is on the way so im sure i will have questions on programming when i get that going. i will be running 3 lines of 6 cree xmls at around 2 amps ea. i am a little confused about the pwm part of the driver. wont i be able to dim it based on programming the driver and if not what do i need to wire to where to get this thing to auto dim up and down. thanks for all the help, i will post pics of the build on here as well as par numbers once the unit is up and running.
 
#121 ·
The Power supply you have will work just fine. Here's photo (pardon my Paint skills) of how you should hook it all up. All it really comes down to is "doubling up" on the negative connections from each string of leds to the CAT4101"s and the PWM connections. Your setup only requires a 3 channel control code if the board is wired up like I've shown, since two CAT4101's will be connected to the same PWM signal. You can use the same six channel code that I posted earlier. You'll just have to adjust the variables for the 3 pwm pins that you're using, instead of all 6.

 
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top