Reef Central Online Community
Marine Depot

Home Forum Here you can view your subscribed threads, work with private messages and edit your profile and preferences View New Posts View Today's Posts

Find other members Frequently Asked Questions Search Reefkeeping ...an online magazine for marine aquarists Support our sponsors and mention Reef Central

Go Back   Reef Central Online Community > General Interest Forums > Do It Yourself
Register Blogs FAQ Calendar Mark Forums Read

Notices

User Tag List

Reply
Thread Tools
Old 07/21/2021, 08:22 AM   #1
Aqua_expert19
Registered Member
 
Aqua_expert19's Avatar
 
Join Date: Jun 2003
Posts: 713
Nano tank ATO / Water change controller

I figured I would add this here even though I no longer have salt tanks. Maybe it will help someone.

First off I'd like to say the warnings that I'm not responsible for hurting yourself or your property if you follow this guide, this is just what I did.


So I have been looking for a top off for my Mr Aqua Low Iron crystal shrimp tank and nothing off the shelf did it for me. They were either too bulky, not safe enough and most flowed way too fast for what I was looking for. So I decided to build a simple one using an Arduino Nano V3, 2 optical sensors off of amazon and an aqualifter (~1.5gph) .



first here is a really simple schematic of what I did. To get the AC input and Output I just bought a $2 extension cord at the hardware store and cut and spliced it. The 3 leds are for status lights. Each green one is for if the sensor reads water or not. If ON then no water is touching the sensor. The red is for if power to the pump/relay is active.




Next you cant have a small custom ATO with a bad bracket. This bracket is used for glass that is ~0.200" thick. For my rimless cube this is perfect. I added drill holes on the back to put 1/4-20 plastic screws in to really lock it in place. But they aren't necessary . The small holes in the center are to route 3/16's hard tubing for the fill port.






All of this got Jammed into a small project box with a grommet on the side.




I bench tested it for a while before putting it on my tank. Its made so the pump wont turn on until 15mins has passed since power on or the last time the pump ran. This means it wont run for super short bursts 10000x a day and that when I want to do water changes I just unplug it and I get 15mins to drain before it fills it back up. Since its for CRS I wanted it to be pretty slow and the aqualifter does a great job of that.



Things I wish I added and can in the future if it really bothers me is:
  • A button for waterchanges so it turns on the 15min delay without power cycling.
  • Then on my 180 gal I have a float safety on my for my reservoir so if its empty it doesnt keep just pumping nothing



Aqua_expert19 is offline   Reply With Quote
Old 07/21/2021, 08:23 AM   #2
Aqua_expert19
Registered Member
 
Aqua_expert19's Avatar
 
Join Date: Jun 2003
Posts: 713
Here is my code, its not the most efficient but it works and didnt take long to do.
Copy Below this line***


const int ato1Pin = A6;
const int ato2Pin = A7;
const int ato1LEDPin = 4;
const int ato2LEDPin = 3;
const int pumpLEDPin = 2;
const int relayPin = 6;
long delayTime= 900000; //15min in millis

unsigned long relayDelay =0;
unsigned long timer=0;
long timeCompare;

int ato1Value = 0;
int ato2Value = 0;
int pumpONBool =0;

void setup()
{
// initialize serial communications at 9600 bps:
Serial.begin(9600);
pinMode(6, OUTPUT);
}

void loop()
{
ato1Value = analogRead(ato1Pin);
ato2Value = analogRead(ato2Pin);

Serial.print(pumpONBool);
Serial.print(" ");
Serial.print(relayDelay);
Serial.print(" ");
Serial.print(timeCompare);
Serial.print(" ");
Serial.print(timer);
Serial.print(" ");
Serial.print(ato1Value);
Serial.print(" ");
Serial.println(ato2Value);

//* sensor logic **
timer = millis();

if (ato1Value >800)
{
digitalWrite(ato1LEDPin,HIGH);
ato1Value=1
}
else
{
digitalWrite(ato1LEDPin,LOW);
ato1Value=0;
}

if (ato2Value >800)
{
digitalWrite(ato2LEDPin,HIGH);
ato2Value=1;

}
else
{
digitalWrite(ato2LEDPin,LOW);
ato2Value=0;
}


// * TURNING ON PUMP **


if(timer-relayDelay >=delayTime)
{
while(ato1Value ==1 && ato2Value==1)
{

ato1Value = analogRead(ato1Pin);
ato2Value = analogRead(ato2Pin);
digitalWrite(pumpLEDPin,HIGH);
digitalWrite(relayPin,HIGH);
pumpONBool =1;
relayDelay = millis();
}
}

if ( ato1Value ==0 || ato2Value==0)
{
digitalWrite(pumpLEDPin,LOW);
digitalWrite(relayPin,LOW);
pumpONBool =0;
}

//max value of millis rerolled over. ~49 Days so nothing weird happens
if( millis() >= 4294967200)
{
relayDelay=0;
}

}


Aqua_expert19 is offline   Reply With Quote
Old 07/21/2021, 08:25 AM   #3
Aqua_expert19
Registered Member
 
Aqua_expert19's Avatar
 
Join Date: Jun 2003
Posts: 713
Here is the files for the ATO with the original if you want to modify it. I use a Mr Aqua Low Iron rimless Cube 12x12x12". Glass is ~0.200" thick.

Nano Rimless Tank ATO Bracket by slythy


Aqua_expert19 is offline   Reply With Quote
Old 07/25/2021, 08:06 PM   #4
A.T.T.R
Registered Member
 
A.T.T.R's Avatar
 
Join Date: Jan 2007
Location: ft lauderdale
Posts: 2,729
This is perfect for my new tank! How reliable have you found the sensor?


__________________
Chris
Addicted to the Reef-

Current Tank Info: Starting a 20g
A.T.T.R is offline   Reply With Quote
Old 07/26/2021, 06:56 AM   #5
Aqua_expert19
Registered Member
 
Aqua_expert19's Avatar
 
Join Date: Jun 2003
Posts: 713
Quote:
Originally Posted by A.T.T.R View Post
This is perfect for my new tank! How reliable have you found the sensor?
Well that was part of my reason I ran 2 of them. It seems to be pretty sensitive and my tank hasnt changed water level since I put it on so it must be working pretty well.

I think if I was to make a V2 I would add a second output for a second pump then you could choose topoff or Waterchange and add a button to turn it off for how ever long it takes to do thw water change. If you want to make it and you have any questions feel free to ask. I think I have less than $50 total in it.

Also if you measure your glass and its a different size I can mod the file for you!


Aqua_expert19 is offline   Reply With Quote
Old 07/26/2021, 07:45 AM   #6
A.T.T.R
Registered Member
 
A.T.T.R's Avatar
 
Join Date: Jan 2007
Location: ft lauderdale
Posts: 2,729
One thing I’m thinking of is adding to the code a moving average of avg run time and avg daily run time and shut it down if it runs for more then 1.5x avg (assume that means something is very wrong). Other then that looks like I’m setting my 3D printer back up.


__________________
Chris
Addicted to the Reef-

Current Tank Info: Starting a 20g
A.T.T.R is offline   Reply With Quote
Old 07/26/2021, 12:57 PM   #7
Aqua_expert19
Registered Member
 
Aqua_expert19's Avatar
 
Join Date: Jun 2003
Posts: 713
Quote:
Originally Posted by A.T.T.R View Post
One thing Iím thinking of is adding to the code a moving average of avg run time and avg daily run time and shut it down if it runs for more then 1.5x avg (assume that means something is very wrong). Other then that looks like Iím setting my 3D printer back up.
Yea thats not a bad idea at all. I dont have a good way to log it easily to figure it out you could also limit running to 15mins per day or something as I cant imagine (on my 8g) that I would need 1G of water evap. On my other tank I have a float on the bottom of my Reservoir so it doesnt run if its out of water. My temp fluctuations a ton in that room between 68* and 84* so I will get different evap rates anyway.

I want to make a PCB for this to add a bunch of parts and make it all pretty. But then again its working really well and I'm lazy. Post what you end up doing code wise and we can keep a rolling update for anyone else.

One thing to note is I kept the height of the optical sensor lower than the plastic on the inside of the tank. Some printed materials can be toxic so I wanted to keep the plastic out of the water.

I'm just glad someone might use it or find it helpful, I debated posting it for that reason.

Thanks!


Aqua_expert19 is offline   Reply With Quote
Old 07/26/2021, 01:27 PM   #8
A.T.T.R
Registered Member
 
A.T.T.R's Avatar
 
Join Date: Jan 2007
Location: ft lauderdale
Posts: 2,729
It is going to be a few months before I even get to this. I’m
Just starting the tank now.


And I swore to myself no diy this time. That lasted a whole week.


__________________
Chris
Addicted to the Reef-

Current Tank Info: Starting a 20g
A.T.T.R is offline   Reply With Quote
Old 07/26/2021, 07:07 PM   #9
Aqua_expert19
Registered Member
 
Aqua_expert19's Avatar
 
Join Date: Jun 2003
Posts: 713
Quote:
Originally Posted by A.T.T.R View Post

And I swore to myself no diy this time. That lasted a whole week.
Its a great plan until no one makes what you need


Aqua_expert19 is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -6. The time now is 12:00 AM.


TapaTalk Enabled

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Powered by Searchlight © 2021 Axivo Inc.
Use of this web site is subject to the terms and conditions described in the user agreement.
Reef CentralTM Reef Central, LLC. Copyright ©1999-2014
User Alert System provided by Advanced User Tagging v3.3.0 (Pro) - vBulletin Mods & Addons Copyright © 2021 DragonByte Technologies Ltd.