User project:Reef tank lights

From uCtrl.net

Jump to: navigation, search
Note Note: Check on discussion page for discussion
Info.pngWill be updated at a later date, in other words when I get enough of this written down in my lil journal.... And when the monkeys finish...
Gears icon.png This project is under development.

Contents

What is it going to do

The lighting system basically simulates the 24 hr lighting of a reef. It has a night, day, sunrise, and sunset phase. The phases will be triggered with an internal AVR clock.

What are the features?

There are numerous features including brightness adjustment, cloud cover, seasonal changes, LCD display, and manual LED control. BTW... the LCD display, along with some buttons will allow you to change the times...

LED display(hopefully)

Well I'm fairly new at AVRs myself, but I can learn. I will probably have a few going through some(guess I invented one... look below) communication. The display ATmega8 will control the LCD screen along with all the buttons, the controller will control the lights and maybe a small heater/cooler system.

Time

Well... there's no easy way to do this. I may have my computer to send out a bit when it is 12:00 to sync their clocks and maybe one at 12:30 so the AVR will calibrate the clock.

Weather

Also a may have feature. Weather includes seasons, clouds, global warming options(Kidding), night and day temperature changes, rain, ect.(really please tell me more possible settings)

User Interface

Basically 5 buttons... up, down, left, right, and enter

text scrolls

Communication

well since I know a bit of binary, it shouldn't be too hard to do this: a clock line, a data line

example:

weather 12PM-3PM clouds: w12c15 :10000000(header[128]), 11010111(w[215]), 10000001(1[129]), 10000010(2[130]), 10001011(c[139]), 10000001(1[129]), 10001111(5[143]), 11111111(end[225]).

Clock: when transmitting signal=on not transmitting=off |=off 1|0|0|0|0|0|0|0| either that or I'd go with something harder to use but more reliable (maybe a second clock line? maybe a longer pause in between the 8's?)

||1|0|0|0|0|0|0|0||?



The schematic

the transistor configuration

I'm sorry but the schematic is coming soon... my monkeys are working their butts off trying to make it as this project will have advanced(beyond a regular monkey's comprehension) electroncis... transistors (the monkeys are still learning how they work...)

here's a small portion that I had to draw up on paper... darn monkeys

the diagram

The layout

the layout is basically a bent metal sheet with holes in it and the LEDs attached to those holes with either screws or conductive adhesive... The sheet is for cooling... it may also be for a ground but that will not be as likely... the monkeys are currently drawing the layout in sketchup... man do they like taking breaks...

The Program(Testing Still)

The program is written in basic, using Bascom-AVR.

'--------------------------------------------------------------
'                         By: Brandon Lu
'                    Based on: Thomas Jensen
'--------------------------------------------------------------
'  file: Reef Lighting System
'  date: 1/31/2009
'--------------------------------------------------------------
$regfile = "m8def.dat"
$crystal = 1000000
Config Watchdog = 1024
Config Portb = Output
Config Portc = Input
Dim A As Byte , R As Integer , Speed As Integer , Fade As Integer , Bright As Integer , Rnd As Random
 
'Weather options...
 
Config Timer1 = Pwm , Pwm = 8 , Prescale = 1 , Compare A Pwm = Clear Up , Compare B Pwm = Clear Up
Config Timer2 = Pwm , Prescale = 1 , Compare Pwm = Clear Down
 
Speed = 20
 
Ddrb.1 = 1
Ddrb.2 = 1
 
'LED POWER(lower this to make your LEDs last longer)
 
Pwm1a = 100
Pwm1b = 75
 
'clouds (part1)
 
If Pb.2 = 1 Then Next B Else Next A
 
Random = Rnd
 
If Rnd > 100 Then Rnd = 90
If Rnd < 20 Then Rnd = 30
'Day Time
 
Main:
Do
 
For A = 0 to 30
Incr Pwm1a
Incr Pwm1b
Wait 7200000
Next A
 
Gosub Switches
 
For A = 30 to 90
Incr Pwm1a
Incr Pwm1b
Wait 7200000
Next A
 
Gosub Switches
 
For A = 90 to 45
Decr Pwm1a
Decr Pwm1b
Wait 7200000
Next A
 
Gosub Switches
 
For A = 45 to 5
Decr Pwm1a
Decr Pwm1b
Wait 7200000
Next A
 
Gosub Switches
 
'night time
 
For A = 5 to 10
Incr Pwm1a
Incr Pwm1b
Wait 139385000
Next A
 
Gosub Switches
 
For A = 5 to 10
Incr Pwm1a
Incr Pwm1b
Wait 139385000
Next A
 
Gosub Switches
 
For A = 10 to 5
Incr Pwm1a
Incr Pwm1b
Wait 139385000
Next A
 
Gosub Switches
 
For A = 5 to 0
Decr Pwm1a
Decr Pwm1b
Wait 139385000
Next A
 
Gosub Switches
 
'cloud time!
 
For B = Rnd to Rnd
Decr Pwm1a
Decr Pwm1b
Wait 100
Next B
 
Gosub Switches
 
For B = Rnd to Rnd
Decr Pwm1a
Decr Pwm1b
Wait 100
Next B
 
Gosub Switches
 
loop
End
Personal tools
Variants
Actions
Navigation
Categories
projects
Toolbox