|
||||||||||||||||
|
||||||||||||||||
|
|
#31 | ||
|
Planted Member
|
Thanks!
Quote:
Good question. I'm thinking maybe casting it in a bit of Clear-Lite although I did manage to waterproof an LED for my volcano by coating the wire side with a dab of silicone and shoving it in some silicone air tubing. The wires ran through the tubing and out of the tank. Quote:
__________________
|
||
|
|
|
| Sponsored Links | |||
Advertisement | |||
|
|
#32 |
|
Planted Member
|
A bit of progress on the physical side. For some reason I am putting off the LED dimming setup, I'm not really sure why. My goal though is to have it done tomorrow. I am waiting for the glue to dry on my custom acrylic PCB standoffs right now.
Well here are the lights: ![]() And mounted on the tank: ![]() ![]() From the back: ![]() Yes, that is a tutu behind the tank. While I'm out in the garage cutting and drilling, my wife is at the kitchen table snipping and sewing a tutu for my ballerina daughter. We're birds of a feather, hers are just a lot prettier and more frilly than mine
__________________
|
|
|
|
|
|
#33 |
|
Algae Grower
|
I thought about using silicon of some sort too, but I'm worry about the thermal resistance being too high. I just don't know if it would be responsive enough to control a heater accurately. Hmmmmm, may look into Clear-Lite. Thanks.
|
|
|
|
|
|
#34 | |
|
Planted Member
|
Quote:
Actually, you know what works really well? A layer of Liquid Electrical Tape covered by a layer of GOOD electrical tape the self amalgamating type. The good stuff is expensive, but once you try it, vinyl electrical tape seems really cheesy. We use this method at work to splice cables that are rated for full ocean depth! I finally got some PWM dimming going on. For some reason I had to force myself to get past this part, and I kept finding myself Yak Shaving. But now I have the PCB mounted in the tank, all three LED channels wired up on the PCB, and one channel with a completed driver and programming. The other two will be a snap. As for the driver, I have found that a feedback resistance of 0.33 Ohms (three 1 Ohm resistors in parallel) will give me 750mA of drive current, so that's what I will get at full brightness. Here's the PCB (Man, this looks ugly magnified this much. I really need to clean the flux. ![]() Pulling pin 2 above 2.0 volts enables the driver, below 0.8V will turn it off. Just keep it below VCC, but since max VCC is 23V, that shouldn't be too hard. I wired this to one of the output compare pins (3.3v) on my microcontroller. This allows me to do PWM in hardware and take the burden off of the processor. Here's a gratuitous shot of the back of my PCB: ![]() I built some acrylic standoffs to mount the PCBs in the rear of the tank without having to drill any holes. ![]() I connected the standoffs loosely to the PCBs, put a dab of Weld-On 16 on each of them, then mounted the PCBs into the electronics section of the tank: ![]() The adhesive doesn't take too long to dry so I cleaned up a little, ate dinner, then dragged the whole thing into the living room to do a little programming. In this shot you can see the Wifly that I am using to communicate with the board: ![]() And, final result: http://www.youtube.com/watch?v=TZ4AfE_G17Y It actually works a little better than that, but it's hard to tell because of the auto-iris on the video camera. Not a whole lot better though since the PWM is linear, the light output is somewhat logarithmic, and our eyes respond according to a power law. I may grab the light meter at some point and graph lumens/PAR versus PWM duty cycle. Here's the meat of the code if anyone is interested: Code:
OCR1AL=i; //set the PWM register
if(i%10==0){ //print an update at multiples of 10
printf_P(PSTR("Setting PWM to "));
printf("%u\n",i);
}
i+=dir;
if(i==255) dir=-1; //we hit the top, start counting down
if(i==0) dir=1; //we hit the bottom, start counting up
_delay_ms(20);
__________________
|
|
|
|
|
|
|
#35 |
|
Algae Grower
|
this is so nerdy it hurts my brain
__________________
|
|
|
|
|
|
#36 | |
|
Algae Grower
|
Lol @ toccata...it's alive. You get 'cool nerd' points for showing duty cycle on your oscilloscope!
Quote:
The code you wrote was just an experimental fade up/down right? How do you plan on controling the value in practice? I was just gonna read/write a ref voltage across a pot. Also, are you just using the three LEDs? What kind are they? Is that going to be enough to grow anything? This is so cool, I can't wait to get started on mine. Just gotta wait for parts and free time...maybe spring break. |
|
|
|
|
|
|
#37 | ||
|
Planted Member
|
Quote:
Quote:
WARNING, SERIOUS GEEK DETAILS TO FOLLOW!!!!! There is a timer (TIMER1) inside the chip that constantly counts from 0 to 255 then rolls over and starts again. Every time it rolls overs, it sets the output compare pin to a logic 1 (3.3v). Then when the timer value matches the value in OCR1A (Output Compare Register 1A), it sets the pin low (0v). So to set the LED to a certain dim level, say 50%, I set OCR1A to 128 (256*50%=128. 0-128 is on, 129-255 is off). That's it. No more code required, no interrupts. The firmware can go off and do anything else it wants and the hardware timer handles the set and reset 120 times a second (or a lot faster. I have the timer running at 1/256th speed because I don't want to interfere with the driver switching frequency which is 330kHz). Then later when a command comes in to set the dim level to 75%, I just set OCR1A to (256*75%=192. 0-192 is on, 193-255 is off) and then return to whatever I was doing before. Since the timer counts higher before turning the LED off, it is on for a larger percentage of the time and appears brighter. The microcontroller I am using has 3 output compare registers that run from TIMER1, so I can use OCR1A, OCR1B and OCR1C to drive my three LED channels. If the chip didn't have hardware PWM, I could do a loop that looks something like this: Code:
if(count==0) then set output high; if(count==DimLevel) then set output low; increment count; if(count==Max) then count=0; Microcontrollers with hardware PWM are nice.
__________________
|
||
|
|
|
|
|
#38 |
|
Planted Member
|
Small update, no pics.
All three LED channels are working and mapped to output channels 1,2 and 3. Code:
SO,1,100 Got command SO,1,100 Setting channel 1(led1) to 100 Code:
SO,4,100 Got command SO,4,100 Setting channel 4(fan) to 100 Code:
RTC,GET,1 Got command RTC,GET,1 Time is 23:57:50 on Sunday
__________________
|
|
|
|
|
|
#39 |
|
Algae Grower
|
OH, now this is AWESOME! I WANT ONE!
__________________
BELIEVE IT!!!!!
new tank = new algae! NIKON PIMP#43!! |
|
|
|
|
|
#40 |
|
Planted Tank Obsessed
|
WOW... just WOW, you make me feel inadequate... i just recieved my first ever arduino in the mail today and plan on automating/computerizing my 29g RCS / Endlers tank.
Cant wait to see more of this project.
__________________
|
|
|
|
|
|
#41 | |
|
Planted Member
|
Thanks.
Quote:
Another small update: The RTC is now driving the triggers. I can set TIME and OFFSET triggers and they are stored to EEPROM so they don't get lost when I power down.. TIME triggers will set an output to a specific level at a predetermined time of day OFFSET triggers will set an output to a specific level at a predetermined time after another trigger goes off I have a demo setup running that lights the leds 1 and 3 in turn for 10 seconds. It gives me the following output (I turned the verbosity up to see what's going on. It normally isn't this gregarious): Code:
Running trigger 1 Setting channel 1(led1) to 100 Trigger 1 has kicked off trigger 2 Set trigger_counter[2] to 10 Trigger 1 has kicked off trigger 3 Set trigger_counter[3] to 10 ISR - Trigger 1 fired! Running trigger 4 Setting channel 3(led3) to 0 ISR - Trigger 4 fired! Running trigger 2 Setting channel 1(led1) to 0 ISR - Trigger 2 fired! Running trigger 3 Setting channel 3(led3) to 100 Trigger 3 has kicked off trigger 1 Set trigger_counter[1] to 10 Trigger 3 has kicked off trigger 4 Set trigger_counter[4] to 11 ISR - Trigger 3 fired! I can also set up a TIME trigger to go off at a specific time on multiple days of the week. For instance if I want to dose micros on tuesdays and thursdays at 7am for 12 seconds I can set trigger 5 to go off tuesdays and thursdays at 7am and turn on the dosing pump. Then I set trigger 6 to go off 12 seconds after trigger 5 and turn off the dosing pump.
__________________
|
|
|
|
|
|
|
#42 |
|
Planted Tank Obsessed
|
What ever happened with this project?
|
|
|
|
|
|
#44 |
|
Planted Member
|
You need to keep updating this, it appears to have been dormant for quite a bit.
Such interesting information, Glad I found this thread.
__________________
Each generation imagines itself to be more intelligent than the one that went before it, and wiser than the one that comes after it.
~George Orwell~ It is not the strongest of the species that survives, nor the most intelligent that survives. It is the one that is the most adaptable to change. ~Charles Darwin~ |
|
|
|
|
|
#45 |
|
Planted Tank Obsessed
|
That is pretty cool, I'd love to see the finished aquarium when it's done.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|