StandardATO utilizes both float switches to monitor the water level.
SingleATO utilizes one float switch to monitor the water level. So you can have 2 float switches if you like.
Both ways have a timeout that prevents the relays from running too long in case of a problem.
This post will cover how the functions work and also what some of the terminology inside the code means.
Inside the ATO class in the code, there is a function that is called IsActive.
IsActive - Means the float is not touching the end with both wires coming out of it. So when the code says "ato->IsActive()" that means that the float is not touching the end with the wires. See the picture for a visual. Standard ATO
Here is the way the StandardATO function works:
- High switch mounted with wires at the bottom
- Low switch mounted with the wires at the top
- When water level lowers all the way to cause the low switch to be active (float is touching the end opposite from 2 wires coming out of it), the ATO pump/specified relay is turned on.
- The ATO pump runs until the water level raises the low switch up from making contact, continues to raise the water level until the high switch is active (float is touching the end opposite of the 2 wires coming out of it). The ATO pump shuts off when the high switch is active OR if the ATO Timeout value is exceeded. The timeout prevents the pump from running too long in case the reservoir runs dry or something else happens.
- Water then evaporates out of the tank and lowers until the low switch is active.
- Repeat process
Code: Select all
ReefAngel.StandardATO(1, 120);
- Use both ATO ports
- When the low switch is active, turn on port 1
- Run the port until the high switch is active or the 120 second timeout occurs
- If the 120 second timeout occurs, signal an error with the ATO flag, turn on the red light and shut off port 1
Code: Select all
ReefAngel.StandardATO(1);
That's it. There's not much more to it.
SingleATO
The SingleATO function works with an individual switch only. So there is no failsafe built in. The only failsafe is the timeout value. There are two functions calls: SingleATOLow or SingleATOHigh. Depending on which ATO switch you are using, depends on which function you call. Regardless, both functions work like this:
- Switch mounted with 2 wires at top.
- Water level with the float at the top is the starting point.
- When the water level drops, the float drops to the bottom which causes the switch to be active (float is touching the end opposite from the 2 wires). The ATO pump / relay is turned on.
- It pumps in water until the float is not active (touching the top end which has the 2 wires) OR until the timeout value has exceeded. Then the pump shuts off.
- The hour interval just means that the ATO pump can only be activated once every X (specified) hours. This is to prevent it from activating too many times. You don't have to specify this if you don't want to. You can safely put in 0 and the ATO pump will activate as often as it needs.
- Repeat process
Code: Select all
ReefAngel.SingleATOLow(1, 60, 1);
- Use the LOW switch
- Activate Port 1
- Use a 60 second timeout where if it runs for more than 60 seconds, the timeout will signal an error with the ATO flag, turn on the red light and shut off port 1
- Can only top off 1 time no more than 1 hour apart. This means that no matter when the ATO triggers, once it runs it cannot run again for at least 1 hour. This is based off of the last time it ran, so this can fluctuate throughout the day. NOTE: If you place a 0 here instead, the function will activate the ATO port as often as needed.
Code: Select all
ReefAngel.SingleATOHigh(1, 60, 1);
Code: Select all
// LOW Switch
ReefAngel.SingleATOLow(1);
// HIGH Switch
ReefAngel.SingleATOHigh(1);
Internal Memory Locations
The timeout value is stored in the ATOExtendedTimeout location. It is an integer value which means it can be from 0 to 32767. The value stored is referenced in seconds. So the maximum value to use is 32767 seconds (which is approximately 546 minutes or approximately 9 hours). This location is 276 using libraries 1.0 and later (or 876 using pre 1.0 libraries).
The hour interval is stored in the ATOHourInterval location. It is a byte value. It can contain 0 to 24 hours. The location is 240 using libraries 1.0 and later (or 840 using pre 1.0 libraries).
As of 0.8.5.15, the SingleATO code functions like explained above. For all dev libraries prior to 0.8.5.15, the float switch was mounted the opposite way (2 wires at the bottom).
The StandardATO function has operated the same on all versions of the dev libraries and all versions of the standard libraries.
Hopefully this will clarify all confusions that may exist with the ATO functionality.
curt