Auto Top Off with the Apex REVISITED

Clubbinaz

New member
So I decided to unplug the Tunze Osmolator and take a stab at programming an Auto Top Off using a couple of float switches and the break out box for the Apex.

Step 1: Plug in the Break Out Box into the PM2 Module

Step 2: Wire up float switches.
On the break out box there are 6 switch positions and one ground. Each sensor has two wires where one would go to the ground and the other to the cooresponding number that you want to use. Use switch value 1 for the main (bottom On/Off Switch) and switch value 2 for the backup shut off switch.

Step 3: Create two virtual outlets.
This can be accomplished by going to the Apex web interface
CONFIGURATION - MODULE SETUP
From there you will want to setup a DC4 Module which will create 4 virtual outlets for you to use. The default location is the A locaion so you will probably create 4 virtual outlets labled xxx_A1, xxx_A2, etc...

Step 4: Go into your new virtual outlet xxx_A1 by going to CONFIGURATION - OUTLET SETUP and rename it to what ever you want your on/off float switch (the bottom one) to be named plus "x5_1". so if you name it Switch1, then your syntax for the outlet will be Switch1x5_1

Step 5: Go into your next new virtual outlet xxx_A2 by going to CONFIGURATION - OUTLET SETUP and rename it to what ever you want your backup float switch (the top one) to be named plus "x5_2". so if you name it Switch2, then your syntax for the outlet will be Switch2x5_2

Now that you have the virtual outlets created, let's program them to do what we want.

Step 6: Go back into yor first Virtual Outlet , in my example it's called Switch1x5_1.

Change the control type to ADVANCED and insert the following code

Fallback OFF
Set OFF
OSC 000:00/000:10/059:50 Then ON
If Switchx5_1 CLOSED Then OFF
If Switchx5_1 OPEN Then ON


Now let's take this code apart and explain what each line means.
Fallback OFF <~ This means that if there is some interruption like power dies it automatically shuts down as a default. So even if its running and the power dies on that unit, it shuts off the pump. This is a very good thing !!

Set OFF This literaly just makes sure it starts in the OFF position and is not ON

OSC 000:00/000:10/059:50 Then ON <~ Because this code comes after the Set OFF command it will run after that command since the programming logic for the APEX is linear in thinking. This is just another redundent backup process. This states that even if the float switches fail, he pump will NOT run for more than 10 seconds in any given hour period. Also, if it runs for 10 seconds and the Switchx5_1 is still OPEN, it will not continue to fill until the 59:50 has lapsed. This works for my system just fine because of the speed of my pump, you may want to adjust that for your best results, but at least you will understand what it means.

If Switchx5_1 CLOSED Then OFF If the circut for the bottom (on/off Switch) is closed then the outlet is OFF. This is important so that the pump which will eventually be controlled by the two virtual outlets that we are setting up will be OFF when the circut is closed.

If Switchx5_1 OPEN Then ON If the circut for the bottom (on/off Switch) is open then the outlet turns ON. This means that when the water level drops the sensor to the open position it will turn on the pump.

These two lines of code working together simply mean that when the water drops and OPENS the circut it will turn the outlet (connected to the pump) ON and it will continue to run for 10 seconds or until the water raises up enough to CLOSE the circut.

Step 7: Go into your next virtual outlet that we just created probably named Switch2x5_2 and change the control type to advanced. Once you have the box for the code open enter the following code

Fallback OFF
Set OFF
If Switchx5_2 OPEN Then ON


Now I'm not going into detail about this logic since I pretty much explained the first outlet in detail but you will notice that something does look alittle strange. Particulary in the line If Switchx5_2 OPEN Then ON. This seems a little backwards from the other outlet and there's a perfectly good reason as to why. I have this float sensor mounted upside down so I can get it to the correct location in my sump for the backup water sensor to do it's job.

Tip:: turn off your return pump and make sure this switch is above where your water level is with alll equipment off or your alarms will be blazing constantly.

Step 8: Now that we have the logic and programming done, which really wasn't that hard people, we need to apply it to a real outlet on the energy bar. So what ever outlet you plan on using for your top off pump needs to be programmed to utilize the virtual outlets we just created.

For this example we will use outlet number 7 which I will now go into by going to CONFIGURATION - OUTLET SETUP, selecting outlet xxx_7 and renaming it to TopOff_7 so I know which one it is. Now Im going to change my Control Type to Advanced and insert the following code.

Fallback OFF
Set OFF
If Switchx5_1 OPEN Then ON
If Switchx5_1 CLOSED Then OFF
If Switchx5_2 OPEN Then OFF


So let's take a look at each line once again starting with the IF statements.
If Switchx5_1 OPEN Then ON Well we used that first virtual outlet to handle the actual water level on/off action. So when that switch is OPEN the pump is ON and when the water level rises enough to close the switch then the Pump will turn OFF.

As a back up we also have it in there that if the Backup second switch becomes OPEN because the water level raised way up, then the Pump needs to turn off.

Well that's about it for the Automatic Top Off setup for my Apex. Using this code and logic you can create a redundent system that is reliable and accurate. I have three failsafes to protect against an overfill. They are the bottom On/Off Switch, The Backup Switch and the Oscillation timer of only 10 seconds per hour. Between these three options, it's very very very unlikely that a problem will occur.

Oh yea, and now Im selling my Osmolator if you know anyone interested. It's only 6 months old and works great.

PS: I also have another backup on my personal system. I utilize the conductivity probe and I use my top off to monitor Salinity in my system. If my salt drops, it stops topping off and if it goes up, it adds extra fresh water to regulate at 35 ppt.

Goodluck

Darren
 
Heres the picture of the switch placement in my sump
picture.php
 
Question...

You refrence : Switch1x5_1

but in the bottom you only reference Switchx5_1

Just making sure I am not missing something.
 
Im sure you have heard of issues with the cond probe errors causing too much fresh water to be added?? Dont know the details myself, Russ ect can chime in
 
As far as the conductivity probe is concerned, it is just another safety in the many backups on the ATO program. I can't see how the conductivity probe could cause and overfill since it has to qualify the rest of the programming in order to become a "valid" argument and turn on the outlet.

For Instance,

In order for the ATO to even turn on from the Salinity the lower float switch (Switch1x5_1) needs to be OPEN and (Switch2x5_2) the back up upper float switch needs to be CLOSED <~~ because it's upside down and always open. Then and only then could the salinity probe even turn on the ATO and only for 10 seconds per hour. So NO, I don't think it can be an issue IF you use this kind of programming logic.
 
Yeah unless you had a auto drain with the ato to regulate the salinity.

But I would be more worried something would get stuck in that one.

That would almost be an alarm

if salinity > x then alarm
defer 30:00
 
As an Email from the guys over at Neptune Systems, here's an update to the code.

Since the Virtual Outlets only have a known State of ON or OFF, you don't need the OSC code in the virtual outlet 1 that was created, you need to add that OSC statement to the actual power bar outlet , in the example was TopOff_7.

ALSO, if you would like to throw in a statement to have your ATO run for a specific number of seconds after it is triggered to turn on by the low (on/off) float switch, you can add the Min command to the TopOff_7 outlet so the code would look like:

Fallback OFF
Set OFF
OSC 0:00/0:10/59:50 Then ON
If Outlet Switchx5_1 - OFF Then ON
If Outlet Switchx5_2 - ON Then OFF
Min Time 0:07 Then ON <~~ This tells it to run for a minimum of 7 seconds when it turns on.

I was seeing my ATO only run for 3 seconds as the float switch just barely broke the plane from off to on, so by adding the minimum time in there, I can essentially overfill , a bit, so the ATO doesnt try to run so often.
 
Last edited:
That brings up another good point,

As my APEX is setup with various Email alarms that actually send my phone a text message when ever triggered, I added the High Float Switch to my Alarm so in the event of that high water I will be notified.

Under Outlets you will have an outlet probably named "EmailAlm_I5" . I don't know if the location I5 will be the same but since it's a base outlet, it probably would be. In that outlet you can setup various alarms that are of course explained throughly in manuals everywhere, but sometimes seeing it is a little easier.

Set OFF
If Temp_5 > 80.2 Then ON
If Temp_5 < 73.0 Then ON
If pH > 08.50 Then ON
If pH < 07.90 Then ON
If Salt < 34.80 Then ON
If Salt > 35.50 Then ON
If pH2 > 06.80 Then ON
If pH2 < 06.10 Then ON
If Power Apex Off 000 Then ON
If Switchx5_2 OPEN Then ON <~~~ this is the argument that tells the email alarm to notify me in the event that that high level float is activated
 
Here's my very much working top off code

TOPOFF OUTLET
Fallback OFF
Set OFF
OSC 000:00/000:10/059:50 Then ON
If Switchx5_1 OPEN Then ON
If Switchx5_1 CLOSED Then OFF
If Switchx5_2 OPEN Then OFF
Min Time 000:07 Then ON

Virtual Switchx5_1 <~~ The main on/off switch , or the bottom one
Fallback OFF
Set OFF
If Switchx5_1 CLOSED Then OFF
If Switchx5_1 OPEN Then ON
If Salt < 34.9 Then OFF

Virtual Switch5_2 <~~ backup high water switch
Fallback OFF
Set OFF
If Switchx5_2 OPEN Then ON
 
Club - looks good but a couple of points. First, Fallback has no effect on anything other than physical outlets. It is not used on virtual outlets at all. Second point, in your Topoff outlet, the oscillate generates both ON and OFF commands. There's no reason for the Set statement since the oscillate is going to essentially do one or the other based on its cycle.

Neither hurt but just wanted you to understand their role.
 
The latest code posted is not "fully working", and is nearly as problematic as the original code posted here.
TOPOFF OUTLET
Fallback OFF
Set OFF
OSC 000:00/000:10/059:50 Then ON
If Switchx5_1 OPEN Then ON
If Switchx5_1 CLOSED Then OFF
If Switchx5_2 OPEN Then OFF
Min Time 000:07 Then ON
The Set OFF is ineffective in the code above. The Set OFF will never come into play because the next statement is an OSC statement - OSC includes both explicit ON and OFF states, so the prior statement will never be used. Harmless, but not clean programming.

The real issues are next... the two If Switchx5_1 statements together make the OSC statement useless; Switchx5_1 will always be either CLOSED or OPEN, therefore these statements will totally override the OSC at all times. Plus, the two virtual outlets are not used by the real outlet, so they do not serve the intended (or any useful) purpose.

Clubbinaz, I think you may have confused yourself by naming the VOs the same as the switches. I strongly suggest using names for outlets which avoid ambiguity and are more descriptive, such as "Sump_Low" and Sump_High" for your 2 virtual outlets.


In the original post, this statement was made:

Fallback OFF
 
Last edited:
Ok, here's the update from Neptune Systems

TOPOFF OUTLET
Fallback OFF
Set OFF
OSC 000:00/000:10/059:50 Then ON
If Outlet Switchx5_1 = Off Then Off
If Outlet Switchx5_2 = On Then OFF
If Salt < 34.9 Then Off
Min Time 000:07 Then ON

Virtual Switchx5_1 <~~ The main on/off switch , or the bottom one
Fallback OFF
Set OFF
If Switchx5_1 Open Then On
If Switchx5_1 Closed Then Off


Virtual Switch5_2 <~~ backup high water switch
Fallback OFF
Set OFF
If Switchx5_2 OPEN Then ON

I got rid of the Salt statement from the Virtual outlet and moved it to the EB8 outlet, also the statement for the EB8 Outlet changed a bit to better tell what to do from the virtual outlets.
 
I see your point

I see your point

The latest code posted is not "fully working", and is nearly as problematic as the original code posted here.
TOPOFF OUTLET
Fallback OFF
Set OFF
OSC 000:00/000:10/059:50 Then ON
If Switchx5_1 OPEN Then ON
If Switchx5_1 CLOSED Then OFF
If Switchx5_2 OPEN Then OFF
Min Time 000:07 Then ON
The Set OFF is ineffective in the code above. The Set OFF will never come into play because the next statement is an OSC statement - OSC includes both explicit ON and OFF states, so the prior statement will never be used. Harmless, but not clean programming.

The real issues are next... the two If Switchx5_1 statements together make the OSC statement useless; Switchx5_1 will always be either CLOSED or OPEN, therefore these statements will totally override the OSC at all times. Plus, the two virtual outlets are not used by the real outlet, so they do not serve the intended (or any useful) purpose.

Clubbinaz, I think you may have confused yourself by naming the VOs the same as the switches. I strongly suggest using names for outlets which avoid ambiguity and are more descriptive, such as "Sump_Low" and Sump_High" for your 2 virtual outlets.


In the original post, this statement was made:

Fallback OFF


What if I move the OSC statement underneath the two switchx5_1 and leaving it above the Switchx5_2 command for all off if it opens? That would allow the switchx5_1 to be turned on then the oscillation would run until the switchx5_1 closes but no matter what the back up high water x5_2 would still be in play if it opens then all shuts off.?

Fallback OFF
Set OFF
If Switchx5_1 OPEN Then ON
If Switchx5_1 CLOSED Then OFF
OSC 000:00/000:10/059:50 Then ON
If Switchx5_2 OPEN Then OFF
Min Time 000:07 Then ON
 
Nope, that won't work. OSC includes explicit ON and OFF states, and will completely override any previous statements.

And you still are not using the VOs.
 
Hey Russ, Im a little confused,

Here's the way it was given to me from Paul at Neptune Systems

TOPOFF OUTLET
Fallback OFF
Set OFF
OSC 000:00/000:10/059:50 Then ON
If Outlet Switchx5_1 = Off Then Off
If Outlet Switchx5_2 = On Then OFF
If Salt < 34.9 Then Off
Min Time 000:07 Then ON

Virtual Switchx5_1 <~~ The main on/off switch , or the bottom one
Fallback OFF
Set OFF
If Switchx5_1 Open Then On
If Switchx5_1 Closed Then Off


Virtual Switch5_2 <~~ backup high water switch
Fallback OFF
Set OFF
If Switchx5_2 OPEN Then ON


This program seems to also be working as it has been running now since 09/21/2012. Are you saying that this program is OSC every hour before the rest of the code has a chance to be met, if that were the case, wouldn't my pump turn on for 10 seconds every hour?
 
Your second example (the Neptune one) is right. The one in post #15 is different and is wrong as Russ pointed out. And you still need to rename your virtual outlets to make them unique. They don't make it wrong, just confusing.
 
Just an FYI, if you flip the float over on your switch it reverses the way it works IE NO/NC. This way even though your bottom switch is mounted upside down you can still make it function the same as the top float.
 
Awesome thread, just want to throw in there I had some trouble getting it to work. I then did some research and found out in the format "SwitchX_Y" that the X value is the number assigned to the module by the apex unit (Configuration --> Module Setup --> look at the address number of your module). Then the Y value is the number on the breakout box corresponding to the input (1-6)
 
Back
Top