Page 1 of 1

Setup -Single ATO Low

Posted: Fri Jan 13, 2012 1:57 pm
by rschneider77
Hi,

I've been reading a LOT about the ATO function but can only find information about the Standard ATO setup. I'm currently just wanting to setup my single ATO switch (for low) for 30s timeout and to check every 2 hours. When using RAGen I selected the option and chose 30s (timeout) 2h (interval).

Q1) I couldn't find where this "coding" was added, so I could potentially alter it in the future. I tried the internal memory file, .pde, .h, .cpp, etc. Where is it located?

Q2)I did however find two ways of addressing this, I think. What's the difference between these two setups, and which should i use? (I found these in the forums).

[Example 1]

...void loop()
{
// Specific functions
ReefAngel.SingleATOLow(Port2);

// ATO available 6 times per day - 00:00 to 01:00, 04:00 to 05:00, 08:00 to 09:00, 12:00 to 13:00, 16:00 to 17:00, 20:00 to 21:00,

if (hour() % 4 == 0 && ReefAngel.LowATO.IsActive()) //Rev made 19/11/11
{
ReefAngel.Relay.On(Port2);
}
else
{
ReefAngel.Relay.Off(Port2);
}...

[Example 2]

ReefAngel.SingleATO(bool bLow, byte ATORelay, byte byteTimeout, byte byteHrInterval);

Code: Select all

// Autogenerated file by RAGen (v1.1.0.126), (01/13/2012 14:29)
// RA_011312_1429.pde
//
// This version designed for v0.8.5 Beta 17 or later

/* The following features are enabled for this PDE File: 
#define DisplayImages
#define WavemakerSetup
#define DateTimeSetup
#define VersionMenu
#define ATOSetup
#define SingleATOSetup
#define StandardLightSetup
#define ENABLE_ATO_LOGGING
*/


#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel.h>

#define LightFront         1
#define LightBack          2
#define Moonlight          3
#define Refugium           4
#define Return             5
#define FlowPump           6
#define AutoTopOff         7
//#define Port8            8

void setup()
{
    ReefAngel.Init();  //Initialize controller
    ReefAngel.LCD.SetContrast(60);  // Set contrast to 60
    ReefAngel.Relay.On(Return);  //Turn Return on at startup
    
    ReefAngel.FeedingModePorts = B00110000;
    ReefAngel.WaterChangePorts = B01110000;
    ReefAngel.OverheatShutoffPorts = B00000011;
    ReefAngel.LightsOnPorts = B00001111;

    // Ports that are always on
    ReefAngel.Relay.On(Port8);
}

void loop()
{
    //ReefAngel.StandardGUI();  //-HAVING TROUBLE WITH THIS- Dont know if I need it, but just realized it never compiles properly even when using basic code.
    //ReefAngel.SingleATO(bool bLow, byte ATORelay, byte byteTimeout, byte byteHrInterval);  //Setup AutoTopOff as Auto Top-Off function with 30s timeout, and check every 2 hours.
    ReefAngel.StandardLights(LightFront, 7, 30, 17, 30);  //T5 Front schedule 7:30am - 5:30pm
    ReefAngel.StandardLights(LightBack, 9, 30, 19, 30);  //T5 Back schedule 9:30am - 7:30pm
    ReefAngel.StandardLights(Moonlight, 6, 30, 20, 30);  //Moonlight schedule 6:30am - 8:30am
    ReefAngel.StandardLights(Moonlight, 18, 30, 20, 30);  //Moonlight schedule 6:30pm - 8:30pm
    ReefAngel.StandardLights(Refugium, 19, 30, 7, 0);  //Refugium schedule 7:30am - 7:00pm
    ReefAngel.Wavemaker1(Return);  //Return Pump
    ReefAngel.Wavemaker2(FlowPump);  //Flow Pump
    //ReefAngel.StandardHeater(Heater,785,810);  // Setup Heater to turn on at 78.5F and off at 81.0F -NOT IN USE-
    //ReefAngel.StandardFan(Chiller,810,785);  // Setup Chiller to turn on at 81.0F and off at 78.5F -NOT IN USE-
    ReefAngel.Relay.Write();  // Make relay changes effective

      ReefAngel.ShowInterface();  
}
Thanks,

Chris Schneider

Re: Setup -Single ATO Low

Posted: Fri Jan 13, 2012 2:17 pm
by rimai
If we made so the ATO would work only on even hours and would have 30s timeout, would this work for you?

Re: Setup -Single ATO Low

Posted: Fri Jan 13, 2012 2:24 pm
by rschneider77
rimai wrote:If we made so the ATO would work only on even hours and would have 30s timeout, would this work for you?
sure

Re: Setup -Single ATO Low

Posted: Fri Jan 13, 2012 2:30 pm
by rimai
Actually, I think you were in the right path.
Forget what I said.
Curt has it coded the way you wanted initially.

Code: Select all

ReefAngel.SingleATO(true,Port1,30,2);
Let's wait for him to see what he says about it.

Re: Setup -Single ATO Low

Posted: Sat Jan 14, 2012 1:39 pm
by binder
The way the SingleATO function works is like this: (exert from http://forum.reefangel.com/viewtopic.php?f=7&t=240)

The hour interval just means that the ATO Switch can only activate 1 time in that hour interval and run for a maximum of the timeout value. It doesn't just check every XX hour interval. It bases it off the time in which it last topped off. It continues to monitor the water level and when the switch is activated (told to turn on the pump), it checks when the previous time it ran was. If the previous run time was within the hour interval, it won't run again until that hour interval is up. It ends up being a rotating cycle/interval.

How Roberto has it coded should work like you want it to work.

With all that being said, the code that does all this is located in the ReefAngel.cpp file inside the libraries folder.

Re: Setup -Single ATO Low

Posted: Wed Jan 25, 2012 10:56 am
by rschneider77
I got the single ATO working correctly. Thank you. But this morning I got up and the lights were not on. I had to unplug the serial cable from the controller and plug it back in for the lights to work right. What happened?

Bob

Re: Setup -Single ATO Low

Posted: Wed Jan 25, 2012 11:01 am
by rimai
Make sure to enable WDT feature.