(Another) DIY LED Controller - Simple Arduino Style

Thanks for your reply, sounds like it would be best to use transistors and resistors to be on the safe side.
Would be looking at 2 drivers per PWM signal usind a total of 6 drivers, so need 3 PWM outputs.

Cheers Gordon.

Cheers Gordon.

So you will have 3 separate, individually controlled channels. 3 ramp ups and 3 ramp downs. That would be cool.
 
Hi, I have 12 drivers but 2 channels can I use a 2N2222A TO-18 Style transistor instead ? I have got a bunch ! thanks Jeff
 
Hi, I have 12 drivers but 2 channels can I use a 2N2222A TO-18 Style transistor instead ? I have got a bunch ! thanks Jeff

I believe this is the same and ok to use... maybe experts can chime in here... Just make sure the legs assignment for base, collector and emitter.

Also, my drawings might be different but should work if legs assignment are followed.
 
Great, Also what pwm pins do I use? will it matter? or will they be assigned
in the software?

Whats left is 3, 9, 10, and 11... And yes these are all assignable in the sketch.
9 and 10 are reserved for servos (future?).


So use 3 and 11.
 
Here is another diagram complete with resistor and transistor on a breadboard.
Hope this makes sense...

Breadboard%2Btransistor.jpg
 
Hmmm it would seem we would not need the dimming pots any more after we get a way to turn white or blue on or off and dim from the keypad.
 
Hmmm it would seem we would not need the dimming pots any more after we get a way to turn white or blue on or off and dim from the keypad.

Thats very true. Here are the reasons why I still have it.
1) It came from the original wiring diagram.
2) If arduino dies, we can simply short the negative (to make it 100%) and control the device from the "POT". Plan B? if arduino dies.
3) If for example I want to use only 50% or so intensity of lighting, instead of me re-programming my arduino, I simply turn this dial.

Hope it makes sense.

And another thing, my sketch (code) is so simple (i dont know any better), it does not have any control from the keypad yet. Just making it simple for now...

Maybe in the future.
 
Thats very true. Here are the reasons why I still have it.
1) It came from the original wiring diagram.
2) If arduino dies, we can simply short the negative (to make it 100%) and control the device from the "POT". Plan B? if arduino dies.
3) If for example I want to use only 50% or so intensity of lighting, instead of me re-programming my arduino, I simply turn this dial.

Hope it makes sense.

And another thing, my sketch (code) is so simple (i dont know any better), it does not have any control from the keypad yet. Just making it simple for now...

Maybe in the future.

Good plan on the failsafe. I hear ya on simple sketch so far, get it working then add from there. As soon as I get my units in I can start playing with this with you. I am sure other open source projects may help us along our journey.

Got my RTC's in today along with my Hydra Reef Controller board ( I plan on building that project also ) this should be a fun few weeks ahead.
 
Good plan on the failsafe. I hear ya on simple sketch so far, get it working then add from there. As soon as I get my units in I can start playing with this with you. I am sure other open source projects may help us along our journey.

Got my RTC's in today along with my Hydra Reef Controller board ( I plan on building that project also ) this should be a fun few weeks ahead.

Whoa... youre doing the Hydra? well your way advance than me... lol...
 
Whoa... youre doing the Hydra? well your way advance than me... lol...

Lol I can solder pretty decent and understand coding basics. I found someone with a board so I figured I would give it a shot. Its a win win for me I get to make 2 different controllers and it gives me more of a reason to start a quarantine tank.

So you should order a few DS18B20 1 Wire Digital Thermometer ( http://www.taydaelectronics.com/servlet/the-205/18B20-DALLAS-DIGITAL-DS/Detail ) there only $1.60 and shipping was $.99 for 4 of these and 6 other items and you could use one in your heatsink to see what the leds are running at. here is a chunk of code that I found to use it

Code:
// Get temp data from DS18B20 ***************************************************************************************
if ( !ds.search(addr)) {
ds.reset_search();
return;
}
ds.reset();
ds.select(addr);
ds.write(0x44,1); // start conversion, with parasite power on at the end
delay(750); // !!! keep this line for parasite power mode of DS18B20
present = ds.reset();
ds.select(addr);
ds.write(0xBE); // Read Scratchpad
for ( i = 0; i < 9; i++) { // we need 9 bytes
data[i] = ds.read();
}
LowByte = data[0];
HighByte = data[1];
TReading = (HighByte << 8) + LowByte;
SignBit = TReading & 0x8000; // test most sig bit
if (SignBit) // negative
{
TReading = (TReading ^ 0xffff) + 1; // 2's comp
}
Tc_100 = (6 * TReading) + TReading / 4; // Multiply by (100 * 0.0625) or 6.25
Tc_100 = (Tc_100 * 9/5) + 3200; // Convert to fahrenheit, comment this out to display in celcius added 100 for temp correction
temp_Low = min(temp_Low, Tc_100);
temp_High = max(temp_High, Tc_100);

// Display current temperature line 0 *****************************************************************************
if(on_minute == 0) {
lcd.setCursor(0,0);
lcd.print("Wt:");
delay(keypad_delay);
Whole = (Tc_100 / 100); // separate off the whole and fractional portions
Fract = (Tc_100 % 100)/10;
lcd.print(Whole, DEC);
delay(keypad_delay);
lcd.print(".");
delay(keypad_delay);
lcd.print(Fract, DEC);
delay(keypad_delay);
lcd.write(0xDF);
delay(keypad_delay);
}
//Display Low Temp***************************************************************************************
if(on_minute == 0){ //used so if bad data is sent for the first reading, it is not saved
lcd.setCursor(0,9);
Whole = (temp_Low / 100); // separate off the whole and fractional portions
Fract = (temp_Low % 100)/10;
lcd.print(Whole, DEC);
delay(keypad_delay);
lcd.print(".");
delay(keypad_delay);
lcd.print(Fract, DEC);
delay(keypad_delay);
lcd.write(0xDF);
delay(keypad_delay);
lcd.setCursor(0,14);
lcd.print("-");
delay(keypad_delay);
}
//Display High Temp***********************************************************************************
if(on_minute == 0){ //used so if bad data is sent for the first reading, it is not saved
lcd.setCursor(0,15);
Whole = (temp_High / 100); // separate off the whole and fractional portions
Fract = (temp_High % 100)/10;
lcd.print(Whole, DEC);
delay(keypad_delay);
lcd.print(".");
delay(keypad_delay);
lcd.print(Fract, DEC);
delay(keypad_delay);
lcd.write(0xDF);
delay(keypad_delay);
}

found at http://reefprojects.com/w/phpBB3/viewtopic.php?f=8&t=298

Hookup is power, ground, and the digital signal wire pretty easy.

EDIT!!!!!! forgot to mention you can encase these in silicone or some resin epoxy and use em for tank water temp also. thats why I got a few I will do 1 for led temp and 1 for tank temp

EDIT EDIT!!!! he adds this up top in the code

Code:
#include <OneWire.h>

and this a bit down

Code:
Digital Pin 44 = Temp Sensor

and a bit further...

Code:
OneWire ds(44);

and this isnt praising the code right........... but you get the point
 
Last edited:
TheReefNinja, the code tags have trouble including code with brackets so use the php tag instead.

I'm also using DS18B20 on my Hydra and they seem to work well. However few days ago, one of the dipped-in-silicone ones decided to malfunction and my PH started measuring almost 2pts down (showing 6pH !). So just keep that in mind :)
 
TheReefNinja, the code tags have trouble including code with brackets so use the php tag instead.

I'm also using DS18B20 on my Hydra and they seem to work well. However few days ago, one of the dipped-in-silicone ones decided to malfunction and my PH started measuring almost 2pts down (showing 6pH !). So just keep that in mind :)

Thanks for the heads up on these I will make sure to keep an eye on em. Now how did it effect your ph sensor?
 
I believe the silicone must have cracked and caused some voltage leak in the tank, because once I took the probe outside the water the PH normalized.

I just realize I made it sound as though the chip actually cause the PH to dip.
 
So you should order a few DS18B20 1 Wire Digital Thermometer ( http://www.taydaelectronics.com/servlet/the-205/18B20-DALLAS-DIGITAL-DS/Detail ) there only $1.60 and shipping was $.99 for 4 of these and 6 other items and you could use one in your heatsink to see what the leds are running at.

When Im done documenting this project and everyone can follow... I will come back to this post and will probably bother you with a lot of questions... this is a nice feature to add. But in the future.....
 
When Im done documenting this project and everyone can follow... I will come back to this post and will probably bother you with a lot of questions... this is a nice feature to add. But in the future.....

Good stuff. order now it might take a week or 2 to get em lol

Terahz, did you use fish tank silicone? I only wonder if the salt had any effect on it. I plan on doing a thin epoxy dip 3"in up the wires and then encase in silicone hope it holds up. One thing I can think of is the wires being moved around may have loosened up the silicone and allowed water to seep in.

EDIT: what coding environment are you guys using for this I have Eclipse all set up for my android dev stuff but this is C isnt it?
 
Last edited:
Back
Top