Page 1 of 1

ATO w/water level sensor

Posted: Fri Feb 16, 2018 1:41 pm
by Loose
I used to use the following code for one of my water level sensors to control my ATO pump.

Code: Select all

        if ( ReefAngel.WaterLevel.GetLevel(2) <= 54 && ReefAngel.WaterLevel.GetLevel(2) >= 9 ) ReefAngel.Relay.On( TopOff );
        if ( ReefAngel.WaterLevel.GetLevel(2) >= 81 || ReefAngel.WaterLevel.GetLevel(2) < 9 ) ReefAngel.Relay.Off( TopOff );
Even after running this way for the past three months, I was a little uncomfortable that there wasn't a time out and just modified it to this so there was only a small window each day for the ATO (if I did this right it should be 36 seconds).

Code: Select all

    if ( ( hour() >= 18 && minute() >= 45 ) && ( hour() >= 18 && minute() >= 45 && second() < 36 ) )
    {
        if ( ReefAngel.WaterLevel.GetLevel(2) <= 54 && ReefAngel.WaterLevel.GetLevel(2) >= 9 ) ReefAngel.Relay.On( TopOff );
        if ( ReefAngel.WaterLevel.GetLevel(2) >= 81 || ReefAngel.WaterLevel.GetLevel(2) < 9 ) ReefAngel.Relay.Off( TopOff );
    }
    else ReefAngel.Relay.Off( TopOff );
Another way I was trying to do it was let it come on at the low level, shutoff automatically at the high level, and then put in a delay (say 18 hours) before it would be allowed to come again... maybe using one of the ATO flags to start a timer? At this point, I don't use float switches as I use a second H2O level sensor as a backup.

Any evaluation of what I coded and help coding this third option would be greatly appreciated.