Page 1 of 1

HW cut off for Skimmer

Posted: Tue Jan 14, 2014 10:14 am
by Seagals
I would like to add a high water cutoff to my skimmate collection tank to prevent overflows. Can someone please verify the following code is correct. I am not a wiz at coding I tried to copy a LW cutoff code given I currently have. but it doesn't seem to be working. My skimmer is on Port 1. I am not sure if its not working because port 1 is on a low water cut off float and thinking maybe I am confusing it?

here's what I did a added a high water cutoff on menu, added menu 7 label, but their is already another label '7' in the color section??, you will see the area I am referring to in all CAPS, also switched lowATO to HIGHATO...is that correct??-
Would someone be able to please review the following high water cut off for me and please lmk where I went wrong?


Thanks in advance.

#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Salinity.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <ReefAngel.h>

////// Place global variable code below here
#include <avr/pgmspace.h>
prog_char menu0_label[] PROGMEM = "Feeding";
prog_char menu1_label[] PROGMEM = "Water Change";
prog_char menu2_label[] PROGMEM = "ATO Clear";
prog_char menu3_label[] PROGMEM = "Overheat Clear";
prog_char menu4_label[] PROGMEM = "PH Calibration";
prog_char menu5_label[] PROGMEM = "Version";
prog_char menu6_label[] PROGMEM = "Clear Low Water";
prog_char menu7_label[] PROGMEM = "Clear Skimmate High Water";
PROGMEM const char *menu_items[] = {
menu0_label, menu1_label, menu2_label, menu3_label, menu4_label, menu5_label, menu6_label, menu7_label, };

void MenuEntry1()
{
ReefAngel.FeedingModeStart();

}
void MenuEntry2()
{
ReefAngel.WaterChangeModeStart();

}
void MenuEntry3()
{
ReefAngel.ATOClear();
ReefAngel.DisplayMenuEntry("Clear ATO Timeout");
}
void MenuEntry4()
{
ReefAngel.OverheatClear();
ReefAngel.DisplayMenuEntry("Clear Overheat");
}
void MenuEntry5()
{
ReefAngel.SetupCalibratePH();
ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;

}
void MenuEntry6()
{
ReefAngel.DisplayVersion();

}
void MenuEntry7()
{
ReefAngel.Relay.RelayMaskOff=255;NOT SURE WHAT TO DO HERE DOES THIS NOW BECOME MENUENTRY8- WHAT IS IT FOR???
}


////// Place global variable code above here


void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port1Bit | Port5Bit | Port6Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port7Bit | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port2Bit | Port3Bit | Port4Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 850 );


// Ports that are always on
ReefAngel.Relay.On( Port1 );//Protien Skimmer
ReefAngel.Relay.On( Port7 );//Chiller
ReefAngel.Relay.On( Port8 );//Main pump

////// Place additional initialization code below here
ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])),SIZE(menu_items));


////// Place additional initialization code above here
}

void loop()
{
ReefAngel.StandardLights( Port2,9,0,21,30 );
ReefAngel.StandardLights( Port3,11,0,20,30 );
ReefAngel.StandardLights( Port4,9,0,21,30 );
ReefAngel.Wavemaker( Port5,960 );
ReefAngel.Relay.Set( Port6, !ReefAngel.Relay.Status( Port5 ) );
ReefAngel.PWM.SetDaylight( PWMSlope(11,0,20,25,5,70,120,5) );
ReefAngel.PWM.SetActinic( PWMSlope(9,0,21,30,15,88,60,20) );
////// Place your custom code below here
static unsigned long lastATOCheck=millis();

ReefAngel.ReverseATOLow();

if (ReefAngel.LowATO.IsActive()) lastATOCheck=millis();
if (ReefAngel.LowATO.IsActive() && (millis()-lastATOCheck>2000)) ReefAngel.Relay.RelayMaskOff&=~(Port8Bit | Port7Bit | Port1Bit);
if ( (hour()>=8 && hour()<20))//wavemakers on at 8am and off at 8pm
{
static unsigned long nexttoggle=now();
static boolean state=false;
int cycle=nexttoggle-now();
ReefAngel.Relay.Set(Port5,state);
ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5));
if (cycle<0)
{
nexttoggle+=random(960,1020);//tunzes on for 15-16 mins
state=!state;
}
if (cycle<10)//10 sec overlap
{
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.On(Port6);
}
}
else
{
ReefAngel.Relay.Off(Port5);
ReefAngel.Relay.Off(Port6);
}
static unsigned long lastATOCheck=millis();

ReefAngel.ReverseATOHigh();

if (ReefAngel.HighATO.IsActive()) lastATOCheck=millis();
if (ReefAngel.HighATO.IsActive() && (millis()-lastATOCheck>2000)) ReefAngel.Relay.RelayMaskOff&=~(Port1Bit);
////// Place your custom code above here

// This should always be the last line
ReefAngel.Portal( "Seagals" );
ReefAngel.ShowInterface();
}

Re: HW cut off for Skimmer

Posted: Tue Jan 14, 2014 7:03 pm
by KRavEN
Could also do a standalone cutoff pretty cheaply. I made mine with an old AC usb charger I tore apart to get 5v DC from 120v AC. Then I hooked that up to one of the cheap single 5v relay boards you can get on ebay and a float switch. Put it all inside some PVC pipe with 2 end caps on each side and some silicone. Total cost less than $5.

Re: HW cut off for Skimmer

Posted: Wed Jan 15, 2014 8:27 am
by Seagals
True, but I bought this controller to eliminate all the diy and wall warts, etc. I would like to expand the use of controller with all the add ons but I just cant grasp the coding aspect of the controller which makes it frustrating.

I tried re coding it and each time I compile I get a different error.

Re: HW cut off for Skimmer

Posted: Wed Jan 15, 2014 8:40 am
by lnevo
+1 take a look at the CheckSwitches function in my ino for examples

Re: HW cut off for Skimmer

Posted: Wed Jan 15, 2014 9:37 am
by Seagals
Thanks Lee, Nice write up and great stuff but I just don't get coding - I can try to cut and paste your codes into mine but I still don't get coding and don't know if I am doing it right. I have the system working the way I want it and I just wanted to add a high water cut off code to existing code to prevent a potential problem.

Re: HW cut off for Skimmer

Posted: Wed Jan 15, 2014 12:13 pm
by Seagals
I found a simple code on the site if any one needs it:

if(ReefAngel.HighATO.IsActive())
{
ReefAngel.Relay.Off(Port2);
}
else
{
ReefAngel.Relay.On(Port2);
}

Re: HW cut off for Skimmer

Posted: Wed Jan 15, 2014 12:20 pm
by rimai
That's what I use too :)
In addition, I set HighATO trigger in the portal to send me an email notification.

Re: HW cut off for Skimmer

Posted: Sat Jan 18, 2014 2:04 pm
by Naptalene
+1 :)

Re: HW cut off for Skimmer

Posted: Sun Feb 06, 2022 12:29 pm
by Reefology
rimai wrote:That's what I use too :)
In addition, I set HighATO trigger in the portal to send me an email notification.
How do you set this trigger?

Re: HW cut off for Skimmer

Posted: Sun Feb 06, 2022 3:35 pm
by rimai
Just choose ATO High equals 1 or 0 depending on how you orient the float.

Re: HW cut off for Skimmer

Posted: Sun Feb 06, 2022 10:05 pm
by Reefology
tried both, doesn't work for me?

Re: HW cut off for Skimmer

Posted: Mon Feb 07, 2022 3:32 pm
by rimai
Did you wait at least 5 minutes to enable the controller to send data.
The controller only sends data to the portal every 5 minutes.

Re: HW cut off for Skimmer

Posted: Tue Feb 08, 2022 1:22 pm
by Reefology
i did at least15 mins each attempt, thats not the issue. any other ideas?

Re: HW cut off for Skimmer

Posted: Tue Feb 08, 2022 5:25 pm
by rimai
Are other alerts working?

Re: HW cut off for Skimmer

Posted: Tue Feb 08, 2022 5:54 pm
by Reefology
Yes

Re: HW cut off for Skimmer

Posted: Thu Feb 10, 2022 10:50 pm
by rimai
Not sure what is wrong....
Did yo also try >0 instead of = 1??

Re: HW cut off for Skimmer

Posted: Fri Feb 11, 2022 9:36 pm
by Reefology
still nothing?!

does =1 mean ATO high is active? because my skimmer shuts down and ato high status light changes to green.

Re: HW cut off for Skimmer

Posted: Wed Feb 16, 2022 7:40 pm
by Reefology
now i'm not getting any email notifications? Can I please get some help with this?

what's funny is the portal notifications show the last time triggered but no email was sent?

thanks

Re: HW cut off for Skimmer

Posted: Fri Feb 25, 2022 12:12 pm
by rimai
I am checking the mailbox that sends the emails and I do see emails sent to you, including the ATO High Port = 0.
The last alert was sent about 3 days ago of having pH lower than what you had set.

Re: HW cut off for Skimmer

Posted: Fri Feb 25, 2022 12:27 pm
by rimai
Another test

Re: HW cut off for Skimmer

Posted: Fri Feb 25, 2022 2:27 pm
by Reefology
thanks for looking into this for me Roberto. I have been testing multiple triggers everyday for the past week and did get the two messages you mentioned. problem is those are the only 2 I received.

That ATO High Port =0 triggered every hour for 4 days before I got the email, I have no idea why it took so long to send the email? I have since deleted it.

The ph trigger was raised to < 8.2 in order to have it trigger each day.