Water mixing and auto water change with redundant failsafes

DanP-SD

Active Member
View Badges
Joined
Jan 4, 2014
Messages
152
Reaction score
158
Location
San Diego, CA
Rating - 0%
0   0   0
Greetings fellow reefers. I’m building out a new large reef tank and, in the past few days, turned my attention to programming a salt mixing and water change routine. I’ve done automatic water changes before and Apex has made it pretty simple to program a basic automatic water change but I wanted additional automation and failsafes for this system. I’ve come to subscribe to the firm belief that everything that can go wrong eventually will on a reef so I try to design backups to backups for every week point. I’m posting what I worked up for this installation for two reasons: 1) in case it helps any fellow reefer looking to do something similar (and saves you the hours I spent this past weekend debugging my first few approaches); and 2) in case anyone sees a weakness in my approach I’ve overlooked. If you do, please comment with any suggestions to improve it.

In terms of basic setup, the display tank (260 gallon) sits in a room against a wall to the garage so the sump and most support gear is in the garage right next to a hose bib (got lucky with that). So my RO/DI system, RO reservoir and salt water reservoir (each 80 gallons) are all right next to the sump. Here’s a picture of the basic layout:

IMG_8179.jpg

I’ve already set up a basic auto top off system with a Tunze Osmolator, and installed a barrel-tender system (Buckeye Hydro) to refill the RO reservoir when it gets low without constantly cycling the RO/DI filter and magnifying the effects of TDS creep. The focus of this project was to program auto water changes in a smart way that pauses when salt water needs to be added and doesn’t resume until salinity is confirmed.

For the water change system, I have several goals/needs for the design. It needs to

  • perform small daily water changes with little to no intervention;
  • have the ability to perform on-demand larger water changes
  • have high reliability
  • have redundant failsafe features, including:
  • won’t attempt an auto water change if my saltwater reservoir is running low
  • won’t automatically reactivate water changes if the saltwater reservoir is refilled until I mix the salt and confirm salinity
  • has multiple indicators to alert me when its time to mix a new batch of saltwater
I’ve designed the basic system and plan to test it for a while using two different devices to do the actual water moving – first, an Apex DOS QD and then a homemade dump-bucket system. Depending on how each performs, I’ll pick one for the final system. I started with the DOS.

In terms of hardware, the setup is pretty straightforward. In the picture above, the right reservoir is for RO/DI water. The RO unit feeds directly into that reservoir. The solenoid sitting right above the reservoir is part of the Buckeye Hydro barrel tender system that reduces TDS creep. I have a pump inside the reservoir that feeds the red PEX lines above. By turning the three ball valves on top, I can send that water either 1) through the wall into the display room to fill three dosing reservoirs in a cabinet next to the display tank; 2) into the saltwater reservoir; or 3) into the open tube in front, which I can use to pull a bucket of DI water or can connect to a longer hose to refill the ATO reservoir on my quarantine tank on the other side of the garage.

The left reservoir is the saltwater mixing reservoir. It has a couple powerheads that are always on. They are placed below the lowest level I let the reservoir drain to. There’s also a pump that feeds the PEX line coming out of the left side of the reservoir. I can use this to either add saltwater to the sump if I ever do a manual water change or can divert it to other destinations (like a bucket or hose to get it to my QT).

Ideally, I would have liked to elevate the saltwater reservoir and used a sloped bottom reservoir so I could periodically drain it entirely but this setup fit my space better. From time to time, the salt reservoir will accumulate nutrients or even algae and need to be thoroughly cleaned. I can manage it manually but the ability to fully drain it would be an improvement.

Sitting above the salt reservoir is the DOS that will do the water changes with tubes connected from the reservoir, to the sump, from the sump and to the drain. Setting up a DOS to do basic automatic water changes is relatively straightforward and there was a lot of good information out there on doing it. By far, the simplest approach is to just install it and run the Automatic Water Change Task in Apex Fusion. It walks you through the entire process pretty quickly and does the hard work. But this won’t provide the redundancy and other features I’m looking for. I wanted to try the Task Wizard so I started with this approach and found the Apex interface well thought out and easy to follow. Very quickly, it was set up to do automatic 4-gallon water changes each day.

For the additional features described above, a few more pieces of hardware and a fair amount of additional code is required. The hardware needed includes a breakout box, a momentary button to serve as an input to the BoB, two liquid level sensors (these can be the Apex optical sensors or float sensors), and two LED lights (I used the Adaptive Reef two-light module).

The logic of the system is as follows: When the saltwater reservoir is full of saltwater mixed to the proper salinity, all systems will be in “go” mode and the DOS will perform its water changes per whatever volume and timing is programmed in the Task Wizard. A green LED light mounted near the mixing station will be illuminated to show, at quick glance, that the system is working properly.

IMG_8182.jpg

Two optical monitors (or floats) are installed in the saltwater reservoir – one low and one high. As the saltwater gets consumed and drops below the high sensor, nothing changes, but once it drops below the low sensor, the water changes are suspended, the green light turns off, a red light turns on and Apex sends me an alert that the saltwater reservoir is low.

The system remains in this suspended mode until I mix up new saltwater. I haven’t found it practical to automate the actual mixing of saltwater so this is my one manual step. In my case, that means opening a ball valve and activating a pump to transfer water from the RO reservoir to the saltwater reservoir, adding salt, waiting for it to mix, and fine tuning salinity. Once I confirm the saltwater is ready, I press a momentary button. The red light turns off; the green light turns on; the DOS resumes auto water changes.

IMG_8181.jpg

I usually mix about 70 gallons of saltwater and the low sensor is around the 8 gallon mark, so at 4 gallons per day, this gets me about two and a half weeks.

For the programming, I created three virtual outlets. One is labeled NSW_Ready and acts as the final input to the hardware confirming all systems are go. One is labeled Hi_SW_VO (for high saltwater virtual outlet) and one is labeled Moment_VO (for momentary button virtual outlet).

The momentary button is wired to the breakout box and labeled NSW_OK. The LED lights are labeled GRN_LED and RED_LED. The Dos is labeled DOS_ADD and DOS_REMOVE as suggested by the task wizard. The optical level sensors are labeled NSW_Hi and NSW_Lo.

Here’s the code for each virtual outlet and the physical devices:

Virtual Outlets:

NSW_Ready

Set OFF
If Output Hi_SW_VO = ON Then ON
If Output Moment_VO = OFF Then OFF
If Output Moment_VO = ON Then ON
If NSW_Lo OPEN Then OFF

HI_SW_VO

Set OFF
If NSW_Hi OPEN Then OFF
If NSW_Hi CLOSED Then ON

Moment_VO

Set ON
If Output NSW_Ready = OFF Then OFF
If NSW_OK CLOSED Then ON

The effect of these programs is to allow multiple conditions to control when the NSW_Ready Virtual Outlet turns on and gives the system the all clear. The last line under the NSW_Ready code means that any time the low level sensor is dry, the outlet will turn off. For it to switch back on, it needs to check the HI_SW_VO outlet, which tracks the status of the high-level optical sensor. If that sensor is wet, the HI_SW_VO outlet will activate. The NSW_Ready outlet will read that and switch to on unless the next lines of code stop it. Then the NSW_Ready outlet checks the status of the momentary button. If I haven’t pushed it, which I do only when the saltwater is ready, the outlet stays off. If it have pushed it, it confirms the low optical sensor is wet before turning on.

The last line may seem unnecessary because, if the high sensor is wet the low must be as well. But it’s an important line because it is what causes the outlet to turn off when the reservoir is low.

The code for the Moment_VO outlet took a bit to figure out. Initially I had

Set OFF
If NSW_OK CLOSED Then ON

This had the effect of reactivating water changes and turning the LED green when I pressed it, but as soon as I released it, everything went back to off/red. Switching the set to ON fixed that and the line “If Output NSW_Ready = OFF Then OFF” provides an alternative way to turn this outlet off at the right time.

Physical Devices:

GRN_LED

If NSW_Ready = ON Then ON
If NSW_Ready = OFF Then OFF

RED_LED

If NSW_Ready = ON Then OFF
If NSW_Ready = OFF Then ON

The momentary button doesn’t need any code. It’s just an input.

For the DOS_ADD and DOS_REMOVE, I used the Auto Water Change Task to schedule 4 gallons of water per day. To suspend water changes when the saltwater reservoir is low, I added a line of code to each: If Output NSW_Ready = OFF Then OFF. To add this code, from the table view:

Picture1.png

Click on the fourth black button from the top left to switch to code view:

Picture2.png

Add the off command after the tdata line. Leave everything else as is. And don’t forget to upload the new code.

The last task was to program an alert that notifies me when the saltwater is low. This just required adding “If Outlet NSW_Ready = OFF Then ON” to the email alarm virtual outlet.

That’s it. I’ve tested each input variable and condition I could think of and everything seems to work as planned.

I plan to track salinity drift with the DOS for a few weeks and then set up the dump bucket system. That will require a lot of additional programming, which I’ll post in a later update. Then I’ll compare how each system performs.
 

Formulator

Valuable Member
View Badges
Joined
Apr 14, 2024
Messages
2,481
Reaction score
2,585
Location
Saint Louis, MO, USA
Rating - 0%
0   0   0
Nice work! I love the design and you obviously put a lot of thought into it. A few suggestions for you to consider based on my experience with a similar setup and apex:

1. Put a float valve on every container with automated filling. A mechanical fail-safe is the ultimate piece of mind IMO.

2. Add defer statements to everything you are filling or topping off with an optical sensor. Optical sensors are especially prone to cycling on/off rapidly when the water level is just at the crossover point between open/closed state. The defer statement will tell the outlet to wait until the sensor has been consistently open or closed for x seconds. I use this on mine for 5 and 20 second delays:
Defer 000:05 Then Off
Defer 000:20 Then On

3. Add a “When On [time] Then Off” statement. This is another fail-safe which will switch the outlet completely off and stop automation until you intervene. It is most useful for ATO pump outlet where you know yoir ATO should not be running longer than a few minutes at a time. If it gets stuck on for longer than the preset time in that line of code, it shuts off and you will have to go find out what happened and switch the outlet back to “auto” once the issue is corrected (usually a leak or empty reservoir).
 
OP
OP
D

DanP-SD

Active Member
View Badges
Joined
Jan 4, 2014
Messages
152
Reaction score
158
Location
San Diego, CA
Rating - 0%
0   0   0
Great suggestions. I do have a float valve on the RO line to the RO reservoir. It’s above the hi level sensor so it has never been used but it’s there just in case. I should add a hi-water sensor to the sump that turns off all water-moving devices other than my return pumps plus the skimmer and clarisea rollers.

For that sensor, a defer statement would be necessary. I didn’t add such a statement to the code for optical sensors in my saltwater reservoir because the only time it matters is when I manually push the momentary button to confirm the saltwater is ready. The water is calm at that point and then the system only reads them for one instant. When the water level drops to the low level sensor, it’ll shut the entire AWC system off the first time the sensor shows as dry and won’t come back on if it then splashes around to a wet state because the code needs to see the high sensor as wet and the momentary button pressed to reactivate AWCs.

The When ON [time] Then OFF is interesting. I’ve never used that approach. My ATO is the Tunze Osmolator and runs independent of Apex so I can’t work that in there (I think) but I’ll definitely use this when I install the dump bucket system.
 
OP
OP
D

DanP-SD

Active Member
View Badges
Joined
Jan 4, 2014
Messages
152
Reaction score
158
Location
San Diego, CA
Rating - 0%
0   0   0
If one of the destinations is your sump or tank, I think it’ll be difficulty to monitor that with a level sensor. You could try a Neptune 1/4 flow meter on each line but it seems like an unnecessary complication.

I’m currently monitoring it on the setup above by testing salinity daily. Unfortunately, it seems to be creeping up. I think the issue is a variance between calibrating the apex with both heads moving forward and then Apex using the right head in reverse for AWCs. I plan to flip that, reverse the tubes on the right pump and recalibrate to see if that fixes it.

I also see some air in one line so I need to move one of my intake hoses to a less bubbly part of the sump.

I think that once you set yours up and get it dialed in, you could use salinity as a gauge for how it’s working.
 
OP
OP
D

DanP-SD

Active Member
View Badges
Joined
Jan 4, 2014
Messages
152
Reaction score
158
Location
San Diego, CA
Rating - 0%
0   0   0
Neat!

What are the main fears about an automatic water change system screwing up?
I think it depends on your setup. Two of the biggest concerns are:

1) the AWC pumping saltwater out of the sump after the replacement SW reservoir is dry. This could happen if, for example, you fill the SW reservoir before leaving on a trip and it empties before you return and refill it, or you just forget to fill it. If you have an ATO, the ATO will fill the sump with freshwater and drop salinity -- potentially a lot. A major salinity drop can be catastrophic, so I think this is a risk that has to be protected against.

2) the AWC coming back on when the SW reservoir is refilled but before the salinity is adjusted. This would likely be due to: user error (you fill the reservoir, dump in salt and forget to come back and check and adjust salinity) or a programming error (you add RODI water to the saltwater reservoir, the AWC system detects the level and starts doing water changes again before you've confirmed the salinity). This could result in a salinity drop or increase depending on the salt level in the make up water when it's pumped into the sump. Again something to be avoided.

The program I described above is pretty effective at preventing either of these scenarios and is designed to be pretty dummy proof (I know what I'm capable of forgetting to do a year into maintaining a tank).

An AWC could also overflow your sump if the add pump stays on and the remove pump stops working. In my setup the only failsafes I have against this are: 1) that, once the reservoir empties, the AWC will turn off; and 2) if the AWC puts too much water into the sump, it'll be salinity-adjusted water so it won't crash my tank. With an 80-gallon reservoir and a 60-gallon sump, my sump could conceivably overflow by a lot. I'm ok with that risk because it's in the garage on an epoxy-sealed floor that slopes toward drainage and the wet floor would be a quick alarm there is something wrong. I have an additional optical sensor I intend to use as a high-level sensor in the sump but haven't programmed it yet. I also considered adding a high drain to the sump but think it may cause more problems than solutions. For example, if water hits that drain during maintenance when my sump level is high, it'll have the effect of removing SW and then, when the pumps are back on, the ATO will replace it with RODI. So, for my setup at least, I haven't put that drain in.

For anyone with a sump inside the house, I would think preventing an overflow would be paramount, so doing all of the above would be advisable -- and adding a leak detector to turn off the ATO and AWC as well.

As I noted in the write-up, this design is phase one of a test. In a month or two, I plan to take the DOS offline and replace it with a dump bucket system that will change out about 7-8 gallons in a few minutes. I've designed it (mostly) and am optimistic it'll keep salinity more stable than the DOS but I'll run each system a month or two and will compare results before deciding which one stays. That system also provides some additional failsafes in its design.
 

HAVE YOU EVER KEPT A RARE/UNCOMMON FISH, CORAL, OR INVERT? SHOW IT OFF IN THE THREAD!

  • Yes!

    Votes: 32 45.7%
  • Not yet, but I have one that I want to buy in mind!

    Votes: 9 12.9%
  • No.

    Votes: 26 37.1%
  • Other (please explain).

    Votes: 3 4.3%
Back
Top