Leaderboard
Popular Content
Showing content with the highest reputation on 12/23/2012 in all areas
-
i will go for 100% cree led lighting. I think the sponsors here bring in some good LED lighting or to save some bucks, you can get a decent sec hand one.1 point
-
My buggy reef controller codes. I have taken this down for the time being as there are some bugs with the program and I am too busy to troubleshoot. It controls the LED drivers for sunset/sunrise, LED intensity controlled using the 3 potentiometers, temp probe, relays for wavemakers and other equipment. /* Arduino LED controller for reef aquariums */ // Pins to control int blueLed = 9; // LED PWM channel for blues int whiteLed = 10; // LED PWM channel for whites int redLed = 6; // Led PWM channel for reds int fanPin = 7; // Relay connected to digital pin 13 // int WavePin = 13; // Wave maker Relay connected to digital pin 7 int SumpPin = 8; // Sump light Relay connected to digital pin 8 int analogInPin = A0; // Analog input pin that the potentiometer is attached to int analogInPin1 = A3; // Analog input pin that the potentiometer is attached to int analogInPin2 = A2; // Analog input pin that the potentiometer is attached to int sensorValue = 0; // value read from the pot int outputValue = 255; // value output to the PWM (analog out) int sensorValue1 = 0; // value read from the pot int outputValue1 = 255; // value output to the PWM (analog out) int sensorValue2 = 0; // value read from the pot int outputValue2 = 255; // value output to the PWM (analog out) int blueout = 0; int whiteout = 0; int redout = 0; int blue = 0; int white = 0; int red = 0; int relay = 0; // Set up #include <WProgram.h> #include <Wire.h> #include <DS1307.h> #include <LiquidCrystal.h> #include <OneWire.h> #include <TimedAction.h> // #include <DallasTemperature.h> TimedAction timedAction = TimedAction(1500, blink); //this initializes a TimedAction class that will change the state of an LED every second. #define WavePin 13 boolean WaveState = false; #define DS1307_I2C_ADDRESS 0x68 // Temperature **************************************************** #define ONE_WIRE_BUS 7 // Data wire is plugged into port 7 on the Arduino // #define TEMPERATURE_PRECISION 9 OneWire oneWire(ONE_WIRE_BUS); // DallasTemperature sensors(&oneWire); // DeviceAddress insideThermometer, outsideThermometer; // RTC variables byte second, rtcMins, oldMins, rtcHrs, oldHrs, dayOfWeek, dayOfMonth, month, year; // Other variables. These control the behavior of lighting. Change these to customize behavoir int minCounter = 0; // counter that resets at midnight. Don't change this. int blueStartMins = 720; // minute to start blues. Change this to the number of minutes past midnight you want the blues to start. int whiteStartMins = 740; // minute to start whites. Same as above. int redStartMins = 750; // minute to start red. int bluePhotoPeriod = 660; // photoperiod in minutes, blues. Change this to alter the total photoperiod for blues. int whitePhotoPeriod = 580; // photoperiod in minutes, whites. Same as above. int redPhotoPeriod = 400; int fadeDuration = 40; // duration of the fade on and off for sunrise and sunset. Change this to alter how long the fade lasts. //int blueMax = outputValue; // max intensity for blues. Change if you want to limit max intensity. //int whiteMax = outputValue1; // max intensity for whites. Same as above. int fanontime =700; // minute to start fan int fanperiod = 700; // duration of fan on time int Sumpontime = 800; // minute to start fan int Sumpperiod = 240; // duration of fan on time int rtc[7]; // LCD interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2); /****** LED Functions ******/ /***************************/ //function to set LED brightness according to time of day //function has three equal phases - ramp up, hold, and ramp down byte setLed(int mins, // current time in minutes byte ledPin, // pin for this channel of LEDs int start, // start time for this channel of LEDs int period, // photoperiod for this channel of LEDs int fade, // fade duration for this channel of LEDs byte ledMax // max value for this channel ) { byte ledVal = 0; if (mins <= start || mins > start + period) { //this is when the LEDs are off, thus ledVal is 0; ledVal = 0; } if (mins > start && mins <= start + fade) { //this is sunrise ledVal = map(mins - start, 0, fade, 0, ledMax); } if (mins > start + fade && mins <= start + period - fade) { //this is when the lights are on max (between sunrise and sunset) ledVal = ledMax; } if (mins > start + period - fade && mins <= start + period) { //this is the sunset. ledVal = map(mins - start - period + fade, 0, fade, ledMax, 0); } analogWrite(ledPin, ledVal); // analogWrite(ledPin, map(ledVal, 0, 100, 0, 255)); return ledVal; } // Relay for Sump & Fan byte setRelay(int mins, byte relayPin, int start, int period) { byte replay = LOW; if (mins <= start || mins > start + period ) { relay = LOW; } if (mins > start && mins <= start + period) { relay = HIGH; } digitalWrite(relayPin, relay); } /***** RTC Functions *******/ /***************************/ // Convert normal decimal numbers to binary coded decimal byte decToBcd(byte val) { return ( (val/10*16) + (val%10) ); } // Convert binary coded decimal to normal decimal numbers byte bcdToDec(byte val) { return ( (val/16*10) + (val%16) ); } // 1) Sets the date and time on the ds1307 // 2) Starts the clock // 3) Sets hour mode to 24 hour clock // Assumes you're passing in valid numbers. void setDateDs1307(byte second, // 0-59 byte minute, // 0-59 byte hour, // 1-24 byte dayOfWeek, // 1-7 byte dayOfMonth, // 1-28/29/30/31 byte month, // 1-12 byte year) // 0-99 { Wire.beginTransmission(DS1307_I2C_ADDRESS); Wire.send(0); Wire.send(decToBcd(second)); Wire.send(decToBcd(minute)); Wire.send(decToBcd(hour)); Wire.send(decToBcd(dayOfWeek)); Wire.send(decToBcd(dayOfMonth)); Wire.send(decToBcd(month)); Wire.send(decToBcd(year)); Wire.endTransmission(); } // Gets the date and time from the ds1307 void getDateDs1307(byte *second, byte *minute, byte *hour, byte *dayOfWeek, byte *dayOfMonth, byte *month, byte *year) { Wire.beginTransmission(DS1307_I2C_ADDRESS); Wire.send(0); Wire.endTransmission(); Wire.requestFrom(DS1307_I2C_ADDRESS, 7); *second = bcdToDec(Wire.receive() & 0x7f); *minute = bcdToDec(Wire.receive()); *hour = bcdToDec(Wire.receive() & 0x3f); *dayOfWeek = bcdToDec(Wire.receive()); *dayOfMonth = bcdToDec(Wire.receive()); *month = bcdToDec(Wire.receive()); *year = bcdToDec(Wire.receive()); } void setup() { // init I2C Wire.begin(); // set up the LCD's number of rows and columns: lcd.begin(16, 2); // initialize the digital pin as an output: // pinMode(fanPin, OUTPUT); pinMode(WavePin, OUTPUT); digitalWrite(WavePin, WaveState); // pinMode(SumpPin, OUTPUT); // Temperature Setup sensors.begin(); // Start up the library if (!sensors.getAddress(insideThermometer, 0)) lcd.println("Unable to find address for Device 0"); if (!sensors.getAddress(outsideThermometer, 1)) lcd.println("Unable to find address for Device 1"); sensors.setResolution(insideThermometer, 12); // set the resolution to x bit sensors.setResolution(outsideThermometer, 12); // set the resolution to x bit } /***** Main Loop ***********/ /***************************/ void loop() { timedAction.check(); // get time from RTC and put in hrs and mins variables getDateDs1307(&second, &rtcMins, &rtcHrs, &dayOfWeek, &dayOfMonth, &month, &year); minCounter = rtcHrs * 60 + rtcMins; delay (100); // read the analog in value: sensorValue = analogRead(analogInPin); // map it to the range of the analog out: outputValue = map(sensorValue, 0, 1023, 0, 255); delay (20); // read the analog in value: sensorValue1 = analogRead(analogInPin1); // map it to the range of the analog out: outputValue1 = map(sensorValue1, 0, 1023, 0, 255); delay (20); // read the analog in value: sensorValue2 = analogRead(analogInPin2); // map it to the range of the analog out: outputValue2 = map(sensorValue2, 0, 1023, 0, 255); delay (20); //set LED values white = setLed(minCounter, whiteLed, whiteStartMins, whitePhotoPeriod, fadeDuration, outputValue1); blue = setLed(minCounter, blueLed, blueStartMins, bluePhotoPeriod, fadeDuration, outputValue); red = setLed(minCounter, redLed, redStartMins, redPhotoPeriod, fadeDuration, outputValue2); delay (50); blueout = map(blue, 0, 255, 0, 99); whiteout = map(white, 0, 255, 0, 99); redout = map(red, 0, 255, 0, 99); // Relay control setRelay(minCounter, fanPin, fanontime, fanperiod); setRelay(minCounter, SumpPin, Sumpontime, Sumpperiod); delay (50); // Print Intensity lcd.setCursor(0, 1); lcd.print("B:"); lcd.print(blueout); lcd.print("%"); lcd.setCursor(6, 1); lcd.print("W:"); lcd.print(whiteout); lcd.print("%"); lcd.setCursor(12, 1); lcd.print("R:"); lcd.print(redout); lcd.print("%"); delay (100); // Print Temperature sensors.requestTemperatures(); float tempCI = sensors.getTempC(insideThermometer); lcd.setCursor(0, 0); lcd.print("Rm:"); lcd.print(TempCI); float tempCO = sensors.getTempC(outsideThermometer); lcd.setCursor(9, 0); lcd.print("T:"); lcd.print(tempCO); // Print Date & Time char* dayOfWeek[] = {"", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"}; char* month[] = {"", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; RTC.get(rtc,true); lcd.setCursor(0, 0); printDigits(rtc[2],':'); printDigits(rtc[1],' '); lcd.print(dayOfWeek[rtc[3]]); lcd.setCursor(10, 0); //Starts on column 0 row 2 lcd.print(rtc[4]); lcd.print('-'); lcd.print(month[rtc[5]]); delay (100); // digitalWrite(WavePin, HIGH); // set the relay on // delay(1000); // wait time in seconds // digitalWrite(WavePin, LOW); // set the relay off // delay(1000); // wait time in seconds } void printDigits(byte digits, char delimiter) { if(digits < 10) lcd.print('0'); lcd.print(digits,DEC); lcd.print(delimiter); delay (100); } void blink(){ WaveState ? WaveState=false : WaveState=true; digitalWrite(WavePin, WaveState); }1 point
-
1) Latezonatus Pair + RBTA home ---- $800 Captive Bred full bar pair that i have kept for well over a year. Pair is also exhibiting spawning behaviour. Female latz measures close to 3". RBTA opens up to palm size and is anchored in a clam shell which prevents it from moving around and also allow easy placement to whichever corner you like. 2) Snow basslet (Serranus Chionaraia) ---- $500 Fish measures 2". Eat pellets, flakes, mysis and anything that drop into the water. 3) Redsea Eightline flasher wrasse (Paracheilinus Octotaenia) ---- $200 3" male. Eating pellets and flakes and anything that drop into the water. 4) Chaetodontoplus Poliourus (Reserved by Bro Eniram) This is the only piece available in singapore! Very rare angel! Eating pellets and flakes and anything that drop into the water.1 point