Toggle Switch Box for Apex I/O Controls

Rick's Reef

Community Member
View Badges
Joined
Sep 20, 2017
Messages
54
Reaction score
59
Rating - 0%
0   0   0
I wanted to share a little Saturday project that was fun and also pretty useful to me. While I love the Apex Fusion interface on my phone, I wanted to have some simple switches when doing things around the tank to do certain things. My solution was to have a small project box with four push buttons and two toggle switches to trigger some feeding and maintenance “modes”.

My implementation looks like this:

IMG_7483.JPG


Red – Standard Feed – triggers “FeedA” on the Apex, kicks my 2 Vectra returns into Feed mode, turns off my 2 Gyres, sets my 2 Vortechs into Constant 10% and turns the skimmer off for 10 minutes

Blue – Turbulent Feed –triggers “FeedA” on the Apex and turns the skimmer off for 10 minutes (leaves wavemakers in normal mode)

Yellow – Target Coral Feed –triggers “FeedA” on the Apex, kicks my 2 Vectra returns into Feed mode, turns off my 2 Gyres, sets my 2 Vortechs into Constant 10% and turns the skimmer off for 60 minutes

Green – Broad Coral Feed – turns the skimmer off for 60 minutes (leaves returns and wavemakers in full mode)

Toggle1 – Wavemaker OFF – turns Gyres and Vortechs OFF.

Toggle2 – Storm Mode – Turns Gres on 100% and Vortechs to 80% constant

For most feeding, I use the Red mode. It idles the water flow and allows me to feed mysis, etc with the food sinking for shrimps, crabs, etc. I use Blue sometimes knowing only the fish are going to get the food and they have to go chasing around to earn their food. Yellow and Green I use for ReefRoids, MarineSnow, ReefChili, Phyto, etc. Here the skimmer is off for a longer period and whether the pumps are off depends on whether I am target feeding or not. Notice for all 4 of the feed modes the Vortechs are ON. This is because I have seen fish (my tailspot blenny) like to swim into the wet side of the MP40 and hang out when it is off. If I want completely still water (for coral target feeding, for example), I have Toggle1 to override the wavermaker settings. This allows me to only turn them ON when I know the wet sides are clear (and I keep a chopstick handy to coax a fish out if there is somebody chilling there). Lastly, “Storm” mode creates a lot of turbulence. I use this when I am turkey basting out detritus, algae cleaning or removing snail eggs or other gooberish stuff around the tank.

Now I feel obligated to share that I am the only one my house certified to use anything other than the primary Feed (red) button. It’s a shame really because my wife went through the one on one instruction and even sat for the certification exam. It looked like she was doing well on the multiple choice but when she got to the first essay question, she just rolled her eyes and walked out ☹. So sad, really…

One note on the Storm mode toggle…unfortunately this switch I did not wire correctly ☹. When I was looking at the pinout for the 8pin DIN connector I was actually looking at the mirror image so instead there is an I/O channel tied to ground and the ground is switched! I didn’t discover this until the connections were soldered and it wasn’t worth it to go back and open again. So in the Apex program logic this input is called “nSTORM” where the “n” stands for “active low”. I did this to remind me that this switch is backward from the rest and STORM mode is when the switch is “open” or a “0” as opposed to a “1”. What this means is that when I open this switch, there is no ground connection so none of the other switches work, but it did give me back 6 switches without re-soldering anything. And I would never use STORM mode with Feed mode anyway. And even if I did, if I trigger feed mode first and then threw the STORM mode, everything would work because the Feed/Skimmer modes have DEFER statements. Anyway, these details are probably off in the weeds...

With the overview covered, let’s talk about the project box. Here is what it looks like from different angles mounted and then inside:
IMG_7486.JPG

IMG_7487.JPG

IMG_7490.JPG


I got the project box on Amazon (Project Box Black). The push buttons and toggle buttons I had from various projects (also easily found on Amazon).

So, let’s look at what the Apex Software code looks like. Here is the list of inputs/outputs and virtual outlets:
upload_2019-1-16_19-32-26.png


BUTBLU, BUTRED, BUTYEL, BUTGRN are the 4 push buttons, WAVOFF and NSTORM are the Toggle switches. Pretty straight forward these are all input switches by name in the code below.

SKIMSHORTZZZ and SKIMLONGZZZ are virtual outlets. The Short is to trigger a 10-minute sleep and the Long is a 60-minute sleep. These are accomplished with defer statements.

The SkimShort program is:
Set OFF
If ButRed CLOSED Then ON
If ButBlu CLOSED Then ON
Defer 010:00 Then OFF​

The Long program is:
Set OFF
If ButYel CLOSED Then ON
If ButGrn CLOSED Then ON
Defer 060:00 Then OFF​

And then the skimmer code is:
Fallback ON
Set ON
If FeedA 005 Then OFF
If FeedB 005 Then OFF
If FeedC 060 Then OFF
If FeedD 005 Then OFF
If Output SW_Draining = ON Then OFF
If Output SW_Filling = ON Then OFF
If Output SkimShortZZZ = ON Then OFF
If Output SkimLongZZZ = ON Then OFF​

I don’t really use Feed B/C/D now since I use the push buttons. The SW_Draining/Filling outlets are used when doing water changes (I have a post about how I use PMUPs with optical sensors to do automated water changes).

The next virtual outlet is GYRESLEEP.
Set OFF
If ButRed CLOSED Then ON
If ButYel CLOSED Then ON
Defer 010:00 Then OFF​

And then my GYRE variable outputs (I use 2 IceCap modules to control the MaxSpect Gyre based on the variable outputs V1/V2 from the Apex controller):

GyreLeft_I2:
Set OFF
If Output VRT_DayL = ON Then C70
If Output VRT_DayM = ON Then C30
If Output VRT_DayLP = ON Then C90
If Output VRT_NightL = ON Then C50
If Output VRT_NightM = ON Then C30
If FeedA 000 Then OFF
If FeedB 000 Then OFF
If Output GyreSleep = ON Then OFF
If Output GYRETOGRIGHT = ON Then ON
If WAVOff CLOSED Then OFF
If nSTORM OPEN Then ON​

Gyre Code explanation:

The VRT_* controls are virtual outlets that have nothing to do with this project. Again, I use 2 IceCap modules to control my 2 MaxSpect Gyre 250s. I have kind of a swell cycle going where for about 60 seconds or so the Left Gyre is on (70% in the day, 50% at night) and then there is 10-20s burst “peak” at 90% in the day that doesn’t happen at night and then there is a “middle” phase where the left is at a low value as the right is ramping. The right Gyre runs a mirror image. The IceCAP/Gyre solution doesn’t really have a ReefCrest mode, so I implemented this instead based on what I saw over on a CoralVue help page.

Anyway – you can see that if the WAVOff toggle is thrown it overrides all except for STORM mode and then STORM mode will force to ON, which is 100%.

And then some code for my Vortechs:
MP40Left_7_1:
Fallback OFF
tdata 00:00:00,0,0,10,0,0,0,0,0,0,0,0,0,0
tdata 07:05:00,0,0,20,2,0,0,0,0,0,0,0,0,0
tdata 09:01:00,0,0,70,1,0,0,0,0,0,0,0,0,0
tdata 18:56:00,0,0,70,2,0,0,0,0,0,0,0,0,0
tdata 22:17:00,0,0,10,0,0,0,0,0,0,0,0,0,0
tdata 23:59:00,0,0,10,0,0,0,0,0,0,0,0,0,0
If FeedA 000 Then Slow
If FeedB 000 Then Slow
If Output GyreSleep = ON Then Slow
If WAVOff CLOSED Then OFF
If nSTORM OPEN Then VorC80​

For the Vortechs, the name here is left but it actually controls both. I could not for the life of me get my 2nd vortech sync to the WXM as a separate outlet. But then I decided I didn’t care…originally, I was going to sync/anti-sync these for the ReefCrest mode but decided it didn’t matter to me enough to go fix it. Like the GYRE, you can see I have WAVOff and nSTORM overrides and then I am just keying off of the GyreSleep to indicate that the wavemakers are off in certain feed modes but as I mentioned earlier I have an suicidal blenny and so when the Gyres are OFF the Vortechs actually are just Slow. Slow is just a profile that is “Constant 10%”.

And the last set is for triggering feed mode on my Vectra. I am still disappointing that EcoTech and Neptune are not playing well together on the Vectra like they do on the Vortech. I have 2 Vectra return pumps (redundancy) and want to control them both for feed mode (trickle output not just turning them off…because even though I have antisiphon valves to prevent backflow, if I take water flow to zero, I do get more gunk in the tank after the pumps are turned back on). To accomplish this, I have a virtual outlet VFEEDTIMER and a voltage output VECFEED_I4. This is implemented as follows:

VECFEED_I4:
Fallback OFF
Set OFF
If FeedA 000 Then ON
If ButRed CLOSED Then ON
If ButBlu CLOSED Then ON
If ButYel CLOSED Then ON
If Output VFeedTimer = OFF Then OFF​

VECFEED_I4 will trigger a high voltage output on one of the variable outs from the Apex controller whenever I want the main pumps to go into feedmode. The +/- from the variable output feeds into a relay device (available from Amazon here). What this relay does is go from open to close when the input voltage goes high. This state is then controlled by VFEEDTIMER, which is coded to stay in state for 5 seconds. The output from the relay is actually soldered into the “Feed” button on ONE of the Vectras. So when you drive an output on I4 it is going to look a 5 second feed button press on the Vectra controller. And since the 2 vectras talk to each other, they actually both go into Feed mode. (BTW, I didn’t expect this…I bought 2 relays thinking I would have to simulate a button press on both of them…I was pleasantly surprised when I setup the first oen and the second just worked. The downside is a second feed activation will cancel on only one of the Vectras but I never do this…well did it once and discovered how it works and decided I shouldn’t need to do it again :) ).

VFEEDTIMER:
Set ON
If FeedA 000 Then OFF
Defer 000:05 Then OFF​

Here is a shot of the relay to trigger the Vectra Feed mode:
IMG_7485.JPG

You blue cable you see is an ethernet cable that is plugged into the V3/V4 outlet on the Apex. The orange/white wires at the top of the green relay board are the +/- outputs from V4 from the ethernet cable. The white wires on the downward end of the relay board are routed up through a small hole in the EcoSmart controller for one of the Vectras and then I soldered this directly onto the board contacts to simulate pushing the Feed button. (This was not my idea, by the way, I shamelessly copied a DIY solution from someone on ReefCentral so if interested you could go over there and a quick search on Vectra pumps should find it for you).

Whew! Okay that was a much longer post than I planned. I hope someone reads it to this point and got something out of it. As I mentioned above, I am still using 2 PMUPs with optical sensors to accomplish water changes. But I am also finding that sometimes I just want to add/drain water on a continuous basis. To do this, I use the ApexFusion and manually set the Draining/Filling outlets that supply the PMUPs. But still this requires my phone, it requires the phone to stay unlocked, etc. So, I am considering added 2 toggle switches underneath by the sump that would allow me to override and add/drain water either at the same time or separately. For example, when I get new corals and I am driplining into a bucket to acclimate, I can just throw the FILL switch and add water to the sump as I drain (I keep ~30g of saltwater ready always). The downside is I can see a child (or uncertified adult!) flipping one of these switches when they shouldn’t! I might add 2 toggles to do this on a future Saturday, but if I do I will definitely add override logic (if sump low/high float switch triggers then halt the fill/drain…actually I may have this code already implemented but I never tested it).

Anyway, happy reefing!
Rick

upload_2019-1-16_19-32-26.jpeg
 

Bubbles, bubbles, and more bubbles: Do you keep bubble-like corals in your reef?

  • I currently have bubble-like corals in my reef.

    Votes: 13 36.1%
  • I don’t currently have bubble-like corals in my reef, but I have in the past.

    Votes: 5 13.9%
  • I don’t currently have bubble-like corals in my reef, but I plan to in the future.

    Votes: 13 36.1%
  • I don’t currently have bubble-like corals in my reef and have no plans to in the future.

    Votes: 4 11.1%
  • Other.

    Votes: 1 2.8%
Back
Top