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. mati_L

    mati_L Fire Shrimp

    Joined:
    Jun 16, 2011
    Messages:
    304
    i download it and unzip the files but i cant get anything to launch from the files and folders listed...or is that how it should be ?

    I wonder if the reef angel codes and program can work for us ?
     
  2. Click Here!

  3. mati_L

    mati_L Fire Shrimp

    Joined:
    Jun 16, 2011
    Messages:
    304
    finnnaallllllyyyy!! after several trials i finaly downloaded it one more time and program opened
     
  4. leighton1245

    leighton1245 Horrid Stonefish

    Joined:
    Oct 28, 2010
    Messages:
    2,081
    what kind of code is it? I have visual studio if that can help someone out. As i have also done some C++ and other programming not i a year or two but could help out if needed.
     
  5. insanespain

    insanespain Ocellaris Clown

    Joined:
    May 3, 2011
    Messages:
    1,479
    Location:
    Illinois
    Back in Jr.High, during the windows 98 days, I played around with visual basic. That was about 12 or 13 years ago. So basically I have no experience. I just bought the Arduino 6 months ago to try some other small projects and basically looked at the sample programs and went from there. For someone with absolutely no understanding of programming at all, I would recommend a book to buy and read, but for the most part if you are somewhat technically inclined you can learn the basics fairly easy IMO. Google and the arduino forum will get you along ways. The reef angel is overpriced IMO.
     
  6. insanespain

    insanespain Ocellaris Clown

    Joined:
    May 3, 2011
    Messages:
    1,479
    Location:
    Illinois
    The programming language is based on C/C++ so you would probably pick it up easier than me lol.
     
  7. mati_L

    mati_L Fire Shrimp

    Joined:
    Jun 16, 2011
    Messages:
    304
    Yeah im trying to figure out how to read and write the code, its not easy
     
  8. Click Here!

  9. leighton1245

    leighton1245 Horrid Stonefish

    Joined:
    Oct 28, 2010
    Messages:
    2,081
    lol if someone that has the code and would like me to take a look at it and tell me what you would like it to do ill reformat my computer back to windows 7 from mac and see if i can help :) if not im sure i can find someone that knows lots more then me :p

    I just recently bought a controller but if i knew i could program one i would a been all over that lol
     
  10. insanespain

    insanespain Ocellaris Clown

    Joined:
    May 3, 2011
    Messages:
    1,479
    Location:
    Illinois
    Here is an example of some code I wrote, to give a feel for anyone wondering what this is all about. Keep in mind this is a VERY basic ATO program, and I am going to redo some stuff and add some things before making this official and doing a write up. I wrote this yesterday just to try and refresh my memory since it had been awhile since I had played with it, and I'm still in the learning stage.


    Code:
    /*
     Auto Top Off Unit by Insanespain (Beta)
     This is the basic rough draft code for an Arduino based auto top off system for reef tanks.
     It consists of 2 float switches and a relay for the top off pump.
     
     */
     
    // These constants won't change:
    const int floatPin1 = 8;    // pin that the first float switch is attached to
    const int floatPin2 = 7;    // pin that the second float switch is attached to
    const int topoffPin = 10;   // pin that the pump relay is attached to
    
    void setup() {
      // set the float switches as inputs
      pinMode(floatPin1, INPUT);
      pinMode(floatPin2, INPUT);
      // set the relay pin as an output
      pinMode (topoffPin, OUTPUT);
      
    }
    
    // This is the main loop of the program
    void loop() {
      
      TopOff ();  // Run the TopOff routine written below
       
      }
    
    void TopOff () {
      // Read both float switches to see if they agree,
      // if they do then turn the pump on
      if (digitalRead(floatPin1) == HIGH && digitalRead(floatPin2) == HIGH) {
        digitalWrite(topoffPin,HIGH);
        
          } 
      else {
        digitalWrite(topoffPin,LOW);
      }
      
    
    }
    
     
  11. leighton1245

    leighton1245 Horrid Stonefish

    Joined:
    Oct 28, 2010
    Messages:
    2,081
    nice so you have one set up as a fail safe for the other so it doesnt just stay on? or off
     
  12. insanespain

    insanespain Ocellaris Clown

    Joined:
    May 3, 2011
    Messages:
    1,479
    Location:
    Illinois
    Exactly. But with that setup, one could still stick on and the unit would keep functioning normally. I'm thinking about adding a third switch for an emergency shut off that would be mounted higher in the sump, and doing a timeout feature that would only allow the pump to run for a certain amount of time.

    I just basically wrote that to get the feel back. I'm super green with this programming so it helps to actually write code.