ATOLow Delay

Basic / Standard Reef Angel hardware
Post Reply
clw143
Posts: 116
Joined: Fri Jun 21, 2013 8:20 pm
Location: Louisiana

ATOLow Delay

Post 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
clw143
Posts: 116
Joined: Fri Jun 21, 2013 8:20 pm
Location: Louisiana

Re: ATOLow Delay

Post by clw143 »

Anyone? Not possible?
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: ATOLow Delay

Post 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
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: ATOLow Delay

Post 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
clw143
Posts: 116
Joined: Fri Jun 21, 2013 8:20 pm
Location: Louisiana

Re: ATOLow Delay

Post 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.
clw143
Posts: 116
Joined: Fri Jun 21, 2013 8:20 pm
Location: Louisiana

Re: ATOLow Delay

Post by clw143 »

I have yet to quite figure this out. Any more input would be appreciated.
clw143
Posts: 116
Joined: Fri Jun 21, 2013 8:20 pm
Location: Louisiana

Re: ATOLow Delay

Post 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 );   
clw143
Posts: 116
Joined: Fri Jun 21, 2013 8:20 pm
Location: Louisiana

Re: ATOLow Delay

Post 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?
clw143
Posts: 116
Joined: Fri Jun 21, 2013 8:20 pm
Location: Louisiana

Re: ATOLow Delay

Post 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
Post Reply