Apex Solenoid Programming Help

reeferericb

Active Member
View Badges
Joined
Nov 1, 2020
Messages
308
Reaction score
196
Location
Hallsville
Rating - 0%
0   0   0
I’m trying to set up my solenoid valve to open and close based on the condition of two optical sensors. Right now the valve opens and closes when the lower sensor is open or closed (it’s not running until the top sensor closes). What did I do wrong? The time is there so that it only fills at night.

46143A27-C39A-4A5C-AF17-4EF6D7F84D84.jpeg
 

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,226
Location
Oregon
Rating - 0%
0   0   0
You need to remove the Set OFF command.

Since the Apex evaluates each condition in the program from top to bottom, and the last condition that's True sets the output state, the Set OFF will apply any time the If RO_Low OPEN Then ON line is false, so it doesn't wait until the RO_HI CLOSED condition is true.

Use this instead:

Fallback OFF
If RO_Low OPEN Then ON
If RO_HI CLOSED Then OFF
If Time 05:00 to 21:30 Then OFF

Read this FAQ about the appropriate use of the Set command:
 

Morpheosz

Active Member
View Badges
Joined
Apr 8, 2021
Messages
320
Reaction score
217
Location
Minneapolis
Rating - 0%
0   0   0
Just a bit of advice from someone who just had a minor flood with solenoid programming. I use this routine to fill my ATO reservoir with a solenoid when it hits the bottom and my optical sensor didn't close the very first time this routine triggered so it kept filling until it ran over my floor.

I added the "when on>" statement to make sure it doesn't keep running indefinitely if the sensor fails like mine did. Thankfully it was a cement basement floor with a drain and simply an ATO reservoir and not my tank! I also added a float valve so I'm doubly protected - fool me once, shame on me....

I would also suggest a defer command or two to make sure it's not going on and off every 2 seconds. Mine waits 10 seconds to make sure the sensor is solidly open before initiating, then it runs for 50 minutes as that's how long it takes to fill my reservoir. If you're using this to top your tank, I'd also set a min time off for 30 or 60 minutes or something like that so it's not constantly opening and closing every few seconds and wearing out your solenoid.

Fallback OFF
Set OFF
If RsvLow CLOSED Then OFF
If RsvLow OPEN Then ON
Defer 000:10 Then ON
Defer 050:00 Then OFF
When On > 060:00 Then OFF

This is what I use to top my tank:

Fallback OFF
Set OFF
If SumpLo OPEN Then ON
If SumpHi CLOSED Then OFF
If Output SumpMaint = ON Then OFF
If RsvLow OPEN Then OFF
When On > 003:00 Then OFF
Defer 000:10 Then ON
Defer 000:04 Then OFF
Min Time 030:00 Then OFF
 

When to mix up fish meal: When was the last time you tried a different brand of food for your reef?

  • I regularly change the food that I feed to the tank.

    Votes: 39 22.7%
  • I occasionally change the food that I feed to the tank.

    Votes: 59 34.3%
  • I rarely change the food that I feed to the tank.

    Votes: 54 31.4%
  • I never change the food that I feed to the tank.

    Votes: 16 9.3%
  • Other.

    Votes: 4 2.3%
Back
Top