Jump to content
Pod Your Reef

LED controllers - dimmers / timers


Waterproof

Recommended Posts

I think you're overcomplicating this. Try changing the brightness manually from 50 to 51%. You probably won't notice *any* change with your eyes. You probably need at least a 5% change to be able to spot it with your eyes, so as long as you only do say 3-5% per increment, the transition will look natural to anyone looking.

 

And say you're using a timer for this, but the resolution of the timer is only 8.3 seconds max and you want it to be ~10 minutes. Simple, just add a counter. 600 seconds is roughly 145*8.3 seconds.

So my previous pseudocode would look like this:

 

var shouldIDoTheTimerStuffNow = false

var timerCount = 0

 

main program loop {....}

 

Timer activated interrupt {

timerCount++

if timerCount == 145 {

shouldIDoTheTimerStuffNow = true

}

}

Link to comment
  • Replies 97
  • Created
  • Last Reply

Hey! I just got my arduino tonight! I haven't built my LED array yet (and probably won't until I get my new tank later this year). But I plan on doing some development in other areas of tank automation... I'll probably start a DIY thread once I get the hang of it.

Link to comment

I am waiting on mine. It was shipped yesterday. BTW ... Ignore my dimming code, been reading up and the using interrupts is the way to go. It will completely change. Thanks to Keli for pointing me in the right direction.

 

I will post my code this weekend. Very cool how you can generate the PWM wave and control the fade and brightness with the compare register. I have a good document that explains it very. Took a while to find something that gives a good visual on how it all works. Also recommend downloading the ATmel 168 data sheet. I would post it but it is well over 300 pages.

 

Have fun...

Link to comment

I know this might be a noob question...

 

I am using buck pucks as my drivers and I just want to make sure I am connecting the PWM of the audrino correctly to them. How is it properly connected?

Link to comment
Care to post the article you found on the dimming? Could be an interesting read.

I have misplaced the pdf file. I think it is on my work laptop and will look again tomorrow. I have a hard copy I will scan and post worse case. I can scan to pdf at work. My scanner at home made huge tif files.

Link to comment

Found it. The visualization of the digital pulse and relating each part to the actual wave (in figure 3) helped me really understand how pwm works with interrupts and how it can be programatically controlled. Especially how raising and lowering the (ref) value changes the duty cycle (length of the pulse itself) and therefore the "on level" , in LED terms increases the brightness. Lowering the ref, fades. I can now relate those with the acual registers so that code exampes posted on the arduino site such as timer1 and timer2 make sense. I can program and took assembler language programming in school, but that was long ago (longer than I care to admit!)

I hope this helps everyone.

PWM_Visual_Explanation.pdf

Link to comment

Cool. I'll have to read that over. I have always done pwn with just delay loops becuase I was unfamiliar with interupts. Time to learn.

Link to comment

Man you guys are sucking me into this project. I've been trying to avoid it like the plague but I'm just not ready to spend $300 on a controller. We should split this project up and each person work on a different aspect of the programming... ATO, Temp Control, PH Control, ORP, lighting, etc. and come back and combine the programming and hardware considerations into one flexible deal everyone can use. I hate you guys.

 

Steve

Link to comment

How did I miss this thread !!

 

I have a pic-based controller that appears to be functioning with simple on/off which can be over-ridden by 5 timers for dawn and 5 timers for dusk, for both of my white and blue arrays. Each array is fully (pwm) dimmable too. I have a crystalfontz lcd display and 16 cell membrane keypad. I also have 2 temp sensors on a feedback loop and pin headers to power fans. This is powered from a 12v wall wart.

 

I say 'appears' because the driver is not finished yet, so I haven't tested it with leds. Once I have I will share schematics and coding, but I don't want to release anything until I am certain it works properly and there are no risks to anybody trying to copy it. Hopefully this will be completed in a few weeks.

 

I also have a new version of the firmware to upload, but wouldn't you know it my pickit 2 stopped working, so I just got a new programmer from China through eBay - so I can test this at the weekend.

 

I am not an expert on much of this, but I do have friends and colleagues who are :D

Link to comment
  • 3 weeks later...

Hello all, please Sorry for my bad english, I am from Ukraine.

I saw the link via Google, and decided to show links to akvakontroller, someone who can help.

This link to diy russian akvakontroller.

 

image005.jpgimage006.jpg

 

This is what he is able to: (menu in english)

*Display time, date, day of week.

*8 channels of control devices

*20 timer programming with the choice of channel loading and programming weekdays

*4 seconds of the timer from 1 to 999 seconds. with the choice of channel load dispensers for use of fertilizers and other dispensers. The accuracy of exposure intervals of not less than 0.02 sec.

*4 of the periodic timer with the inclusion of each hour and minute of the choice of arbitrary on / off

*Support for the two pH electrodes and control valve of CO2. Accuracy of the PR + / - 0.02.

*Support for two electrodes in a 'mV' in the range of + / - 1000mV for controlling redox potential and connecting the ion-selective electrodes

*Supports 8 digital temperature sensors (DS18B20)

*Communications with PC by RS-232 protocol

*Water level sensor with audible warning.

*Program to adjust the brightness of the monitor

*Record readings of sensors in the past day to once per hour

*two outputs with pulse-width modulated signal (PWM) to control EPRA with dimmers or adjustable power fan.

*The function of tracking the deviation of the sensor from the mean value assigned to the audible warning and indication of an emergency transmitter.

 

This link shematic or pcb.

 

here describe a process of assembling and programming the chip.

 

Here lie hex file and the software for the PC - in Russian.

 

Programming system.

 

image007.jpg

 

Our guys in the Ukraine forum did change pcb board for compactness.

 

e01a4d701003.jpg

 

Here is the my devays with blue display.

 

a3820a2200a5.jpg

 

4571ef77bcd5.jpg

 

2df4f8d30cf2.jpg

 

f6e31e308c83.jpg

 

66d787b4201c.jpg

Link to comment

Very cool

 

I hope to get back to work soon and have the time to work on mine some more.

I have all the parts just sitting here. :tears:

Link to comment

You're further along than I am.... I hate the USPS right now... I got my duemillanove less than a week after I ordered it (shipped UPS), but it took about 3 weeks for my temp sensor to arrive, 2 weeks for my float switch (It came from Canada, but I'm in Michigan), and I am still waiting for the rest... 1 month so far for the LCD, and going on 2 weeks for the RTC from futurelec. Yay...

Link to comment

yep I waited 4 weeks for my RTC but only 1 week for my boards :rolleyes:

 

I'm gonna have to set up another PC to use the arduino software cause it don't work on Vista.

and I lost my work laptop when I got laid off. I have a few PC's laying around but no time. :rant:

Link to comment

Yay! So over the RTC came in from futurelec (actually took just over 2 weeks total time from order to receipt). I wasn't expecting it so soon... Now I'm just waiting on the LCD... for some reason I just can't get myself to begin coding until everything arrives... especially something as critical (imo) as the LCD...

Link to comment
  • 3 years later...

I am brand new to this, but am still looking for a similar solution, I would like to do controlled fades or dimming or brightening automatically, So you turn on the LED Lighting, and it slowly turns up the brightness, or to do a fade between two colors, You mention the Arduino, which coincidentally I purchased recently. Would it simply increase an input voltage (120 vac) to brighten the LED Lighting?

 

Thank you

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recommended Discussions


×
×
  • Create New...