# Anyone made an arduino ATO?



## mistergreen (Dec 9, 2006)

Hey, I haven't built one but I saw one where a guy used an ultrasonic range sensor mounted on top of the tank. It would activate the water when the tank is low and stops when it's high. You need one accurate enough for centimeters.

I guess if the range finder were to malfunction, it wouldn't activate the water in the first place?


----------



## scapegoat (Jun 3, 2010)

I'm working on one as an addition to my raspberry pi aquarium controller.

I have one of these:

Amazon.com: Water Level Sensor Depth of Detection Water Sensor for Arduino: Computers & Accessories

But there are better, more expensive, units available, that I've considered... like this

http://www.adafruit.com/products/463

I like that this has measurements on it as well, to help you place it correctly. But for $40 I'd rather stick to other one for the time being.

Personally, for our applications I'd use two as a fail safe. Take measurements from both and compare the results to ensure they're not reading wrong/malfunctioning.

For water proofing the electronics, I'd probably use hot glue or clear silicone.

I also have two float switches that I was going to put in series. one normally off, one normally on. so if the normally on one gets switched off it means that the water level is too high in the sump and breaks the signal. I feel like the analog set up would be easier and less prone to issues. It just doesn't look as good.


----------



## shift (Jan 7, 2013)

I 100% want a fail safe is overflowing (and destroying the laminate) is my biggest worry. I converted one of my nanos into a reef tank (first salty!) so this is what im building it for.. the tank is a fulval edge with a small opening on top so i'm avoiding anything bulky that would take away from the astetics.

ReefFloat makes a fluval edge however its very pricey by the time you ship it and convert it from pounds > http://www.reefloat.com/atu2-pro-auto-top-up.html

They use just an optical sensor.. so they must have all kinds of logic in the code to only work if its within a specific range for a fail safe.


I ordered an optical sensor and a few different float switches to play with.

































I'm thinking if you only tell it to top off when the water is within a small range (min max).. a cm or two. then when you change the water it should be to far out of range and not fill.. alternatively as a saftey if it was to fall off it should get a reading out of the "fill range".

Could also set it up to say pump for 5 seconds stop - re-check - then on.
another thought, is making it take multiple readings and comparing them over 3-5 seconds to account for water turbulence giving a false reading


----------



## scapegoat (Jun 3, 2010)

i like the idea of multiple reading comparison as well as not filling if the water is too far away. That should protect you in case your tank springs a leak and your ATO keeps trying to fill a leaking tank.

I hadn't thought of that possibility.

I'm going to take a look at that IR sensor as well. My concern with that is it getting dirty from splashed water or water and throwing it off.


----------



## shift (Jan 7, 2013)

I think taking readings over a 5 second period should account for waves and splashes. Alternatively could uses a second or different type of sensor as a backup incase 1 buggers up

I have all then ones above on order..now I'm just waiting on the mail fairy to bring me gifts


----------



## PhysicsDude55 (Oct 24, 2011)

I'm in the middle of implementing this.

I did a system in the past with just using 1 float switch, and the arduino would control the ATO pump. It worked, but was pretty basic.

In my setup I'm working on now, there is a float switch that looks like this (and I spray painted it black):










Which I put as a backup, at about 1/2" higher than the highest point that I want the water level. If the float switch hits water it turns off my ATO pump no matter what.

I have 2 ultrasonic sensors, one in the tank, one in the reservoir. I've played around with the ultrasonic sensors on my bench, but haven't tested them with water yet, but I've seen other setups where people say they work pretty well. The ultrasonic sensors will trigger the arduino to add water after it senses low water for like 10 minutes straight to avoid erratic behavior, and turns the pump on for minimum 5 seconds.

From my initial tests, I found that the ultrasonic sensors were pretty accurate from about 4 inches to ~2 feet, but closer or farther they lose accuracy.

I also found that you can use the same "trigger" for both sensors, and then collect each "bounce" separately, so 2 ultrasonic sensors only use up 3 digital pins instead of 4. I collect a measurement every second, and average 3 measurements together for a rolling average.

My ATO pump is a bilge pump from a boat with its own float switch, so when the reservoir runs out of water the arduino will keep telling the pump to turn on but it won't. The arduino will alert me if the pump has been on for more than 5 minutes straight without the water level increasing.


----------



## MrMan (Dec 5, 2014)

I combined an ATO into my arduino controller but only have a single float switch to watch the water level. I'm using the Tunze ATO pump so I just measured how long it takes to return 1cm worth of water in my display tank and I have my controller flag an alarm if it runs for longer than that time. It also waits for the water level to read low for an hour straight so it doesn't run too often. 

If the switch fails, the controller still won't flood everything since it will turn off after a short time. And if I see that it's flagged the alarm I know I need to look into why. This has been working for a few months now with no problem.


----------



## ErtyJr (Jun 21, 2014)

Just a thought... if you want the ultimate failsafe you could install some sort of overflow directly to a drain. In the event the tank ever hit that water height it dumps it in the drain.

Only issue is this being salt you might get flooded with freshwater though so I dunno. Worth a thougt.


----------



## shift (Jan 7, 2013)

If I had one close enough I would! I guess I could put a little notch as a low spot on the back of the tank and feed a tube down to a bucket... Wouldn't be pretty but would work if you could have it all hidden


----------



## shift (Jan 7, 2013)

Rather Than top offs I may just try doing daily mini water changes


----------



## Ultimbow (Mar 19, 2009)

i am going to order one of those for my arduino build eventually there are quite cheep compare to many others but i would not use without a safety float... For my arduino built :

http://www.aliexpress.com/item/ESM-PE18-photoelectric-liquid-level-sensor-switch/2025235530.html

there this too already built.

http://www.aliexpress.com/item/Free...rm-an-upgraded-version-of-the/2042805134.html


----------



## shift (Jan 7, 2013)

The already built one? Is one sensor a high and a low. Or 2 as a fails safe?

Ideally you would want 2 different sensors as a fail safe


----------



## Ultimbow (Mar 19, 2009)

I think is low and high but not sure it doesn't say.


----------



## shift (Jan 7, 2013)

Does anyone know of a micro sizes float valve? All the ones I find have big bobber floats


----------



## PhysicsDude55 (Oct 24, 2011)

How small are you thinking? The ones I have, the float parts are about 3/4" in diameter. I don't think I've seen smaller ones.


----------



## shift (Jan 7, 2013)

Small as possible. Since I have limited space to work with. Where did u get yours from?

I have a bit of a new plan for making an automatic water change. 
I just ordered one of these doing pumps [Ebay Link Removed]

Both line should have the same output. Which means I can suck out and add an identical amount of water at the same time. Water changes with out the tank level changing. I could also automate it to do small daily water changes . I will still need 1-2 sensors to shut it all off as a safety!

Only other consideration is the volume of water in the 20' ish of hose. As long as it stays primed it shouldn't be an issue


----------



## shift (Jan 7, 2013)

Does a anyone know if a nice connector to hook up 1/8" line 1/4 RO line


----------



## shift (Jan 7, 2013)

So far so good on the testing of the auto water change. If I let it run for 5 min and the water level didn't change. I think I'll just buy some bulk airline for my hose to keep it simple for water lines

http://youtu.be/t77dpXbN00g

Only current issue. I don't think I can use the same sensor for for both ATO and and water change. I have it set to pump for 10 seconds ever hour.... The optical water sensor outputs high or low so if the value is high the pumps don't turn on. If I used an ATO it would pump until the sensor turned it off...ever with the optical sensor triggered the auto water changes won't happen. Grrr getting closer


----------



## mistergreen (Dec 9, 2006)

What's that pump you're using?


----------



## shift (Jan 7, 2013)

Triple head watson marlow pump I got off the bay


----------



## mistergreen (Dec 9, 2006)

Do you know if it's brushed or brushless?
I guy on my forum ran his brushed peristaltic bump pretty much all the time and it burnt out within a few weeks.


----------



## shift (Jan 7, 2013)

I'm not to sure.. However it's built for industrial applications.. Which is why I went for this type


----------



## shift (Jan 7, 2013)

Well I finally got around to buliing my Arduino ATO last night. Almost diene

http://fishtankprojects.com/diy-aquarium-projects/diy-auto-top-off-arduino-optical-ato.html


----------



## zerodameaon (Dec 2, 2014)

mistergreen said:


> Do you know if it's brushed or brushless?
> I guy on my forum ran his brushed peristaltic bump pretty much all the time and it burnt out within a few weeks.


It might be a stepper motor but the cheaper pumps seem to all be brushed.
Shift was this pump using 2 wires or 3+?

Looking into this I could not help but think I could sacrifice my RAMPs board from my 3d printer once I get my Photonic Elephant in May and have a crazy 5 pump setup.


----------



## shift (Jan 7, 2013)

It's 2 wires. They are cheap pumps but work well and stay primed. I'll snap a pic later of the back if you want


----------



## Beer (Feb 1, 2012)

I'm a little late to the game on this one.
I think an Arduino is total overkill for this. Unless you are building your own Arduino and have the stuff to use another board as an ISP to burn the boot loader, an already built option will be cleaner, faster, and around the same money (possibly with better features, depending on how advanced you go). Now if you are using the Arduino to run additional features, that is a completely different story.
It is a good project if you want to start messing around with Arduino or get a brief intro into coding.

You can pick up float valves on Amazon for a few bucks that look like the first float valve picture posted in this thread. They should be able to be mounted in the opening of a Fluval Edge without showing by making a bracket from cheap hardware store Lexan. The float diameter is 1/2" or so. I've been using them to drive a two or three watt air pump for the ATO (pressurize a jar with a lift tube that goes to the bottom of the jar and drips into the sump through an irrigation dripper) in my pico for just shy (by a few weeks) of a year. They should be triggering a relay considering they are cheap reed switches, but I'll get around to changing that when I set it up with 555 timers to minimize cycling.

Ideally the float valves would trigger a 555 timer (possibly 2 cascaded timers to extend the time required) that would engage the relay to turn on the pump. This would make it so that the float switch needs to be engaged for a specific time interval before the pump kicks on to prevent excessive cycling. Another set of 555 timers could be used to delay the shutoff, again to prevent excessive cycling due to evaporative rates and waves/splashing.
For salt water, this also assumes that the ATO flow rate is fairly slow in comparison to the total tank volume and that the float switches have a short triggering range (the Amazon ones do) to prevent excessive swings.

Two floats are used, wired in series. I put the O-ring below the mount on one switch, and above (or not used) on the other. This causes one float to sit 1/16 higher than the other. The higher is the backup. This 1/16 difference does not create a noticeable change in salinity. Test monthly during a (weekly) water change to verify the lower is the one triggering ATO and that the higher one will shut it off.

It is too late and this is too long to proof read properly on my phone, so I apologize if parts of this do not make sense.


----------



## shift (Jan 7, 2013)

Arduino boards are cheap.. at 8-9$ a board it is a nice interface and allows advanced features. 

You could completely do this with just floats and simple switches however have mine wired up for additial saftey. and only fill if both sensors don't sense water... it will also stop filling after 60 seconds for an additional saftey. There is a hold switch to disable it for water changes with a flashing light to remind you o turn it on ect.

If the pump noise bothered me i could tell it to only check fill at specific times throughout the day.. Overkill .. probably. awesome.. yes! but considering it cost me maybe $40 compared to a comparable one from tunze at close to $200 i think its a worthy investment. That and i like the multiple safety checks for piece of mind!

In mine the optical sensor is the main one and is highly accurate.. the float is really just there as an additional fail safe.

If you want more pics and details check out my blog post on the build DIY Auto top off with optical sensor


----------



## Beer (Feb 1, 2012)

They've come down a bit since last time I looked at them. Last I knew they were $35+. That makes this a bit more reasonable and on par with contactor and timer control, with the possibility of adding more functionality to the board.


----------



## shift (Jan 7, 2013)

If you buy the clones they are <$10


----------

