ATO Delay

Do you have a question on how to do something.
Ask in here.
Post Reply
Zechenia
Posts: 35
Joined: Thu Dec 29, 2011 3:53 pm

ATO Delay

Post by Zechenia »

Hi,

I am looking for a some fairly basic help after a few of my ideas failed to work correctly.

I have a custom ATO setup as follows:

Code: Select all

    if (!ReefAngel.HighATO.IsActive())
    {
        if(ReefAngel.LowATO.IsActive())
        {
           ReefAngel.Relay.On(Port7);
        }
        else
        {
           ReefAngel.Relay.Off(Port7); 
        }
    }
    else
    {
        ReefAngel.Relay.Off(Port7);
    }
Super basic. Anyway, the ATO section of my sump tends to have bubbles that pop right on top of where my horizontal switch is built in (and it's drilled into an acrylic sump. Not the best placement, but I got it used).

Sooo, right now it is frequently cycling the pump on and off for half a second, which can't be good for it. I'd like to require that the ATOLow be active for > 30 seconds before triggering the port.

I tried a quick timer as well as the delayed on and I couldn't get it to behave as I'd hope. Rather than tinker with it on an already running aquarium, I figured it'd be worth asking about :)

BTW, is there any sort of testing harness where I can simulate floats being tripped, time ect instead of testing on my actual reef angel?

Thanks!
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: ATO Delay

Post by rimai »

Take a look at this code:
http://forum.reefangel.com/viewtopic.php?f=12&t=2502
He uses it for salinity being stable for more than 120 seconds, but you can use the same concept to make it work.
Do you have an arduino board?? You could probably simulate it in one of those.
Roberto.
Zechenia
Posts: 35
Joined: Thu Dec 29, 2011 3:53 pm

Re: ATO Delay

Post by Zechenia »

I don't have an arduino board :(

Anyway, I was having trouble with it constantly re-setting my "LastATO" value. So, anyway, I just made some variables to keep track of when it was set. Also added some extra Relay.Offs for safety sake.

Code: Select all

    if (!ReefAngel.HighATO.IsActive())
    {
        if(ReefAngel.LowATO.IsActive() && ATOTriggered == false)
        {
           ATOTriggered = true;
           ATOTime = now();
           ReefAngel.Relay.Off(Port7);
        }
        else if (ReefAngel.LowATO.IsActive() && ATOTriggered == true && (now() - ATOTime > 30 ))
        {
           ReefAngel.Relay.On(Port7); 
        }
        else if (!ReefAngel.LowATO.IsActive())
        {
          ATOTriggered = false;
          ReefAngel.Relay.Off(Port7);
        }
    }
    else
    {
        ATOTriggered = false;
        ReefAngel.Relay.Off(Port7);
    }
Post Reply