Apex Solenoid to Fill RO container

m.kristoff

Well-Known Member
View Badges
Joined
Sep 17, 2021
Messages
693
Reaction score
278
Location
cleveland
What state or country do you live in
Ohio
Rating - 100%
8   0   0
I have a 50 Gallon container that I plan to use to store RO Water.
My plan is to Automatically fill it using an FMM, optical sensor and an Apex solenoid.
I have the solenoid connected to the water supply line for my RO
I put an optical sensor at the full level on the container. I'm only using 1 optical sensor
I set up the 24v accessory on my FMM

for the configuration I set it to:
Fallback OFF
If AWC_H OPEN Then ON
If AWC_H CLOSED Then OFF
Defer 000:10 Then ON

As of now the solenoid is open and letting the container fill- I would hope that once the optic gets wet, it should close the solenoid to stop water

Am I missing anything? is there a better way to do it?

I also setup a float valve to shut down the RO as a backup

RO fill.jpg
 
I did nearly the same build except I was timing the fill with a defer 50 min then off. However the very first time it hit the low sensor it started filling but that sensor didn’t register closed again so it just kept filling never triggering the 45 min timer. What I ended up doing is putting a “when on” statement to make sure it didnt stay on longer than an hour without erroring and shutting off. I also added a cheap float valve to the top as extra insurance. Long story short, I wouldn’t trust the upper sensor to always work. Time how long it takes to fill and put a when on statement to make sure it doesn’t go much longer and consider a float valve for extra insurance.

This is my config for the 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
Min Time 999:00 Then OFF
 
I'm wondering if adding a 2nd Optical sensor lower would be a smart move.
I would set it up in this order
A lower sensor around 5" from the top
A float valve
And then Upper sensor
that should cover all the bases
 
The problem with using a single sensor is that it's going to constantly try to refill the moment the water goes below the sensor. So it's going to turn on and off within minutes, and that will be bad for your RO/DI system.

The general best practice is to place a 2nd sensor at the bottom of the container, so it only turns on when the container is nearly empty and fills until the water reaches the top sensor.
 
I did nearly the same build except I was timing the fill with a defer 50 min then off. However the very first time it hit the low sensor it started filling but that sensor didn’t register closed again so it just kept filling never triggering the 45 min timer. What I ended up doing is putting a “when on” statement to make sure it didnt stay on longer than an hour without erroring and shutting off. I also added a cheap float valve to the top as extra insurance. Long story short, I wouldn’t trust the upper sensor to always work. Time how long it takes to fill and put a when on statement to make sure it doesn’t go much longer and consider a float valve for extra insurance.

This is my config for the 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
Min Time 999:00 Then OFF
For your code, you need to remove the Set OFF command. In order to keep the pump running only when the low sensor triggers it, you need to rely only on the lower and upper sensors to turn on and off. The Set OFF command will turn off the solenoid as soon as the lower sensor detects water, so it will never reach the upper sensor.
 
The problem with using a single sensor is that it's going to constantly try to refill the moment the water goes below the sensor. So it's going to turn on and off within minutes, and that will be bad for your RO/DI system.
that makes sense.

what would my statement look like?
I was thinking that i would install a sensor halfway down in the container so its never empty.
I would expect the top sensor to turn it off.

If AWC_L OPEN Then ON= sensor halfway down dry, turn on water
If AWC_H CLOSED Then OFF= sensor at the top
Defer 000:10 Then ON
 
that makes sense.

what would my statement look like?
I was thinking that i would install a sensor halfway down in the container so its never empty.
I would expect the top sensor to turn it off.

If AWC_L OPEN Then ON= sensor halfway down dry, turn on water
If AWC_H CLOSED Then OFF= sensor at the top
Defer 000:10 Then ON
This is the code normally used for filling a reservoir:

Fallback OFF
If AWC_L OPEN Then ON
If AWC_H CLOSED Then OFF

You can optionally add a Defer ON and Defer OFF delay to avoid false readings due to simple ripples on the water surface:

Defer 000:10 Then ON
Defer 000:10 Then OFF

You can also add a When timer as a failsafe in case the upper sensor fails, but you'd need to know the average time it takes to fill completely, then add a few minutes to that duration for the When timer.

When On > 360:00 Then OFF

Read my tutorial on Apex Timers for more details on these commands: https://www.reef2reef.com/ams/neptune-apex-programming-tutorials-part-2-timers.689/
 
This is the code normally used for filling a reservoir:

Fallback OFF
If AWC_L OPEN Then ON
If AWC_H CLOSED Then OFF

You can optionally add a Defer ON and Defer OFF delay to avoid false readings due to simple ripples on the water surface:

Defer 000:10 Then ON
Defer 000:10 Then OFF

You can also add a When timer as a failsafe in case the upper sensor fails, but you'd need to know the average time it takes to fill completely, then add a few minutes to that duration for the When timer.

When On > 360:00 Then OFF

Read my tutorial on Apex Timers for more details on these commands: https://www.reef2reef.com/ams/neptune-apex-programming-tutorials-part-2-timers.689/


Makes sense. Thanks for your help. I need to consider that my Water top off will be feeding from this same container so I will have to figure out how to compensate that the RO doesn't turn off/on once it hits that point

if I run my Top-off line below my lower sensor, will this statement work?

If RO_L OPEN Then ON
If RO_H CLOSED Then OFF
Defer 001:00 Then ON
 
can a poly tank be sealed with silicone? I'm considering drilling a hole for the low sensor. will silicone seal it??
 
For simplicity I just use one sensor at the bottom. My RO produces at a consistent rate so I timed how long it takes to fill the container (50 min in my case). When it hits the low sensor, it runs for 50 min with the defer 50 then off. It fills once every few days, no TDS creep, half as many sensors to go bad. I use the when on to make sure it doesn’t run more than 60 min (which happened when the sensor didnt register closed once) and I use a float valve as added insurance. So far, it works great and has 3 layers of flood protection - 2 timers and a float valve.
 
For your code, you need to remove the Set OFF command. In order to keep the pump running only when the low sensor triggers it, you need to rely only on the lower and upper sensors to turn on and off. The Set OFF command will turn off the solenoid as soon as the lower sensor detects water, so it will never reach the upper sensor.

I don’t have an upper sensor, it just runs for 50 min with the defer off command when it hits the sensor, at the bottom of my reservoir, every few days. I could probably do without the set off command but it works fine as is too.
 
can a poly tank be sealed with silicone? I'm considering drilling a hole for the low sensor. will silicone seal it??

I don’t know that answer but I side stepped drilling in my reservoir with a 3D printed pump holder for the pmup that has a sensor holder in it. There are also magnetic sensor holders. Depending on how big tall your reservoir is, pressure can be an issue on a drilled seal. I drilled a tall brute trash can and put a bulkhead in and had some issues with leaking due to the pressure.
 
I ended up using a magnate for the lower sensor.
Using 2 sensors, 1 low and the other high with a float valve just above the upper sensor.
kept the command simplistic

If RO_L OPEN Then ON
If RO_H CLOSED Then OFF
Defer 000:10 Then ON

tested it and is working

also have a leak sensor to shut down the solenoid

should cover all the bases
 
I ended up using a magnate for the lower sensor.
Using 2 sensors, 1 low and the other high with a float valve just above the upper sensor.
kept the command simplistic

If RO_L OPEN Then ON
If RO_H CLOSED Then OFF
Defer 000:10 Then ON

tested it and is working

also have a leak sensor to shut down the solenoid

should cover all the bases
Don't forget to add the Fallback command:

Fallback OFF

This turns the solenoid off in the event that the Apex is not in communications with the FMM controlling the solenoid, preventing a potential flood. Read this FAQ for more details about Fallback:
 
I tried to simulate a power outage and found that my Solenoid would not turn back on. the tank is not full to the upper sensor that will turn off the water off.

is there a way to have it turn back on if the lower sensor (RO_L) is underwater??

current setup

Fallback OFF
If RO_L OPEN Then ON
If RO_H CLOSED Then OFF
Defer 000:10 Then ON
 
I ended up using a magnate for the lower sensor.
Using 2 sensors, 1 low and the other high with a float valve just above the upper sensor.
kept the command simplistic

If RO_L OPEN Then ON
If RO_H CLOSED Then OFF
Defer 000:10 Then ON

tested it and is working

also have a leak sensor to shut down the solenoid

should cover all the bases

One strong suggested edit based on my sensor failure - I would time how long it takes to fill your reservoir and add a "When On > time+n minutes Then OFF" where n is a couple minutes past your fill time so that if your upper sensor fails like mine did, it will shut off the solenoid and notify you with an error rather than just run endlessly.

With that said, I'll reiterate my assertion that the upper sensor is not only not necessary, but a liability - using a timer to fill with a defer off command will be 100% more reliable than a sensor. That also opened a port on my FMM that I used for a floor leak sensor that is another layer of safety. :)
 
With that said, I'll reiterate my assertion that the upper sensor is not only not necessary, but a liability - using a timer to fill with a defer off command will be 100% more reliable than a sensor. That also opened a port on my FMM that I used for a floor leak sensor that is another layer of safety. :)
I get it

I have the leak sensor and have a mechanical float valve that will shut down the RO if the upper sensor fails.. I Can add a timer next time the tank empties
 
I have used this programming to have the solonoid fill my RO container when the lower sensor is exposed and it works great:

Fallback OFF
If RO_L OPEN Then ON
If RO_H CLOSED Then OFF
Defer 000:10 Then ON

My question is: How can I program a momentary button connected to a breakout box to open the solonoid to refill the RO container when the water level is somewhere between the upper and lower sensors?
 

IF YOU HAD TO TAKE A REEFING EXAM, WOULD YOU PASS?

  • 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