float sensor time delay - new question

Do you have a question on how to do something.
Ask in here.
Post Reply
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: float sensor time delay - new question

Post by rimai »

true is Low ATO port and false is High ATO port. It tells which port you are using for ATO.
5000 is 5000 milliseconds.
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: float sensor time delay - new question

Post by rossbryant1956 »

any idea why this is not working?
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: float sensor time delay - new question

Post by lnevo »

Can we start over... I just re-read the thread, and I have no clue what you're trying to accomplish. What does GT_Fill mean?

What was the ATO code you were using before you added this delay that worked? I feel like you copied Roberto's sample code and it may not fit the original needs. You stated you weren't using SingleATO... and both your wires are pointed down.

Thanks,
Lee
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: float sensor time delay - new question

Post by rossbryant1956 »

Thanks Lee;

I do a series of things with the I/O expansion unit and float valves. Here is some of my working code:

Code: Select all

 // I_O Expansion & Float Valves
  
          ReefAngel.CustomVar[7]=1;
  
       //turn off DT pump when switch is tripped and sound buzzer
           ReefAngel.Relay.Set(DT_Pump,ReefAngel.IO.GetChannel(0));
           ReefAngel.PWM.SetDaylight(100-(ReefAngel.IO.GetChannel(0)*100));
           ReefAngel.CustomVar[0]=ReefAngel.IO.GetChannel(0); //tell the portal we have a overflow problem
       
        //turn off GT pump when switch is tripped and sound buzzer
           ReefAngel.Relay.Set(GT_Pump,ReefAngel.IO.GetChannel(1));
           ReefAngel.PWM.SetDaylight(100-(ReefAngel.IO.GetChannel(1)*100));
           ReefAngel.CustomVar[1]=ReefAngel.IO.GetChannel(1); //tell the portal we have a overflow problem 
           
In other words, when those I/O floats trip, they turn off the pumps DT & GT to keep those tanks from overflowing. I have had trouble in the past with my Glass-Holes overflows slowing due to junk in the pipes. Works like a charm. Then I added another float valve to my I/O expansion, wires pointed down, that would turn on another pump and refill evaporated water from my RODI system. I originally used this line of code:

Code: Select all

          ReefAngel.Relay.Set(GT_Fill,ReefAngel.IO.GetChannel(2));
          ReefAngel.PWM.SetDaylight(100-(ReefAngel.IO.GetChannel(2)*100));
Worked like a charm. THEN under the auspices of one of the primary engineering tenets "if it ain't broke, fix it anyway" I decided it would be better to implement some method of instead of toggling that pump every time that tank needed a little water it would be better to have it wait until it needed a decent top off before turning on.

So that's where I am. Roberto suggested a bit of code that seems like it should work but I'm not able to understand it well enough to do my own troubleshooting. Appreciate any advice you provide. Thanks
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: float sensor time delay - new question

Post by rossbryant1956 »

bump...any thoughts?
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: float sensor time delay - new question

Post by lnevo »

Yeah, sorry no I haven't had a chance to look at it yet... so what does GT_Fill mean (just so it's clear in my brain...

And the code you had before.. what is the SetDaylight command doing? is that for a buzzer? or something else?
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: float sensor time delay - new question

Post by rossbryant1956 »

GT_Fill is the name of my pump on a relay. And don't worry about the buzzer, I am in the midst of changing that to your WiFiAlert code. Basically I want it to alert me when the pump comes on (and goes off)

Thx, Lee
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: float sensor time delay - new question

Post by lnevo »

So is GT_Fill always running unless the switch is tripped?
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: float sensor time delay - new question

Post by lnevo »

Also, is the LowATO switch involved or just the Channel 2 on the expansion?

I think it's not working because Roberto assumed you were using the ATO switch as well...
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: float sensor time delay - new question

Post by rossbryant1956 »

No GT_Fill is off unless tripped by channel two and then no LowATO at all only the expansion and the float valve
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: float sensor time delay - new question

Post by lnevo »

Ok, yeah, so that's why this isn't working... the SingleATO function is not made to be used by other channels...

Roberto should actually fix that ;) Instead of taking a boolean it could take an int where 0 is high, 1 is low, rest are remaining channels... That would fix that..

In the meantime, let me look at that code soon...
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: float sensor time delay - new question

Post by lnevo »

Ok, yeah, so that's why this isn't working... the SingleATO function is not made to be used by other channels...

Roberto should actually fix that ;) Instead of taking a boolean it could take an int where 0 is high, 1 is low, rest are remaining channels... That would fix that..

In the meantime, let me look at that code soon...
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: float sensor time delay - new question

Post by rossbryant1956 »

Okay I have been working with your switchalert code and it is now working beautifully with my I/O expansion. This is how I modified it:

Code: Select all

    void CheckSwitches() {
       static boolean GT_OverFillOverride=true;
       static WiFiAlert switchAlert, skimmerAlert;
       skimmerAlert.SetDelay(3600); 
       switchAlert.SetDelay(3600);
       
       if (ReefAngel.DisplayedMenu==FEEDING_MODE || ReefAngel.DisplayedMenu==WATERCHANGE_MODE)
       GT_OverFillOverride=true;
       
       // Turn off GT_OverFill if sump overflowing 
       
       if (!ReefAngel.IO.GetChannel(3)) {
         if (!GT_OverFillOverride) {
         switchAlert.Send("GT_Sump+level+alarm!+MixPump+disabled.");
         ReefAngel.Relay.Override(GT_OverFill,0);
         GT_OverFillOverride=true;
    } 
  } else {
    GT_OverFillOverride=false;
  }
So in this app, when that float valve trips, it sends the wifialert and turns off GT_Overfill (my pump.) I can then use the portal or the web app to reset that relay once the obstruction is cleared.

So my question is in another application I'd like to use this same snip of code but would like the relay sent back to "auto" automatically once the obstruction is cleared. Is there a way to do that? As always thanks in advance.
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: float sensor time delay - new question

Post by rimai »

Are you sure you want to go back on automatically?
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: float sensor time delay - new question

Post by lnevo »

I would just put the relay back in auto mode from your phone once the obstruction is clear....
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: float sensor time delay - new question

Post by rossbryant1956 »

Post by lnevo » Tue Oct 01, 2013 10:04 pm

I would just put the relay back in auto mode from your phone once the obstruction is clear....
For the application above that will work fine. For the new app
Are you sure you want to go back on automatically?
Yes I do. Roberto, this is that app we did some time ago for my overflows that would slow but not stop up. I want the pumps to turn off while the overflow is catching up but then to come back on once clear. If I have to, I can continue using my existing code but I really like the work Lee is doing and trying to improve my coding style.

Remember this?

Code: Select all

//turn off GT pump when switch is tripped and sound buzzer
           ReefAngel.Relay.Set(GT_Pump,ReefAngel.IO.GetChannel(1));
           ReefAngel.PWM.SetDaylight(100-(ReefAngel.IO.GetChannel(1)*100));
           ReefAngel.CustomVar[1]=ReefAngel.IO.GetChannel(1); //tell the portal we have a overflow problem 
Thanks again
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Post by lnevo »

So in the else section where GTOverride=false add the following line

ReefAngel.Relay.Override(GT_OverFill,2);
Post Reply