HW cut off for Skimmer

Do you have a question on how to do something.
Ask in here.
Post Reply
Seagals
Posts: 127
Joined: Wed Aug 01, 2012 7:06 am

HW cut off for Skimmer

Post 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();
}
KRavEN
Posts: 104
Joined: Sun Mar 17, 2013 8:21 am

Re: HW cut off for Skimmer

Post 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.
Seagals
Posts: 127
Joined: Wed Aug 01, 2012 7:06 am

Re: HW cut off for Skimmer

Post 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.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: HW cut off for Skimmer

Post by lnevo »

+1 take a look at the CheckSwitches function in my ino for examples
Seagals
Posts: 127
Joined: Wed Aug 01, 2012 7:06 am

Re: HW cut off for Skimmer

Post 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.
Seagals
Posts: 127
Joined: Wed Aug 01, 2012 7:06 am

Re: HW cut off for Skimmer

Post 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);
}
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: HW cut off for Skimmer

Post by rimai »

That's what I use too :)
In addition, I set HighATO trigger in the portal to send me an email notification.
Roberto.
Naptalene
Posts: 98
Joined: Tue Nov 05, 2013 12:50 am

Re: HW cut off for Skimmer

Post by Naptalene »

+1 :)
Believe it or not.... I can ask even stupider questions than this one.
Reefology
Posts: 209
Joined: Fri Dec 26, 2014 6:38 pm

Re: HW cut off for Skimmer

Post 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?
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: HW cut off for Skimmer

Post by rimai »

Just choose ATO High equals 1 or 0 depending on how you orient the float.
Roberto.
Reefology
Posts: 209
Joined: Fri Dec 26, 2014 6:38 pm

Re: HW cut off for Skimmer

Post by Reefology »

tried both, doesn't work for me?
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: HW cut off for Skimmer

Post 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.
Roberto.
Reefology
Posts: 209
Joined: Fri Dec 26, 2014 6:38 pm

Re: HW cut off for Skimmer

Post by Reefology »

i did at least15 mins each attempt, thats not the issue. any other ideas?
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: HW cut off for Skimmer

Post by rimai »

Are other alerts working?
Roberto.
Reefology
Posts: 209
Joined: Fri Dec 26, 2014 6:38 pm

Re: HW cut off for Skimmer

Post by Reefology »

Yes
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: HW cut off for Skimmer

Post by rimai »

Not sure what is wrong....
Did yo also try >0 instead of = 1??
Roberto.
Reefology
Posts: 209
Joined: Fri Dec 26, 2014 6:38 pm

Re: HW cut off for Skimmer

Post by Reefology »

still nothing?!

does =1 mean ATO high is active? because my skimmer shuts down and ato high status light changes to green.
Image
Reefology
Posts: 209
Joined: Fri Dec 26, 2014 6:38 pm

Re: HW cut off for Skimmer

Post 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
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: HW cut off for Skimmer

Post 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.
Roberto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: HW cut off for Skimmer

Post by rimai »

Another test
Roberto.
Reefology
Posts: 209
Joined: Fri Dec 26, 2014 6:38 pm

Re: HW cut off for Skimmer

Post 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.
Image
Post Reply