ATO delay

Do you have a question on how to do something.
Ask in here.
Post Reply
palmer
Posts: 24
Joined: Thu Mar 29, 2012 7:57 pm

ATO delay

Post by palmer »

trying to get the ATO port to turn on 5 mins after being triggered-
how do i modify what i have here?

Code: Select all

if (ReefAngel.LowATO.IsActive())
      ReefAngel.DosingPumpRepeat(Port7,0,30,300);
    else
      ReefAngel.Relay.Off(Port7);
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: ATO delay

Post by cosmith71 »

I just happen to have code laying around for that. :D

Put this up in globals:

Code: Select all

unsigned long LastUpdate1=0; 
Put this in your loop:

Code: Select all

if (ReefAngel.LowATO.IsActive() && LastUpdate1==0)
  {
    LastUpdate1 = now();
    ReefAngel.Relay.On (Port7);
  }
if (now() - LastUpdate1 >= 300 && LastUpdate1 != 0)
  {
    LastUpdate1 = 0;
    ReefAngel.Relay.Off (Port7);
  }
--Colin
palmer
Posts: 24
Joined: Thu Mar 29, 2012 7:57 pm

Re: ATO delay

Post by palmer »

tried it .didn't work !
it trigger off the ATO immediately ( no delay) and ran for 5 mins
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: ATO delay

Post by cosmith71 »

That's what it's supposed to do. :D I mis-read your question.

What is it you're trying to accomplish? What happens after the 5 minute delay?
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: ATO delay

Post by Sacohen »

If I understand the question correctly. he wants to have the ATO actually start 5 min after the RA triggers it to.

Here is a thread that I asked to do the same thing.
http://forum.reefangel.com/viewtopic.ph ... 2&start=10

It didn't work for me either though.
cosmith71 wrote:Something like this? Note, this compiles, but I haven't tested it.

Put this up in globals:

Code: Select all

static time_t LastATO=millis();    // For de-bounced ATO
And this in your loop in place of whatever line you're using for topoff.

Code: Select all

// *******************  Debounced ATO code. Activate ATO no more than every 30 seconds.  *******************
  if (ReefAngel.WaterLevel.GetLevel(0) < 98) LastATO=millis();    // Start a timer
  if (millis()-LastATO<30000 && millis()-LastATO>10)     // Has it been less than 30,000 ms? (30 secs)
    ReefAngel.Relay.Off(TopOff);                         // If so, make sure the topoff pump is off
  else
    ReefAngel.WaterLevelATO( ATO_Pump,720,34,36 );                     // Otherwise, use the normal topoff routine.
Replace the two 98's and the 100 with whatever your desired low and high levels are.

--Colin
palmer
Posts: 24
Joined: Thu Mar 29, 2012 7:57 pm

Re: ATO delay

Post by palmer »

actually I am going to keep that code because the end result is the same I guess- What was happening was the chattering of the ATO trigger port when the ATO low is fired off- I was just trying to protect the pump. Obviously this also works to alleviate that.
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: ATO delay

Post by cosmith71 »

Oh, I have that too. :geek:

Up in globals:

Code: Select all

static time_t LastATO=millis();    // For de-bounced ATO
Down in the loop:

Code: Select all

// *******************  Debounced ATO code. Activate ATO no more than every 60 seconds.  *******************
  if (!ReefAngel.LowATO.IsActive()) LastATO=millis();    // Start a timer
  if (millis()-LastATO<60000 && millis()-LastATO>10)     // Has it been less than 60,000 ms? (60 secs)
    ReefAngel.Relay.Off(TopOff);                         // If so, make sure the topoff pump is off
  else
    ReefAngel.SingleATOLow(TopOff);                      // Otherwise, use the normal topoff routine.
This may run backwards...if it does, take out the !.

--Colin
Post Reply