DIY Arduino Apex aquarium controller

currently i’m working on building a wifi controllable/programmable sprinkler controller… and started thinking why not turn this into a tank controller! Once this project is done ill likely start my own version of a  reef controller. I’m on the fence on using arduino or raspberryPi.. but im sure it will be one of the two..

Arduino is alot easier to interface with sensors .. and raspberryPi is easier to work with wifi/webpages to interface it.. so its a trade off. (or maybe use both?!)

Stay tuned for more awesome projects and check out the quick demo below.

 

 

Update dec 2 2015

So I found an excellent project based fully with arduino by doughboy. rather than reinventing the wheel i will be using his project as a bse to build off of.. the origional project can be found here.
I started building my arduino based controller from the same project.
So far it runs tiny web server for the web interface. Logs sensor data to an SD card

Controls an 8 channel relay board

Displays info on a LCD screen

Uses a SR04 sonar sensor for ATO water level.

Next will be adding. Temp sensor

 

 

Dec 2nd!  More progress

Today I hacked a cheap auto-feeder and integrated it with the Arduino… I now have own DIY Apex feeder for only $15 🙂

I also got the temperature sensors installed and logging! wooo 🙂

 

DIY auto top off – arduino Optical ATO

Evaporation and increased salinity levels is one of the fastest ways to crash your tank.. An ATO, auto top off or technically an osmolator will automatically add freshwater back in to your tank to keep the water level constant and compensate for evaporation.

Since a fancy auto top off can cost 100-200$ I decided to make my own extremely accurate version for a fraction of the cost.

Rather than using just a standard float valve (which can fail) I went with an optical water level sensor, which is very accurate and detects when water touches the top of the sensor. I also added a float valve as a backup.

(null)

(null)

The microprocessor will only activate the pump of both sensors are not detecting water. If either one senses water the filling sequence is skipped

I also added a Hold switch to the box. When this switch is hit the arduino goes into a loop of blinking the LED as a reminder to turn it back on. This Hold mode will be useful when doing water changes.

(null)

I may add a third safety of only running the pumps for so many second per fill. But this is dependant on if I do micro topoffs 24h/day or hair have the ATO check every few hours or at times I’m not around.

(null)

 

I need some form of a 6 pin connector but came up short and decided to go with a DB9 connector as they are cheap and readily available.(null)

(null)

 

Once i soldered the sensors on to my wire i covered the last half of the wire all the way down to the sensors  in heat shrink to seal it up and have a nice black wire to blend in with the back of the tank.(null)

(null)

(null)

 

Motor on the left,  12V power in the bottom right. DB9 connector for the sensors and USB in case i want to adjust the programming at a future date.

I found a thin acrylic rube which was about the size of an airline. This allowed me to use an airline holder as my mount.  The beauty of this method is i can very easily raise and lower it to set my water level.

 

(null)

(null)

(null)

 

Once i fill the tank ill trim the rod to about the level of the tank. to clean things up.  I do love the simplicity and adjust-ability of this method of mounting it.

(null)

 

Side view of the sensors in the tank. I plan on keeping the water level slightly below this overflow into the pump chamber. This should minimize nose 🙂

 

DIY Automated water changes

Arduino aquarium water changer:

Water changes seems to be the hardest or most time consuming part of keeping an aquarium.. So why not automate it?  In a previous write up i build an automated dosing system i called the Arduino auto doser.  I plan on using the same concept to build an automated water change system with a bit of a twist.

Most water changers simply drain water out than add water back in.  Since my nano reef is a 12G Fluval edge this system would create air bubbles in the top of the tank taking away from its clean aesthetics.  In this system I plan to take out water as the same time i add it. This should keep the water at a consistent level having less impact on the tank while maintaining that elegant look.

For this project I will being using a triple head dosing pump. For now we are only going to use 2 of the heads.. however a third may be useful down the road if i ever decide to do a frag tank. and fill it with water taken from the main nano.

The pump I decided on an industrial Watson marlow pump which i picked up off ebay for about $55. I originally order some cheaper ones from over seas but worried about how precise they were.. this made me lean towards a higher end pump.

wastson-marlow-1 watson-marlow-2

 

The pump head ever has an adjuster to fine tune the output.  This should allow me to calibrate each line to push an identical amount of water.
The pump was previously used for what looks like ink so all hoses will be replaced.

Once calibrated you could automate this with a simple digital wall timer.. however I tend to like safety precautions so I plan on using arduino as my timer with a sensor to kill power to the pump if the water level gets to high.

The fluval edge only has a small collar to work with so everything must be precisely calibrated.

 

 

Fluval edge reef rim

I’m still waiting for the pump to show up in the mail.. So check back often or sign up to our email list at the top of the page as this project will be updated once i receive the goods 🙂

The pump and my optical sensor finally showed up. So far so good for the initial testing.

The ensure for the pump side is complete. Not the prettiest but it eo do the job. It’s enclosed to keep it quiet and prevent and possible leak!

IMG_1821.JPG

IMG_1822.JPG

IMG_1817.JPG

I made a water level sensor holder only to realize my aftermarket led light hits the wires!! Rats. I’ll have to make a second one and hold a sensor on each side of the aquaclear to get around this. Tomorrows project!

IMG_1865.JPG

IMG_1866.JPG

IMG_1867.JPG

IMG_1869.JPG

 

 

March 20 Update.

I moved this tank into a Nuvo 24 and no longer had access to a water line.  I convertered this into two projects.  The first is an auto top off (link to come) and an auto water change that works with Buckets.  Tank water is pumped into an empty bucket at the same time as water is pumped in from a bucket of fresh water.

Arduino Controlled Dosing Pumps

Aquarium controllers can make your life easier.. especially when it comes to remembering to dose your aquarium.  I recently started a new planted tank and realized how bad my lax dosing schedule was… to fix this i decided to build an arduino based dosing system. Yes it may be overkill.. but I do love automation and building so this seemed like the perfect project! They dosing shield consists of an RTC DS1307. I searched the web for countless hours researching how to build this project… I found lots of bits of information but no complete guides so i decided to do this write up as a step by step guide for the beginner arduino builder.

[youtube_video] 8gr5I7OUo7I [/youtube_video]

Arduino Auto Doser

Shopping list:

DS1307 RTC  $3.50
Arduino Uno ATmega 328 $15
Arduino Prototype Shield $5.50  (optional but recommended)3x 1k Resistor
3x IRFZ44N (or any other N channel transistor)
3x Diodes
1x l7805cv   – 5V regulator
3x Dosing pump (ebay)

arduino dosing pump controller IMG_3398

Find a box to mount your project in… This lovely tea box was a whopping $3  and makes a perfect project box.  IMG_3406

Drill some holes yo mount the motors. IMG_3408

Paint your box if desired them mount your components.
IMG_3418 IMG_3433

Update: I finally got a proper tube holder!

tube-holder-aquarium-doser

The Schematic:

arduino controlled dosing pumps

arduino controlled dosing pumps

Arduino Sketch

// Deven Rich   12-5-2013
// This project was built on the Arduino Uno - ATmega328P
// I would also like to give credit to Maurice Ribble for providing chunks of the RTC code
// This code sets up the DS1307 Real Time clock on the Arduino board to controll 3 dosing pumps
// The RTC keeps track of time, the code checks it and turns on the pumps at a specified time
// to dose your aquarium

#include "Wire.h"
#define DS1307_I2C_ADDRESS 0x68

// 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) );
}

// Stops the DS1307, but it has the side effect of setting seconds to 0
// Probably only want to use this for testing
/*void stopDs1307()
{
Wire.beginTransmission(DS1307_I2C_ADDRESS);
Wire.write(0);
Wire.writeWire.writeWire.write(0x80);
Wire.endTransmission();
}*/

// 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-23
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.write(0);
Wire.write(decToBcd(second));    // 0 to bit 7 starts the clock
Wire.write(decToBcd(minute));
Wire.write(decToBcd(hour));      // If you want 12 hour am/pm you need to set
// bit 6 (also need to change readDateDs1307)
Wire.write(decToBcd(dayOfWeek));
Wire.write(decToBcd(dayOfMonth));
Wire.write(decToBcd(month));
Wire.write(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)
{
// Reset the register pointer
Wire.beginTransmission(DS1307_I2C_ADDRESS);
Wire.write(0);
Wire.endTransmission();

Wire.requestFrom(DS1307_I2C_ADDRESS, 7);

// A few of these need masks because certain bits are control bits
*second     = bcdToDec(Wire.read() & 0x7f);
*minute     = bcdToDec(Wire.read());
*hour       = bcdToDec(Wire.read() & 0x3f);  // Need to change this if 12 hour am/pm
*dayOfWeek  = bcdToDec(Wire.read());
*dayOfMonth = bcdToDec(Wire.read());
*month      = bcdToDec(Wire.read());
*year       = bcdToDec(Wire.read());
}

//define pins
int motorPin1 = 9;
int motorPin2 = 10;
int motorPin3 = 11;

void setup()  // run once, when the sketch starts
{
byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
pinMode(motorPin3, OUTPUT);

Wire.begin();
Serial.begin(9600);

// Change these values to what you want to set your clock to.
// You only need to run this the first time you setup your RTC.
// Set the correct value below and un comment it to run it.

/*
second = 45;
minute = 55;
hour = 9;
dayOfWeek = 2;
dayOfMonth = 30;
month = 4;
year = 13;
setDateDs1307(second, minute, hour, dayOfWeek, dayOfMonth, month, year);

*/

}
void loop() // run over and over again
{
byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;

// this prints the output to the serial window (tools > serial monitor in arduino) and is great for testing
getDateDs1307(&second, &minute, &hour, &dayOfWeek, &dayOfMonth, &month, &year);
Serial.print(hour, DEC);
Serial.print(":");
Serial.print(minute, DEC);
Serial.print(":");
Serial.print(second, DEC);

// Set the time you want the motors to kick in
if((hour == 21)&&(minute == 23)&&(second==10)){
Serial.print(" TRUE");
Serial.println(" ");
Serial.println(" MP1");
analogWrite(motorPin1, 255);
delay(8500); // set how long you want the motor to run... 1000 = aprox 1ml

analogWrite(motorPin1, 0);
Serial.println(" MP2");
analogWrite(motorPin2, 255);
delay(9500); // set how long you want the motor to run... 1000 = aprox 1ml

analogWrite(motorPin2, 0);
Serial.println(" MP3");
analogWrite(motorPin3, 255);
delay(5500); // set how long you want the motor to run... 1000 = aprox 1ml
analogWrite(motorPin3, 0);

}
// we dont really need this since we set the pin to low above but just incase 🙂
else{Serial.println(" false");
analogWrite(motorPin1, 0);
analogWrite(motorPin2, 0);
analogWrite(motorPin3, 0);
}

delay(1000);

}

Let me know if you have any questions and enjoy your new Arduino Dosing pumps!

As request I snapped a pic of the underside of the board

20140204-081636.jpg