DIY Reef Controller ( Help would be great)

Discussion in 'I made this!' started by mati_L, Aug 31, 2011.

to remove this notice and enjoy 3reef content with less ads. 3reef membership is free.

  1. leighton1245

    leighton1245 Horrid Stonefish

    Joined:
    Oct 28, 2010
    Messages:
    2,081
    Yeah to actually get back into it if you learned it once it might take a bit but you will grasp it again. You could add the third for emergency and just have it like a emergency shut down that killed the ATO pump so until reset it wouldn't turn back on, maybe some kind of notification a beep or email even?
     
  2. Click Here!

  3. insanespain

    insanespain Ocellaris Clown

    Joined:
    May 3, 2011
    Messages:
    1,479
    Location:
    Illinois
    Yeah thats not a bad idea. Email is definitely possible with an arduino and an ethernet shield, (shields are boards that snap onto an arduino microcontroller and add features to it). It's definitely a goal to get an arduino talking to a website or something, but its just baby steps right now for me lol. This would be nice to get a group going here working on this and getting a nice lil DIY controller built.
     
  4. mati_L

    mati_L Fire Shrimp

    Joined:
    Jun 16, 2011
    Messages:
    304
    i know a few things need to be changed like the wavemaker code and the water change time is for 20 min, but this is set to run on the serial lcd 20x4 Home from there and key pad


    Found this Code: The code:

    #include <OneWire.h>
    #include <LCDI2C.h>
    #include <WProgram.h>
    #include <Wire.h>
    #include <DS1307.h>

    /* A-normal mode
    B-set time
    C-feed mode
    D-water change mode

    Analog Pin 1 = PH Probe
    Analog Pin 2 = * ORP Probe?
    Analog Pin 3 =
    Analog Pin 4 = SDA for I2C
    Analog Pin 5 = SCL for I2C

    Digital Pin 0 = RX
    Digital Pin 1 = TX
    Digital Pin 2 = Temp Sensor
    Digital Pin 3 = ATO Input

    Digital Pin 4 = Relay 1 Heater
    Digital Pin 5 = Relay 2 Fan
    Digital Pin 6 = Relay 3 Day lights
    Digital Pin 7 = Relay 4 Actinic lights

    Digital Pin 8 = Relay 5 Automatic Top-off
    Digital Pin 9 = Relay 6 Sump shut off (Pump, Reactor pump, UV sterilizer, Skimmer, Upper pump)
    Digital Pin 10 = Relay 7 Power Head #1
    Digital Pin 11 = Relay 8 Power Head #2

    Digital Pin 12 = * available
    Digital Pin 13 = Alarm */

    LCDI2C lcd = LCDI2C(4,20,0x4C,1); // [# of lines on LCD],[address of serial LCD controller on I2C]

    OneWire ds(2); // Temp Sensor on pin 2
    int ato_input = 3; // ATO input on pin 3
    int ph_probe = 1; // pH probe on analog 1

    int heater = 4;
    int fan = 5;
    int day_light = 6;
    int actinic = 7;
    int ato = 8;
    int sump = 9;
    int ph_1 = 10;
    int ph_2 = 11;
    // int available = 12;
    int alarm = 13;

    int heater_on_temp = 7850; // Turn on the heater at this temp ex 78 degrees = 7800, 78.5 degrees = 7850
    int heater_off_temp = 8000; // Turn off heater at this temp

    int fan_on_temp = 8150; // Turn on fan at this temp
    int fan_off_temp = 8050; // Turn fan off once below this temp

    int lights_off_temp = 8300; // Turn off the lights if the temp rises above this temp

    int lights_on_time = 1200; // Turn day lights on at this time (military time)
    int lights_off_time = 2100; // Turn day lights off at this time

    int actinic_on_time = 630; // Turn on the actinics at this time
    int actinic_off_time = 2200; // Turn off the actinics at this time

    int feed_time = 5; // Turn off power heads for this amount of time when feed mode button is pressed.
    int water_change = 20; // Turn off power heads for this amount of time when water change mode is present.
    int pumps_off = -10; // Placeholder --don't change

    int ato_time = 3; // Number of seconds for teh ATO to run each time the switch is on.

    #define NUMREADINGS 10
    int readings[NUMREADINGS]; // The readings from the analog input
    int index = 0; // The index of the current reading
    int total = 0; // The running total
    int average = 0; // The average

    int keypad_delay = 15; // Necessary delay to keep from having scrambled characters on the display

    void setup(void) {
    Wire.begin(); // Initialize the I2C bus
    lcd.init(); // Initialize LCD

    //****** initialize inputs/outputs ************************************/
    pinMode(heater, OUTPUT); // digital pin for heater as output
    pinMode(fan, OUTPUT); // digital pin for moon light as output
    pinMode(day_light, OUTPUT); // digital pin for day light as output
    pinMode(actinic, OUTPUT); // digital pin for fan as output
    pinMode(ato, OUTPUT); // digital pin for auto top off as output
    pinMode(ph_1, OUTPUT); // digital pin for power head 1 as output
    pinMode(ph_2, OUTPUT); // digital pin for power head 2 as output
    pinMode(sump, OUTPUT); // digital pin for skimmer as output
    pinMode(ato_input, INPUT); // digital pin for ATO float switch as input
    pinMode(alarm, OUTPUT); // digital pin for alarm as output

    digitalWrite(day_light, LOW); // set the light off for beginning

    for (int i = 0; i < NUMREADINGS; i++) /* reset vector values */
    readings = 0;
    }

    int High = 0;
    int Low = 10000;
    int ato_hour = 0;
    int on_minute = 1; // indicates that this is the first time through the program.
    int counter_delay =0; // used for countdown during water change and feed mods

    void loop(void){
    int mode = 100;
    if(lcd.keypad() != -1){
    mode = lcd.keypad();
    }

    switch (mode) {
    //*********** Mode B Set Time***************************************************************
    case 101:{
    int minute, hour, second, date, month, year, tens, ones, key;
    int set_time = 0;
    while(set_time == 0){
    lcd.clear();
    hour = RTC.get(DS1307_HR,true); // This is in military time [0,23]
    minute = RTC.get(DS1307_MIN,false);
    second = RTC.get(DS1307_SEC,false);
    date = RTC.get(DS1307_DATE,false);
    month = RTC.get(DS1307_MTH,false);
    year = RTC.get(DS1307_YR,false);

    lcd.setCursor(0,0);
    lcd.print("Set time:");
    lcd.setCursor(1,10);
    if(hour < 10){
    lcd.print(" ");
    delay(keypad_delay);
    }
    lcd.print(hour);
    delay(keypad_delay);
    lcd.print(":");
    delay(keypad_delay);
    if(minute < 10){
    lcd.print("0");
    delay(keypad_delay);
    }
    lcd.print(minute);
    delay(keypad_delay);

    lcd.setCursor(2,0);
    lcd.print("Set date:");
    lcd.setCursor(3,10);
    if(month < 10){
    lcd.print(" ");
    delay(keypad_delay);
    }
    lcd.print(month);
    delay(keypad_delay);
    lcd.print("/");
    delay(keypad_delay);
    if(date < 10){
    lcd.print(" ");
    delay(keypad_delay);
    }
    lcd.print(date);
    delay(keypad_delay);
    lcd.print("/");
    delay(keypad_delay);
    if(year < 10){
    lcd.print("0");
    delay(keypad_delay);
    }
    lcd.print(year);
    delay(keypad_delay);
    lcd.setCursor(1,10);
    lcd.cursor_on();
    //**************Set Hour*********************************************************************************************
    for (;;){
    key = lcd.keypad();
    if(key >= 0 && key <= 2){tens = key; break;}
    }
    for (;;){
    key = lcd.keypad();
    if(key == -1){break;}
    }
    lcd.print(tens);
    delay(keypad_delay);
    for (;;){
    key = lcd.keypad();
    if(key >= 0 && key <= 9){ones = key; break;}
    }
    for (;;){
    key = lcd.keypad();
    if(key == -1){break;}
    }
    lcd.right();
    RTC.stop();
    RTC.set(DS1307_HR,tens * 10 + ones);
    RTC.start();
    lcd.setCursor(1,10);
    hour = RTC.get(DS1307_HR,true);
    if(hour < 10){
    lcd.print(" ");
    delay(keypad_delay);
    }
    lcd.print(hour);
    delay(keypad_delay);
    lcd.right();
    //**************Set Minute*********************************************************************************************
    for (;;){
    key = lcd.keypad();
    if(key >= 0 && key <= 6){tens = key; break;}
    }
    for (;;){
    key = lcd.keypad();
    if(key == -1){break;}
    }
    lcd.print(tens);
    delay(keypad_delay);
    for (;;){
    key = lcd.keypad();
    if(key >= 0 && key <= 9){ones = key; break;}
    }
    for (;;){
    key = lcd.keypad();
    if(key == -1){break;}
    }
    lcd.right();
    RTC.stop();
    RTC.set(DS1307_MIN,tens * 10 + ones);
    RTC.start();
    lcd.setCursor(1,13);
    minute = RTC.get(DS1307_MIN,true);
    if(minute < 10){
    lcd.print("0");
    delay(keypad_delay);
    }
    lcd.print(minute);
    delay(keypad_delay);

    //**************Set Month*********************************************************************************************
    lcd.setCursor(3,10);
    for (;;){
    key = lcd.keypad();
    if(key == 0 || key == 1){tens = key; break;}
    }
    for (;;){
    key = lcd.keypad();
    if(key == -1){break;}
    }
    lcd.print(tens);
    delay(keypad_delay);
    for (;;){
    key = lcd.keypad();
    if(key >= 0 && key <= 9){ones = key; break;}
    }
    for (;;){
    key = lcd.keypad();
    if(key == -1){break;}
    }
    lcd.right();
    RTC.stop();
    RTC.set(DS1307_MTH,tens * 10 + ones);
    RTC.start();
    lcd.setCursor(3,10);
    month = RTC.get(DS1307_MTH,true);
    if(month < 10){
    lcd.print(" ");
    delay(keypad_delay);
    }
    lcd.print(month);
    delay(keypad_delay);

    //**************Set Date*********************************************************************************************
    lcd.setCursor(3,13);
    for (;;){
    key = lcd.keypad();
    if(key >= 0 && key <= 3){tens = key; break;}
    }
    for (;;){
    key = lcd.keypad();
    if(key == -1){break;}
    }
    lcd.print(tens);
    delay(keypad_delay);
    for (;;){
    key = lcd.keypad();
    if(key >= 0 && key <= 9){ones = key; break;}
    }
    for (;;){
    key = lcd.keypad();
    if(key == -1){break;}
    }
    lcd.right();
    RTC.stop();
    RTC.set(DS1307_DATE,tens * 10 + ones);
    RTC.start();
    lcd.setCursor(3,13);
    date = RTC.get(DS1307_DATE,true);
    if(date < 10){
    lcd.print(" ");
    delay(keypad_delay);
    }
    lcd.print(date);
    delay(keypad_delay);

    //**************Set Year*********************************************************************************************
    lcd.setCursor(3,18);
    for (;;){
    key = lcd.keypad();
    if(key >= 0 && key <= 9){tens = key; break;}
    }
    for (;;){
    key = lcd.keypad();
    if(key == -1){break;}
    }
    lcd.print(tens);
    delay(keypad_delay);
    for (;;){
    key = lcd.keypad();
    if(key >= 0 && key <= 9){ones = key; break;}
    }
    for (;;){
    key = lcd.keypad();
    if(key == -1){break;}
    }
    lcd.right();
    RTC.stop();
    RTC.set(DS1307_YR,tens * 10 + ones);
    RTC.start();
    lcd.setCursor(3,16);
    year = RTC.get(DS1307_YR,true);
    if(year < 10){
    lcd.print(" ");
    delay(keypad_delay);
    }
    lcd.print(year);
    delay(5000);
    lcd.clear();
    //**************Finish Up*********************************************************************************************
    for (;;){
    lcd.cursor_off();
    lcd.setCursor(0,0);
    lcd.print("Time & Date Set");
    delay(keypad_delay);
    lcd.setCursor(2,0);
    lcd.print("Select mode A B C D");
    delay(keypad_delay);
    if(lcd.keypad() == 100){set_time = 1; break;}
    if(lcd.keypad() == 101){break;}
    if(lcd.keypad() == 102){set_time = 1; break;}
    if(lcd.keypad() == 103){set_time = 1; break;}
    }
    lcd.clear();
    } // finishes set_time == 0
    break;
    } // end case 101

    case 102: { // case for key C = feed mode
    int minute, second;
    lcd.clear();
    lcd.setCursor(0,1);
    lcd.print("Feed mode active !");
    // Power down whatever has to
    digitalWrite(heater, LOW);
    digitalWrite(fan, LOW);
    digitalWrite(ph_1, LOW);
    digitalWrite(ph_2, LOW);
    digitalWrite(sump, LOW); // add any other device that you want to power down as digitalWrite(device, LOW);

    lcd.setCursor(2,0);
    lcd.print("Time left: ");
    counter_delay = feed_time * 60; // Number of seconds for feed mode
    while(counter_delay >= 0)
    {
    lcd.setCursor(2,12);
    minute = counter_delay / 60;
    second = counter_delay % 60;
    lcd.print(minute,DEC);
    delay(keypad_delay);
    lcd.print(":");
    if(second < 10) {
    lcd.print("0");
    delay(keypad_delay);
    }
    lcd.print(second,DEC);
    delay(1000); // one second delay used also for countdown
    counter_delay = counter_delay -1;
    if(lcd.keypad() == 100) { // forced resume of normal mode by "A" key
    break;
    }
    }
    counter_delay = 0;
    lcd.clear();
    break;
    }

    case 103: { // case for key D = water change mode
    int minute, second;
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Water change mode !");
    // Power down whatever has to
    digitalWrite(heater, LOW);
    digitalWrite(fan, LOW);
    digitalWrite(ph_1, LOW);
    digitalWrite(ph_2, LOW);
    digitalWrite(sump, LOW); // add any other device that you want to power down as digitalWrite(device, LOW);

    lcd.setCursor(2,0);
    lcd.print("Time left: ");
    counter_delay = water_change * 60; // Number of seconds for water change mode
    while(counter_delay >= 0)
    {
    lcd.setCursor(2,12);
    minute = counter_delay / 60;
    second = counter_delay % 60;
    lcd.print(minute,DEC);
    delay(keypad_delay);
    lcd.print(":");
    if(second < 10) {
    lcd.print("0");
    delay(keypad_delay);
    }
    lcd.print(second,DEC);
    delay(1000); // one second delay used also for countdown
    counter_delay = counter_delay -1;
    if(lcd.keypad() == 100) { // forced resume of normal mode by "A" key
    break;
    }
    }
    counter_delay = 0;
    lcd.clear();
    break;
    }

    case 100: { // Normal operating mode the "A" key
    byte i;
    byte present = 0;
    byte data[12];
    byte addr[8];
    long ph_val;
    int HighByte, LowByte, TReading, SignBit, Tc_100, Whole, Fract, minute, hour, second, date, month, year, mil_time, ph_read;
    char buf[12]; // Used to convert int to string for displaying on LCD

    // Get time from DS1307**********************************************************************************************
    hour = RTC.get(DS1307_HR,true); // This is in military time [0,23]
    minute = RTC.get(DS1307_MIN,false);
    second = RTC.get(DS1307_SEC,false);
    mil_time = (hour * 100) + minute; // Create military time output [0000,2400)

    // 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 = 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

    // Display current temperature line 0 first half *****************************************************************************
    lcd.setCursor(0,0);

    Whole = (Tc_100 / 100); // separate off the whole and fractional portions
    Fract = (Tc_100 % 100);

    lcd.print(Whole, DEC);
    delay(keypad_delay);
    lcd.print(".");
    delay(keypad_delay);
    if (Fract < 10)
    {
    lcd.print("0");
    delay(keypad_delay);
    }
    lcd.print(Fract, DEC);
    delay(keypad_delay);
    lcd.write(0xDF);
    delay(keypad_delay);
    lcd.print("F ");
    delay(keypad_delay);

    //Display Time line 0 second half ******************************************************************************************
    lcd.setCursor(0,13);
    if(hour < 10 || (hour > 12 && hour - 12 < 10)){
    lcd.print(" ");
    delay(keypad_delay);
    }
    if(hour > 12){
    lcd.print(hour - 12, DEC);
    delay(keypad_delay);
    }
    if(hour == 0){
    lcd.print(12, DEC);
    delay(keypad_delay);
    }
    if(hour > 0 && hour < 13){
    lcd.print(hour, DEC);
    delay(keypad_delay);
    }
    lcd.print(":");
    delay(keypad_delay);
    if(minute < 10){
    lcd.print("0");
    delay(keypad_delay);
    }
    lcd.print(minute, DEC);
    delay(keypad_delay);
    /* lcd.print(":"); // uncomment for seconds display
    delay(keypad_delay);
    if(second < 10){
    lcd.print("0");
    delay(keypad_delay);
    }
    lcd.print(second, DEC);
    delay(keypad_delay); */
    if(hour < 12 || hour == 0){
    lcd.print("AM");
    delay(keypad_delay);
    }
    else{
    lcd.print("PM");
    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(1,0);
    if(Tc_100 > High){
    High = Tc_100;
    }
    Whole = (High / 100); // separate off the whole and fractional portions
    Fract = (High % 100);
    lcd.print("H= ");
    delay(keypad_delay);
    lcd.print(Whole, DEC);
    delay(keypad_delay);
    lcd.print(".");
    delay(keypad_delay);
    if (Fract < 10)
    {
    lcd.print("0");
    delay(keypad_delay);
    }

    lcd.print(Fract, DEC);
    delay(keypad_delay);
    lcd.write(0xDF);
    delay(keypad_delay);
    lcd.print(" ");
    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
    if(Tc_100 < Low){
    Low = Tc_100;
    }
    Whole = (Low / 100); // separate off the whole and fractional portions
    Fract = (Low % 100);
    lcd.print("L= ");
    delay(keypad_delay);
    lcd.print(Whole, DEC);
    delay(keypad_delay);
    lcd.print(".");
    delay(keypad_delay);
    if (Fract < 10)
    {
    lcd.print("0");
    delay(keypad_delay);
    }
    lcd.print(Fract, DEC);
    delay(keypad_delay);
    lcd.write(0xDF);
    delay(keypad_delay);
    lcd.print(" ");
    delay(keypad_delay);
    }

    //****************Auto top off********************************************************************************
    lcd.setCursor(2,0);
    lcd.print("ATO ");
    delay(keypad_delay);
    if(digitalRead(ato_input) == LOW && ato_hour != hour){
    digitalWrite(ato, HIGH);
    delay(ato_time * 1000); // Turn on ATO pump for the number of seconds defined by ato_time
    digitalWrite(ato, LOW); // Turn off ATO Pump
    ato_hour = hour; // Only allow the ATO to run once per hour / Overflow protection good for dosin kalkwasser
    lcd.setCursor(2,5); // Display the last time the ATO ran
    if(hour < 10 || (hour > 12 && hour - 12 < 10)){
    lcd.print(" ");
    delay(keypad_delay);
    }
    if(hour > 12){
    lcd.print(hour - 12, DEC);
    delay(keypad_delay);
    }
    if(hour == 0){
    lcd.print(12, DEC);
    delay(keypad_delay);
    }
    if(hour > 0 && hour < 13){
    lcd.print(hour, DEC);
    delay(keypad_delay);
    }
    lcd.print(":");
    delay(keypad_delay);
    if(minute < 10){
    lcd.print("0");
    delay(keypad_delay);
    }
    lcd.print(minute, DEC);
    delay(keypad_delay);
    if(hour < 12){
    lcd.print("AM ");
    delay(keypad_delay);
    }
    else{
    lcd.print("PM ");
    delay(keypad_delay);
    }
    }

    //***********PH Probe**********************************************************************************************
    // To calibrate ph probe set 7ph to 2V and 10PH to 1V

    total -= readings[index]; // subtract the last reading
    readings[index] = analogRead(ph_probe); // read from the sensor
    total += readings[index]; // add the reading to the total
    index = (index + 1); // advance to the next index

    if (index >= NUMREADINGS) // if we're at the end of the array...
    index = 0; // ...wrap around to the beginning

    average = total / NUMREADINGS; // calculate the average

    ph_val = (-1.47 * average + 1300); // pH is stored 100 times value

    Whole = (ph_val / 100); // separate off the whole and fractional portions
    Fract = (ph_val % 100);

    lcd.setCursor(2,12);
    lcd.print("pH=");
    delay(keypad_delay);
    if (Whole < 10){
    lcd.print(" ");
    delay(keypad_delay);
    }
    lcd.print(Whole, DEC);
    delay(keypad_delay);
    lcd.print(".");
    delay(keypad_delay);
    if (Fract < 10){
    lcd.print("0");
    delay(keypad_delay);
    }
    lcd.print(Fract, DEC);
    delay(keypad_delay);


    // ******* Relay Controls ******************************************************************************
    /* ************************************************************************************************** */

    // Heater
    if(Tc_100 < heater_on_temp){ // turn heater on if temp is below heater_on_temp
    digitalWrite(heater, HIGH);
    lcd.setCursor(3,1);
    lcd.print("Ht ");
    delay(keypad_delay);
    }
    if(Tc_100 > heater_off_temp){ //turn heater off if temp is above heater_off_temp
    digitalWrite(heater, LOW);
    lcd.setCursor(3,1);
    lcd.print(" ");
    }

    // Fan
    if(Tc_100 > fan_on_temp){ // turn fan on if temp is above fan_on_temp
    digitalWrite(fan, HIGH);
    lcd.setCursor(3,4);
    lcd.print("Fn ");
    delay(keypad_delay);
    }
    if(Tc_100 < fan_off_temp){ //turn fan off if temp is below fan_off_temp
    digitalWrite(fan, LOW);
    lcd.setCursor(3,4);
    lcd.print(" ");
    }

    // Day Lights
    if(mil_time >= lights_on_time && mil_time < lights_off_time) {
    digitalWrite(day_light, HIGH);
    lcd.setCursor(3,7);
    lcd.print("Lt ");
    delay(keypad_delay);
    }
    else {
    digitalWrite(day_light, LOW);
    lcd.setCursor(3,7);
    lcd.print(" ");
    }

    // Actinic lights
    if(mil_time >= actinic_on_time && mil_time < actinic_off_time) {
    digitalWrite(actinic, HIGH);
    lcd.setCursor(3,10);
    lcd.print("Ac ");
    delay(keypad_delay);
    }
    else {
    digitalWrite(actinic, LOW);
    lcd.setCursor(3,10);
    lcd.print(" ");
    }

    // Wavemaker
    if(digitalRead(actinic) == LOW){
    digitalWrite(ph_1, LOW);
    digitalWrite(ph_2, LOW); // Turn off the wavemaker for the night (actinic off)
    lcd.setCursor(3,13);
    lcd.print(" ");

    }
    else {
    if(second <= 30) { // alternate the two heads every 30 seconds
    digitalWrite(ph_1, LOW);
    digitalWrite(ph_2, HIGH);
    lcd.setCursor(3,13);
    lcd.print("H2 ");
    delay(keypad_delay);}
    else {
    digitalWrite(ph_1, HIGH);
    digitalWrite(ph_2, LOW);
    lcd.setCursor(3,13);
    lcd.print("H1 ");
    delay(keypad_delay);}
    }

    // Sump (Upper pump, Lower pump, Skimmer, UV sterilizer, Reactor pump
    digitalWrite(sump, HIGH);
    lcd.setCursor(3,16);
    if(digitalRead(sump) == HIGH) {lcd.print("Sump"); delay(keypad_delay);}
    else {lcd.print("");}

    on_minute = 0; //signals that the program has been run once
    } // closes case 100
    } // closes mode switch
    } // closes loop function
     
  5. insanespain

    insanespain Ocellaris Clown

    Joined:
    May 3, 2011
    Messages:
    1,479
    Location:
    Illinois
    Man that code is a mess. Not saying it doesnt work but it's huge. And its setup to run so much equipment, thats a big wiring job to tackle when you are just starting out.
     
  6. insanespain

    insanespain Ocellaris Clown

    Joined:
    May 3, 2011
    Messages:
    1,479
    Location:
    Illinois
    Also that is setup to use relays to turn lights on and off like a timer. He doesnt have any code in there to fade LEDs for dusk dawn. I have a couple different sketches that I've grabbed off other forums for fading, but I dont like the way they are written so i'm going to write my own from scratch and use certain routines from other sketches.
     
  7. mati_L

    mati_L Fire Shrimp

    Joined:
    Jun 16, 2011
    Messages:
    304
    yeah its a massive code but i was thinking we can pull some stuff from him and other forums
    http://reefprojects.com/wiki/Temp_sensor

    i some what understand now how to set the pin you want truning things on an off so forth, i dont want to slow you down im just very interested in learning
     
  8. Click Here!

  9. leighton1245

    leighton1245 Horrid Stonefish

    Joined:
    Oct 28, 2010
    Messages:
    2,081
    would you set that up on like a slow delay till it reaches full power then stay on for say 8hrs then slowly delay dim?

    ill load windows on this pc tomorrow and if you would like help or even just a second set of eyes for input i could try to help out. :)
     
  10. insanespain

    insanespain Ocellaris Clown

    Joined:
    May 3, 2011
    Messages:
    1,479
    Location:
    Illinois
    Lol I dont think you can slow me down any, I'm already pretty slow at this. Nothing wrong with learning, idk how much help I can be but I'll try to do my best with what I know.
     
  11. chappy85

    chappy85 Coral Banded Shrimp

    Joined:
    Sep 22, 2010
    Messages:
    376
    Location:
    Brisbane, Australia
    everything you could possibly think of is more expensive over here so it could well be cheaper to get the reef angel just for the combined cost of parts.
    I'd consider myself somewhat technically minded so might download the software anyway just to have a look.
    just to get an idea, is this similar to what i'd need to start looking at this?
    EtherTen (100% Arduino Compatible with Onboard Ethernet) - Jaycar Electronics
    I'd imagine the other parts needed to control switching things on and off on top of all the misc. costs could put me over the price of an angel pretty quickly?
     
  12. leighton1245

    leighton1245 Horrid Stonefish

    Joined:
    Oct 28, 2010
    Messages:
    2,081
    i dont like posting another forum on another forum but for the sake of the project this might be helpful to the cause.Arduino Forum - Index