Arduino Aquarium Controller

Looks like your fish cam is knocked out of view. I have to straight web cams at work all the time for monitoring production in a factory.:)
 
yeah seems to reset after awhile. i think i fixed it, now it should look at the tank when it boots up.
 
So the camera thing is cool but the wife doesn't like random people looking into our fish tank, and possibly whatever is reflected off the glass lol. so that wont be on there anymore.
 
joopie can you provide a parts list? This I love the added video feed!

Arduino Mega:
https://www.sparkfun.com/products/11061

Ethernet Shield to talk with database and time keeping:
http://yourduino.com/sunshop2/index.php?l=product_detail&p=291

Temperature Sensors DS18b20(7 in use):
http://www.amazon.com/DS18b20-Waterproof-Temperature-Sensors-Transducer/dp/B00CC7TGKO/ref=sr_1_8?ie=UTF8&qid=1388951534&sr=8-8&keywords=ds+temperature+sensor

LED 90g Dimmable Solderless Kit:
http://www.rapidled.com/standard-solderless-90g-tank-dimmable-kit/

Opto-Isolated 2 Channel Relays for fans,heater and water change pump:
http://yourduino.com/sunshop2/index.php?l=product_detail&p=218

Power strip with above relays mounted inside to control outlets:
http://www.amazon.com/Technical-Pro-PS9U-Supply-Charging/dp/B0057RL6DQ/ref=sr_1_16?ie=UTF8&qid=1388951725&sr=8-16&keywords=dj+power+strip

Solenoids for auto top off, draining, water changes:
http://www.adafruit.com/products/996

I do have some flow meters installed but not in use:
http://www.adafruit.com/products/828

Ultrasonic range finder for sump level:
http://yourduino.com/sunshop2/index.php?l=product_detail&p=115

A PC for web server running Ubuntu and LAMPP. I also use this computers power supply to power the relays and solenoids.

I think that pretty much covers the arduino electronics.
 
Joopie I am going to order rapid LEDs and I was thinking about building an arduino controller. Can I use the 1-10v drivers with an arduino controller or do I have to order the pwm drivers? The reason i am asking is because I was going to use the analog dimmers in the beginning and build the controller later.
 
Joopie I am going to order rapid LEDs and I was thinking about building an arduino controller. Can I use the 1-10v drivers with an arduino controller or do I have to order the pwm drivers? The reason i am asking is because I was going to use the analog dimmers in the beginning and build the controller later.

yep you sure can do a 0-10v output, just google for some examples.I would have gone with the analog dimmers if i saw the 15% cutoff on the pwm ones before i bought the kit.
 
Hi there, new to the DIY fish projects and ardiuno and this forum. Couple ?s if you don't mind. Y use the mega over the uno, as I have the uno. Can I use my uno. Is it possible to provide a wiring diagram because I want to use the temp sensor control led lights white and blue and provide a storm if that is possible. Thanks in advance.
 
Joopie i have a couple of questions. Is the arduino sending all it data to the mysql database and then the website is retrieving it data from the database and then the refresh is doing another database query to pull the latest data? Also are you able to manually control the lights once you are on the password protected part of your site. Thanks for sharing.
 
yep that's exactly whats going on. Once i put the password in, the slots with "Disabled" will show a combo box/number box that lets me select what i want it to do. i can set the % brightness for blue/white LEDs then put LED mode to On and it will set them to that.
 
Could you explain how the ultrasonic module is determining water height in your sump? Also are you using it in a way that provides any sort of overfill protection should it fail?

This looks really interesting.
 
the ultra sonic measurement returns the distance from the water height back to the module. So i subtract that from the distance of the module from the floor. it will kick on at 11 inches and off at 12. i actually soaked it in salt water last night so it was outputing ~27 inches. i have some stuff coded in were it will not allow stuff to happen when there is an alarm condition. Since it was over my alarm set point of 15 inches the auto fill will not turn on. if it wanted to fail low, i have one of these installed that works great! http://www.amazon.com/Kerick-Valve-...F8&qid=1391808864&sr=8-2&keywords=float+valve
it will stop the fill process around ~16 inches.
now that the module is all dried out it seems to be working fine lol.
 
Thanks, so it is just up above your sump measuring the distance to the water's surface? What happens if you get a pipe in the way or something of that sort? Just sets off your water is too high alarm and shuts down the ATO?

This looks like a really fun project. I've spent the last decade coding whatever I'm told for work, so I've not actually had a fun project for myself in a long time. I may have to give this a whirl.
 
I think I understand how you are sending the data to the mysql database. What I am having issues understanding is how you can change the LED brightness from the website. Can you expand on that a little?
Again thanks for sharing!
 
Thanks, so it is just up above your sump measuring the distance to the water's surface? What happens if you get a pipe in the way or something of that sort? Just sets off your water is too high alarm and shuts down the ATO?

This looks like a really fun project. I've spent the last decade coding whatever I'm told for work, so I've not actually had a fun project for myself in a long time. I may have to give this a whirl.

Yeah its on the top of my sump in the open area, so it has a clear shot all the way down if there was no water in it. If something gets in the way it just depends on how far. I have it only working within 6-15 inches, if the arduino gets a value outside of this range it will not turn on the ATO. I have yet to program an "automated" water change but right now i turn my level mode to off so the ATO will be disabled. Then i turn drain mode to on and it'll drain down to 6 inches(for a 30 gallon water change). I then have the water change mode which is my fill pump from a trash can that i use to mix salt water. So i just sit at my computer to do my water change once i have the salt mixed lol.
 
Last edited:
I think I understand how you are sending the data to the mysql database. What I am having issues understanding is how you can change the LED brightness from the website. Can you expand on that a little?
Again thanks for sharing!

This part took me awhile to figure out how to do it. The arduino can read a string from a website. So when things are set on the web site they are updated in the database. The arduino calls this website: http://www.rareglitch.net/get_json.php?&table=CONFIG
which builds a custom string from the database for the arduino to parse. You can see below that RX() will call the website to get the json string thats buffered in readString. When readString is done it goes to parseString(String str) to separate the command and value. Once a command, value pair is separated it gets passed to setInput to assign the variable.

PHP:
void RX(){
  if (client.connect(ip, port))
  {
    client.println("GET /get_json.php?&table=CONFIG");
    client.println();
  }
  if (client) {
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        if (c == '!') {
          client.stop();
        }
        readString += c; 
      }
    }
    parseString(readString);
    readString = "";
  }
  client.flush();
  client.stop();
  client.flush();
}
void parseString(String str){
  keep = true;
  int offset = 0;
  while(keep){
    int start = str.indexOf('#',offset) + 1;
    int mid = str.indexOf('@',offset);
    int finish = str.indexOf('$',offset);
    int endloop = str.indexOf('!');
    offset = finish + 1;
    String name = str.substring(start,mid);
    float value = strTofloat(str.length(),str.substring(mid + 1,finish));
    setInput(name,value);
    if(offset == endloop){
      str = "";
      keep = false; 
    }
  }

}
void setInput(String name,float value){
  if(name == "Heater_Mode"){
    IN_HEATER_MODE = (int)(value);
  }
  else if(name == "LED_Mode"){
    IN_LED_MODE = (int)(value);
  }
  else if(name == "LED_Fan_Mode"){
    IN_LED_FAN_MODE = (int)(value);
  }
  else if(name == "LED_Blue"){
    IN_LED_BLUE = (int)(value);
  }
  else if(name == "LED_White"){
    IN_LED_WHITE = (int)(value);
  }
  else if(name == "Password"){

  }
  else if(name == "Level_Mode"){
    IN_LEVEL_MODE = (int)(value);
  }
  else if(name == "Level_PH_Mode"){
    IN_LEVEL_PH_MODE = (int)(value);
  }
  else if(name == "Level_Drain_Mode"){
    IN_LEVEL_DRAIN_MODE = (int)(value);
  }
  else if(name == "AUX_Mode"){
    IN_AUX_MODE = (int)(value);
  }
  else if(name == "Arduino_Mode"){
    IN_ARDUINO_MODE = (int)(value);
  }
  else{
    Serial.println("INVALID ARGS PASSED TO SETINPUT");
    keep = false;
  }
}
 
Here is what it looks like when i put the password in. All the "Mode" settings have an On Off or Auto. PH Mode has continuous, off or calibration modes.<br>
cfg.PNG
 
Back
Top