DIY LED with arduino

moncapitane

Membership Expired
I am working on getting my arduino setup to work with the drivers I am going to be using. I am finding wiring diagrams for most everything. I have a 4 channel relay and cannot figure out where it needs to go. I have the LCD working and working on my DTC at this time. Anyone have any throughs of where they go? I'm going to be using a transistor and resistor between the driver and the leds but just not sure where the 5v 4 channel relay goes. Thanks all.
 
You should be able to use any unassigned arduino pin as a 5V signal to turn the relays on/off. Just assign the pin as an output in the sketch... When your sketch tells the output to go "high", then it will send 5V to the relay coil, and when your sketch tells the output to go "low" it should send 0V to the relay coil. I'm waiting on my relay boards to arrive from Futurlec (shipping about 4 weeks late, _grumble_). I got the "opto-isolated" ones to basically isolate the arduino board from the relays themselves, hopefully that works.

-Kendall
 
Here is code that is designed for use of MOSFETs allowing rapid on/off to give dimming effect. It should give you an idea on what to code.

// Keihi 24hr 1/2 sunrise/sunset + 10 minute storm
int ledPin11 = 11;

void setup (){}
void loop (){
for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=1)
{analogWrite(ledPin11, fadeValue);
delay(7059);} //half hour sunrise
delay(39600000);// 11 hr day

//2min cloud cover//
for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=1)
{analogWrite(ledPin11, fadeValue);
delay(470);}

//lightning storm (10mins)//
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(40);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(200);
digitalWrite(11, HIGH);
delay(50);
digitalWrite(11, LOW);
delay(1000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(200);
digitalWrite(11, HIGH);
delay(70);
digitalWrite(11, LOW);
delay(1000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(70);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(40);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(200);
digitalWrite(11, HIGH);
delay(50);
digitalWrite(11, LOW);
delay(1000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(200);
digitalWrite(11, HIGH);
delay(70);
digitalWrite(11, LOW);
delay(1000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(70);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10);
digitalWrite(11, HIGH);
delay(20);
digitalWrite(11, LOW);
delay(100000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(40);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(200);
digitalWrite(11, HIGH);
delay(50);
digitalWrite(11, LOW);
delay(1000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(200);
digitalWrite(11, HIGH);
delay(70);
digitalWrite(11, LOW);
delay(1000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(70);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(40);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(200);
digitalWrite(11, HIGH);
delay(50);
digitalWrite(11, LOW);
delay(1000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(200);
digitalWrite(11, HIGH);
delay(70);
digitalWrite(11, LOW);
delay(1000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(70);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10);
digitalWrite(11, HIGH);
delay(20);
digitalWrite(11, LOW);
delay(100000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(40);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(200);
digitalWrite(11, HIGH);
delay(50);
digitalWrite(11, LOW);
delay(1000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(200);
digitalWrite(11, HIGH);
delay(70);
digitalWrite(11, LOW);
delay(1000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(70);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(40);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(200);
digitalWrite(11, HIGH);
delay(50);
digitalWrite(11, LOW);
delay(1000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(200);
digitalWrite(11, HIGH);
delay(70);
digitalWrite(11, LOW);
delay(1000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(70);
digitalWrite(11, LOW);
delay(10000);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(10);
digitalWrite(11, HIGH);
delay(20);
digitalWrite(11, LOW);
delay(71000);
digitalWrite(11, HIGH);
delay(20);
digitalWrite(11, LOW);
delay(70760);
digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(100);digitalWrite(11, HIGH);
delay(10);
digitalWrite(11, LOW);
delay(100);

//1 minute cloud clearing//
{
for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=1)
{analogWrite(ledPin11, fadeValue);
delay(235);}}

//30 min sunset//
for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=1)
{analogWrite(ledPin11, fadeValue);
delay(7059);}
delay(500000);

}
 
I will have to figure out how to convert it to use the 5 V 4 channel relay I have. Not sure how to wire that yet. Thank you btw digital_gods
 
With relays, all you can do is on or off state. The delays are too great todo any dimming. For each realy, connect to digital side but leave pwm free. When you want them on, use a digital high statement and off will use digital low statement. Now if you want to get into dimning, you MOSFETS because the operate quicker than relay.
 
So how do you connect the dimmer device to the relay and the PWM at the same time? Do you have some schematics on how to do this so I can see it? I'm better at understanding when I can see it, rather than trying to understand when presented in text. That would be very helpful if you don't mind. Both the relays and the MOSFETS would be nice. Can you run transistors with the normal 5 V relays and do the same thing or a MOSFET better?
 
What drivers are you using? I built mine using the Cat1401 led driver chip,and no mosfets or relays were required, at least for the led functions. The driver handles the high current, but should accept a PWM or analog signal for dimming...
 
@khoff wrote:
What drivers are you using? I built mine using the Cat1401 led driver chip said:
These are the drivers I am using:
http://shop.stevesleds.com/The-Single-Dimming-LED-Driver-Single-Driver.htm

Not 100% sure the build of these drivers. I would have to email Steve to ask him. They can handle up to 1 AMP.
 
Sure, that's a similar setup to what I've built. The arduino can PWM directly to this driver board, or you could optionally run a pot or other analog 0-10v reference. No mosfets or relays are really required between the arduino and a PWM reference signal input, as the current requirement for an input like this is very very low. You can however use your relay card to run other cool stuff! Like pumps, powerheads on a wave maker, an aqua lifter for ATO, etc.
 
@khoff wrote:
Sure said:
That is awesome. I was curious about what the relays/transmitters were going to be used. I found the list of things needed from reefledcontroller.com but that hasn't been updated in a while.

I blew my last arduino board but I should have a new mega, which I paid less than the cost of the Uno I got, tomorrow and I should be ready to get a string of 7 leds turned on with PWM. I believe I have wired it correctly. I will have to wait and find out.
 
Sweet, good luck! I'll be working on mine as more of a reef controller (finally got my relay boards from futurlec.com after 6 weeks of waiting!!) over the next couple weeks. I have a lot of work to do...
 
I have a new problem. When I have everything plugged into the arduino and the steves leds drivers, everything is powered on, I verified the 5 VDC from the PWM port on the arduino comes on but I do not have any power coming out of the led - and led + ports on the steves leds. Anyone have any thoughts?
 
Does your LED power supply check out? I finally bought a good mean well one from Jameco after I had three ebay power supplies take a dump on me. Can you post a pic or sketch of the setup and wiring?
 
My power supply is pushing almost 25.0 V DC out according to my VOM as per attachment. The following is the way I have the wiring. I have the port 2 on the stevesleds driver to the PWM, its a mega and its port 2 (just trying to do blink for now), port 1 and port 3 are to gnd and V+ on the PSU. I have port 7 plugged into LED - and port 8 to LED +. I am not using port 5 or 6 as I am using PWM. Port 4 is for +5 output and I'm not plugging that into anything as the mega is already powered by an external power connection, that being a AC adaptor running at 7 V. I verified when the "blink" is on, I am getting 4.5 V DC to the wire coming out of the PWM port on the mega. I have attached a screenshot of the PSU showing 24.4 V DC out of the com and V+.
 
I can't tell from you're post if you have the LED string wired in yet. I may be wrong, but I think the driver would require a load to work... If you DO have them wired, are they wired in series (+ to -) or in parallel ( + to +, - to -)? Each string should be wired in series.
 
@khoff wrote:
I can't tell from you're post if you have the LED string wired in yet. I may be wrong said:
I do have them in series, where + to -, I can get two of the leds to light up and blink when connected directly to the arduino using the +5 v but trying with more than 2, the voltage isn't high enough to light 3 up at a time. But I can do 2 for all 7 in the string. I'm trying to make sure I have the right voltage readings from the cat4101 but I think I read it wrong. I will upload that tomorrow or thursday when I get to work on it again.
 
Well, if all the LED's test good, that's something! And for now, the outputs are good on the Arduino.
Is the cat4101 getting hot at all?
So you are testing the CAT with ALL 7 LED's connected in series? I'm thinking maybe too high of voltage dissipation through the chip could lead to thermal shutdown (mine at least blink when they do this though!!)Do you have a second driver you can try?
I think a big scheme picture showing all of your test wiring, components, etc. as well as a sketch would be very helpful at this point...
 
@khoff wrote:
Well said:
I didn't notice it getting hot. I am just testing one single string right now. I have a 3rd driver to test which I hope to do today but I might now. I will attached a schematic as well.
 
I got the drivers working this morning. Steve responded and said I had to bridge ports 5 and 6 since I wasn't using a pot but instead using PWM. This seems to have corrected the issue and i'm getting my drivers working with the blink example from the arduino 1.0.1 software. More to come.
 
Top