Can i turn on/off a port based on water level?
Can i turn on/off a port based on water level?
Is there a way to have a port turn on at water level 85 and turn off at water level 95 for example?
I am using a pressure senor for my ATO (tsunami At-1) which turns off and on a pump based on air pressure in a tube in the refugium.
Is there any way i can just have a port turn off when the water level sensor reaches a certain limit? And turn it back on when it gets anywhere below that high level?
Ive tried using this code for the ATO but it keeps timing out and does not seem to work for me. I cant keep my ATO plugged into this port or it simply wont fill up at all.
Currently i have it plugged into a 'always on' port and just hope it wont over fill based off of the ATO pressure sensor.
ReefAngel.WaterLevelATO( Port7,1600,85,95 );
I am using a pressure senor for my ATO (tsunami At-1) which turns off and on a pump based on air pressure in a tube in the refugium.
Is there any way i can just have a port turn off when the water level sensor reaches a certain limit? And turn it back on when it gets anywhere below that high level?
Ive tried using this code for the ATO but it keeps timing out and does not seem to work for me. I cant keep my ATO plugged into this port or it simply wont fill up at all.
Currently i have it plugged into a 'always on' port and just hope it wont over fill based off of the ATO pressure sensor.
ReefAngel.WaterLevelATO( Port7,1600,85,95 );
Re: Can i turn on/off a port based on water level?
This the ATO code that I use does what I think you're looking for. The time functions allow it to be active only twice a day. Hope it helps.
The code for just the return pump may be specific to what you are asking but mine works in the reverse - off if less than 36 and back on when above 63.
Code: Select all
// ATO/Water functions - Begin
if ( ( hour() == 6 ) && ( minute() >= 45 ) && ( hour() == 6 ) && ( minute() < 48 ) )
{
if ( ReefAngel.WaterLevel.GetLevel(2) <= 72 && ReefAngel.WaterLevel.GetLevel(2) >= 9 ) ReefAngel.Relay.On( TopOffH2O );
if ( ReefAngel.WaterLevel.GetLevel(2) >= 81 || ReefAngel.WaterLevel.GetLevel(2) < 9 || ReefAngel.HighATO.IsActive() ) ReefAngel.Relay.Off( TopOffH2O );
}
if ( ( hour() == 18 ) && ( minute() >= 45 ) && ( hour() == 18 ) && ( minute() < 48 ) )
{
if ( ReefAngel.WaterLevel.GetLevel(2) <= 72 && ReefAngel.WaterLevel.GetLevel(2) >= 9 ) ReefAngel.Relay.On( TopOffH2O );
if ( ReefAngel.WaterLevel.GetLevel(2) >= 81 || ReefAngel.WaterLevel.GetLevel(2) < 9 || ReefAngel.HighATO.IsActive() ) ReefAngel.Relay.Off( TopOffH2O );
}
if ( ReefAngel.WaterLevel.GetLevel(2) <= 36 ) ReefAngel.Relay.Off( ReturnDCP );
if ( ReefAngel.WaterLevel.GetLevel(2) >= 63 ) ReefAngel.Relay.On( ReturnDCP );
if ( ReefAngel.WaterLevel.GetLevel(2) >= 90 || ReefAngel.WaterLevel.GetLevel(1) >= 108 || ReefAngel.HighATO.IsActive() )
{
ReefAngel.Relay.Off( Skimmer );
ReefAngel.Relay.Off( TopOffH2O );
}
// ATO/Water functions - End
Try to learn something about everything and everything about something... Thomas Huxley
210gal DT | 50gal sump/refug | Jebao DCP 10000 pump | RO 200-int skimmer | DIY built stand | DIY 160 led, 12 channel, 458 watt, on MakersLED 72" heatsink
210gal DT | 50gal sump/refug | Jebao DCP 10000 pump | RO 200-int skimmer | DIY built stand | DIY 160 led, 12 channel, 458 watt, on MakersLED 72" heatsink
Re: Can i turn on/off a port based on water level?
Thanks!
This is very useful. Although its a bit much for me. I just want to do a simple on and off based on level and the time of day really is not a factor for me.
I have my RODI hooked up directly to a water line controlled by a zone valve which opens/closes based off of the ATO.
I suppose this would work?
Turn off if its above 95% and turn on if its below 85%?
Maybe i got this wrong.
This is very useful. Although its a bit much for me. I just want to do a simple on and off based on level and the time of day really is not a factor for me.
I have my RODI hooked up directly to a water line controlled by a zone valve which opens/closes based off of the ATO.
I suppose this would work?
Turn off if its above 95% and turn on if its below 85%?
Maybe i got this wrong.
Code: Select all
if ( ReefAngel.WaterLevel.GetLevel(2) <= 85 && ReefAngel.WaterLevel.GetLevel(2) <= 85 ) ReefAngel.Relay.On( TopOff );
if ( ReefAngel.WaterLevel.GetLevel(2) >= 95 || ReefAngel.WaterLevel.GetLevel(2) > 95 ) ReefAngel.Relay.Off( TopOff );
Re: Can i turn on/off a port based on water level?
I think you only need:
The number in the ReefAngel.WaterLevel.GetLevel() statement would be the number of whatever level sensor your using for the reference. For me, it just happens to be '2.'
Edit: was missing a ')' in each statement.
Code: Select all
if ( ReefAngel.WaterLevel.GetLevel(2) <= 85 ) ReefAngel.Relay.On( Port7 );
if ( ReefAngel.WaterLevel.GetLevel(2) >= 95 ) ReefAngel.Relay.Off( Port7 );
Edit: was missing a ')' in each statement.
Try to learn something about everything and everything about something... Thomas Huxley
210gal DT | 50gal sump/refug | Jebao DCP 10000 pump | RO 200-int skimmer | DIY built stand | DIY 160 led, 12 channel, 458 watt, on MakersLED 72" heatsink
210gal DT | 50gal sump/refug | Jebao DCP 10000 pump | RO 200-int skimmer | DIY built stand | DIY 160 led, 12 channel, 458 watt, on MakersLED 72" heatsink
Re: Can i turn on/off a port based on water level?
I would suggest modifying the functions to account for a malfunction of the water level sensor/module combination.
The reason is that if a sensor comes out of the water, the air line to the module leaks, or a USB cable comes a loose (power/data), then the reading will be zero (0) or something close to it. In any of these cases, your pump would turn on and stay on regardless of actual water level. I use 9 in my code to give a little wiggle room. This and the 3 minute windows twice a day are the compensations for not having an ATO time-out using the ATO function. On the darker side, a broken tank could also cause the zero (or something close to it) reading.
Code: Select all
if ( ReefAngel.WaterLevel.GetLevel(2) <= 85 && ReefAngel.WaterLevel.GetLevel(2) > 0 ) ReefAngel.Relay.On( Port7 );
if ( ReefAngel.WaterLevel.GetLevel(2) >= 95 || ReefAngel.WaterLevel.GetLevel(2) = 0 ) ReefAngel.Relay.Off( Port7 );
Try to learn something about everything and everything about something... Thomas Huxley
210gal DT | 50gal sump/refug | Jebao DCP 10000 pump | RO 200-int skimmer | DIY built stand | DIY 160 led, 12 channel, 458 watt, on MakersLED 72" heatsink
210gal DT | 50gal sump/refug | Jebao DCP 10000 pump | RO 200-int skimmer | DIY built stand | DIY 160 led, 12 channel, 458 watt, on MakersLED 72" heatsink
Re: Can i turn on/off a port based on water level?
That makes sense for sure. Another good safety measure i have is the leak detector. Which will shut off all the ports if a leak is detected.Loose wrote:I would suggest modifying the functions to account for a malfunction of the water level sensor/module combination.
The reason is that if a sensor comes out of the water, the air line to the module leaks, or a USB cable comes a loose (power/data), then the reading will be zero (0) or something close to it. In any of these cases, your pump would turn on and stay on regardless of actual water level. I use 9 in my code to give a little wiggle room. This and the 3 minute windows twice a day are the compensations for not having an ATO time-out using the ATO function. On the darker side, a broken tank could also cause the zero (or something close to it) reading.Code: Select all
if ( ReefAngel.WaterLevel.GetLevel(2) <= 85 && ReefAngel.WaterLevel.GetLevel(2) > 0 ) ReefAngel.Relay.On( Port7 ); if ( ReefAngel.WaterLevel.GetLevel(2) >= 95 || ReefAngel.WaterLevel.GetLevel(2) = 0 ) ReefAngel.Relay.Off( Port7 );
So i will try this one out. I will eventually get to naming all my ports
Code: Select all
if ( ReefAngel.WaterLevel.GetLevel(2) <= 85 && ReefAngel.WaterLevel.GetLevel(2) > 9 ) ReefAngel.Relay.On( Port7 );
if ( ReefAngel.WaterLevel.GetLevel(2) >= 95 || ReefAngel.WaterLevel.GetLevel(2) = 0 ) ReefAngel.Relay.Off( Port7 );
-
- Posts: 21
- Joined: Fri Jan 12, 2018 6:33 am
Re: Can i turn on/off a port based on water level?
ReefAngel.Relay.Set(Port7, ReefAngel.WaterLevel.GetLevel(2) <= 85 && ReefAngel.WaterLevel.GetLevel(2) > 9);
Re: Can i turn on/off a port based on water level?
Thanks libertyaquarium, I do like streamlined code. Is there an equivalent function for the ReefAngel.Relay.Off?
Try to learn something about everything and everything about something... Thomas Huxley
210gal DT | 50gal sump/refug | Jebao DCP 10000 pump | RO 200-int skimmer | DIY built stand | DIY 160 led, 12 channel, 458 watt, on MakersLED 72" heatsink
210gal DT | 50gal sump/refug | Jebao DCP 10000 pump | RO 200-int skimmer | DIY built stand | DIY 160 led, 12 channel, 458 watt, on MakersLED 72" heatsink
Re: Can i turn on/off a port based on water level?
I am new to this and trying to understand.libertyaquarium wrote:ReefAngel.Relay.Set(Port7, ReefAngel.WaterLevel.GetLevel(2) <= 85 && ReefAngel.WaterLevel.GetLevel(2) > 9);
Does this mean that port 7 will turn off when water level shows above 85 and will turn on when water level shows above 9 but below 85?
That is really what i am trying to accomplish here, but possibly with different percentages.
Re: Can i turn on/off a port based on water level?
Yes. The && is a way of sending AND. So if both conditions are true (number between and inclusive 10-85) then Port 7 will get set to true which will be on. If either of those conditions is not true, (if it's 86 or higher or 9 or less) then the port will get set to false which will then be off. You can change the 85 and 9 as desired. The 2 needs to be the WaterLevel channel that your sensor is using.
Re: Can i turn on/off a port based on water level?
Ahhh... still learning the functions too and the ReefAngel.Relay.Set() function is a logical TRUE/FALSE.
But how do you accomplish the range of port ON that is desired using it?
The original goal was on at or below 85 and off at 95. The first condition is met but the second isn't. I added the check for above 9 because I've had the overfill happen (with the associated shopvac usage ).
Also, if a TRUE/FALSE is used for this function the ATO relay is going to cycle often at the 85 mark; on at 85 off at 86. Correct?
But how do you accomplish the range of port ON that is desired using it?
The original goal was on at or below 85 and off at 95. The first condition is met but the second isn't. I added the check for above 9 because I've had the overfill happen (with the associated shopvac usage ).
Also, if a TRUE/FALSE is used for this function the ATO relay is going to cycle often at the 85 mark; on at 85 off at 86. Correct?
Try to learn something about everything and everything about something... Thomas Huxley
210gal DT | 50gal sump/refug | Jebao DCP 10000 pump | RO 200-int skimmer | DIY built stand | DIY 160 led, 12 channel, 458 watt, on MakersLED 72" heatsink
210gal DT | 50gal sump/refug | Jebao DCP 10000 pump | RO 200-int skimmer | DIY built stand | DIY 160 led, 12 channel, 458 watt, on MakersLED 72" heatsink
Re: Can i turn on/off a port based on water level?
So this is working great when it comes to turning on the relay when water reached a certain level
However i ran into another issue, the water level tends to jump 1-3% from 89-92 back and forth.
Is there a way to put a delay on this relay as well?
I did try adding to the code:
ReefAngel.Relay.DelayedOn( Port7,1200 );
So it would delay to turn it on for 20 minutes, but it does not seem to be working.
However i ran into another issue, the water level tends to jump 1-3% from 89-92 back and forth.
Is there a way to put a delay on this relay as well?
I did try adding to the code:
ReefAngel.Relay.DelayedOn( Port7,1200 );
So it would delay to turn it on for 20 minutes, but it does not seem to be working.
Re: Can i turn on/off a port based on water level?
DelayedOn only works after reboot, feeding mode or waterchange mode.
What you want to do is set the relay override which you can do with
ReefAngel.Relay.Override(Port7, false);
That will turn the relay on definitively. However it won't go back on unless you do it manually or add additional logic to put it back on after 20 minutes or if the WL changes to something else.
What you want to do is set the relay override which you can do with
ReefAngel.Relay.Override(Port7, false);
That will turn the relay on definitively. However it won't go back on unless you do it manually or add additional logic to put it back on after 20 minutes or if the WL changes to something else.
Re: Can i turn on/off a port based on water level?
Oh i see, so what i am trying to do will not work unless i figure out some other logic to turn it back on after 20 minutes or whatever time.lnevo wrote:DelayedOn only works after reboot, feeding mode or waterchange mode.
What you want to do is set the relay override which you can do with
ReefAngel.Relay.Override(Port7, false);
That will turn the relay on definitively. However it won't go back on unless you do it manually or add additional logic to put it back on after 20 minutes or if the WL changes to something else.
Just want this port to have a delayed on time based off any 'on' trigger.
Ideally it would work like this:
Water level gets to 90%
Port 7 (ATO port) Turns on RODI water. Until water level gets above 90% (91%)
What is happening is water level is jumpung from 89% to 92% every few seconds causing the relay to go crazy.
So ideally it would work like this:
Water level gets to 90%
Port 7 Turns on after a delayed time of 20 minutes to fill RODI water
Water level jumps betwen 89-92%
Port 7 turns off and has a delayed turn on time of 20 minutes
After 20 minutes Port 7 (ATO port) Turns on RODI water.
I dont care if my water level drops below 85% as long as it eventually gets filled to 90%. And it seems a delay on for the port would do the job. Maybe even a longer delay on time, which is something i can eventually mess with.
Re: Can i turn on/off a port based on water level?
I'm not understanding why use the timer is the level is the best way to go.
Have you tried the code you said you would? Can you explain to me so I better understand why the code didn't work?
Relay would turn on only when goes below 85 and turn off when above 95. Even if it bounces around, it would not turn back on until it goes all the way down to 85 again.
Have you tried the code you said you would? Can you explain to me so I better understand why the code didn't work?
Code: Select all
if ( ReefAngel.WaterLevel.GetLevel(2) <= 85 && ReefAngel.WaterLevel.GetLevel(2) > 9 ) ReefAngel.Relay.On( Port7 );
if ( ReefAngel.WaterLevel.GetLevel(2) >= 95 || ReefAngel.WaterLevel.GetLevel(2) = 0 ) ReefAngel.Relay.Off( Port7 );
Roberto.
Re: Can i turn on/off a port based on water level?
The code is throwing an error:
In function 'void loop()':
error: lvalue required as left operand of assignment
Looks like it does not like = 0
In function 'void loop()':
error: lvalue required as left operand of assignment
Looks like it does not like = 0
Re: Can i turn on/off a port based on water level?
= is an assignment not a comparison. So here you are trying to set a function to equal 0. = by itself is used to set the value of a variable int i = 4; for example. What you want is to use a comparison, is it equal to which is represented by == alternatively if you ever need, you can use != along with < > <= >=
Re: Can i turn on/off a port based on water level?
Thank you for the explanation.
This is working perfectly now.
This is working perfectly now.