Preventing ATO timeout

Do you have a question on how to do something.
Ask in here.
Post Reply
fd678
Posts: 10
Joined: Mon Aug 01, 2011 5:25 pm

Preventing ATO timeout

Post by fd678 »

I have my ATO setup using the low ATO port, and I have two float switches wired in series, one is a fail safe.
The problems that I use an aqualifeter pump and it is kind of slow, so I need to disable the ATO timeout because I need it to run longer than 255 seconds per hour. I have the interval set to 0 which says "disabled" but after 60 seconds my pump kicks off.
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Preventing ATO timeout

Post by binder »

that "disabled" is referring to the hourly repeat interval meaning that you will only allow the ATO to run 1 time every specified number of hours.

there is no easy way to override this without modifying the libraries. i do not recommend modifying the libraries at all BUT if you must, here's what you can do to get rid of the timeout check.

here's the singleato code that you need to locate inside ReefAngel.cpp:

Code: Select all

void ReefAngelClass::SingleATO(bool bLow, byte ATORelay, byte byteTimeout, byte byteHrInterval)
{
	/*
	If the switch is active, the float is opposite of the 2 wires,
		Check if we are not currently topping, if we are not check if we can run
		If we have an hour interval, check if we can run
		If we can run, activate the pump because we need water
	Otherwise the switch is not active, we need to see if we are currently topping
		If we are topping, then we need to stop the pump because we are topped off
	*/
    bool bCanRun = true;
    static int iLastTop = -1;
    if ( byteHrInterval )
    {
        int iSafeTop = NumMins(hour(), minute()) - iLastTop;
        if ( iSafeTop < 0 )
        {
            iSafeTop += 1440;
        }
        if ( (iSafeTop < (byteHrInterval * 60)) && (iLastTop >= 0) )
        {
            bCanRun = false;
        }
    }
    ReefAngel_ATOClass *ato;
    if ( bLow )
    {
        ato = &LowATO;
    }
    else
    {
        ato = &HighATO;
    }
    unsigned long t = byteTimeout;
    t *= 1000;
    if ( ato->IsActive() )
    {
        if ( (! ato->IsTopping()) && bCanRun )
        {
            ato->Timer = millis();
            ato->StartTopping();
            Relay.On(ATORelay);
        }
    }
    else
    {
    	// not active
		if ( ato->IsTopping() )
		{
			iLastTop = NumMins(hour(), minute());
			ato->StopTopping();
			Relay.Off(ATORelay);
		}
    }

// either remove or comment out these next 5 lines
// or you can just comment out or remove the LED and Relay.Off lines
    if ( ((millis() - ato->Timer) > t) && ato->IsTopping() )
    {
        LED.On();  // comment this line out
        Relay.Off(ATORelay);  // comment this line out
    }
}
If you do that, you can put whatever value you want in the timeout (preferably still 255) and then when the timeout expires the port will not shutoff and the led light will not come on.

It's the simplest way I can thing of to fix this for you.

curt
ingtar_shinowa
Posts: 20
Joined: Fri Jan 27, 2012 9:14 pm

Re: Preventing ATO timeout

Post by ingtar_shinowa »

I have a similar problem but I am using the standard ATO option. Is there another option besides altering the library?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Preventing ATO timeout

Post by rimai »

You could add this to your code:

Code: Select all

  ReefAngel.StandardATO(Port1,1000);
Change 1000 to how many seconds you would like.
Roberto.
Post Reply