Page 1 of 1

ATOLow Delay

Posted: Mon Jun 28, 2021 11:30 am
by clw143
I am looking for a way to put a delay on the standard ATO low switch. My DC pump causes a little turbulence in that chamber.

If ATO is low for longer than x then turn on the standard ATO port.

Thanks

Re: ATOLow Delay

Posted: Mon Jul 05, 2021 9:40 am
by clw143
Anyone? Not possible?

Re: ATOLow Delay

Posted: Wed Jul 07, 2021 3:40 pm
by binder
clw143 wrote:Anyone? Not possible?
almost anything is possible.
are you just using the ato low switch? like once it gets triggered you want a delay of x seconds before the outlet turns on. then you want it to run until when? until it is not triggered?

Sent from my Pixel 2 using Tapatalk

Re: ATOLow Delay

Posted: Wed Jul 07, 2021 3:42 pm
by binder
you can also look at the libraries and specifically look at the metalhalide function(s). they implement a delay before turning on to limit the power draw at startup.
something like that can be implemented, only you will have to use the function call for the ato low switch.

Sent from my Pixel 2 using Tapatalk

Re: ATOLow Delay

Posted: Sat Jul 17, 2021 2:30 pm
by clw143
binder wrote:
clw143 wrote:Anyone? Not possible?
almost anything is possible.
are you just using the ato low switch? like once it gets triggered you want a delay of x seconds before the outlet turns on. then you want it to run until when? until it is not triggered?

Sent from my Pixel 2 using Tapatalk

I'm using the standard low and high. I just want the low active for x (maybe 5 seconds) before triggering the ato pump port and run until the high switch is active.

So just like normal but with some deadband on the low switch.

Re: ATOLow Delay

Posted: Thu Sep 02, 2021 5:30 pm
by clw143
I have yet to quite figure this out. Any more input would be appreciated.

Re: ATOLow Delay

Posted: Thu Jun 09, 2022 12:56 pm
by clw143
It's been a while since I started this, low priority. I made a stab and came up with this, but I can't seem to make it work. Any help would be appreciated.

Code: Select all

   unsigned long LastATO; 


    if (ReefAngel.LowATO.IsActive()) LastATO=millis();
    if (ReefAngel.HighATO.IsActive() || ReefAngel.isATOTimeOut()) LastATO=0;
    if (millis() - LastATO < 60000) ReefAngel.Relay.Off( Port8 );
    else ReefAngel.StandardATO( Port8 );   

Re: ATOLow Delay

Posted: Fri Jun 10, 2022 12:24 pm
by clw143
clw143 wrote:

Code: Select all

  if (ReefAngel.LowATO.IsActive()) LastATO=millis();
I used some custom variables to see what is going on. It looks to me like LastATO is constantly updating with current millis value while LowATO.IsActive, meaning millis - LastATO is always 0.

How do I correct?

Re: ATOLow Delay

Posted: Wed Feb 22, 2023 4:15 pm
by clw143
Below is the code I came up with for this. I have been scratching my head as to why but the issue with it is that it only works the fist time. Every subsequent time upon the low level switch goes true, my ATO timeout will immediately come on. Any one have any insight on this?

Code: Select all

  // *******************  Debounced ATO code. Only run ATO if LowATO is true for more than 10 sec.  *******************

  if (ReefAngel.HighATO.IsActive() || ReefAngel.isATOTimeOut()) {
    topoff = false;
    SnapShot = 0;
    ReefAngel.Relay.Off( Port8 ); //ATO Pump Off
}
  else if (!ReefAngel.HighATO.IsActive() && !ReefAngel.LowATO.IsActive()) topoff = false;
  else if (ReefAngel.LowATO.IsActive()) topoff = true;


  if ((topoff == true) && (last_topoff == false)) SnapShot = millis(); // check if this is the first time that lasttopoff and topoff are different and store snapshot of time

  last_topoff = topoff; // update topoff  

  if (topoff && (millis() - SnapShot >= 10000)) { //run ATO normally if ATOLOW is true for more than 10 seconds
  ReefAngel.StandardATO( Port8 ); //ATO Normal ON