use float switch to turn skimmer off and add clouds

Do you have a question on how to do something.
Ask in here.
Post Reply
CBRpilot
Posts: 15
Joined: Thu Mar 19, 2015 12:05 pm

use float switch to turn skimmer off and add clouds

Post by CBRpilot »

I have a RA plus with wifi and salinity.

I have had it running very well for a little better than a year, now I wanted to start playing with it. I'm trying to add code for clouds with standard dimming (pretty easy for you pros)
also would like to use the float switches to turn skimmer off (skimmate locker) or turn GFO reactor off when activated (have a container under it so float switch activated would indicate a leak) both are on port 2.

i'll try and post the code I'm working on in next post. it has skimmer and ATO delayed and feeding at 7pm, otherwise pretty basic.

Thanks for the help in advance.

Code: Select all

[quote]
#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <[color=#CC6600]Wire[/color].h>
#include <[color=#CC6600]OneWire[/color].h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <[color=#006699]LED[/color].h>
#include <RA_TempSensor.h>
#include <[color=#006699]Relay[/color].h>
#include <RA_PWM.h>
#include <[color=#006699]Timer[/color].h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <[color=#006699]Salinity[/color].h>
#include <[color=#006699]RF[/color].h>
#include <[color=#006699]IO[/color].h>
#include <[color=#006699]ORP[/color].h>
#include <[color=#006699]AI[/color].h>
#include <[color=#006699]PH[/color].h>
#include <[color=#006699]WaterLevel[/color].h>
#include <[color=#006699]Humidity[/color].h>
#include <[color=#006699]DCPump[/color].h>
#include <[color=#006699]PAR[/color].h>
#include <[color=#CC6600]ReefAngel[/color].h>

[color=#7E7E7E]////// Place global variable code below here[/color]


[color=#7E7E7E]////// Place global variable code above here[/color]


[color=#CC6600]void[/color] [color=#CC6600][b]setup[/b][/color]()
{
    [color=#7E7E7E]// This must be the first line[/color]
    [color=#CC6600]ReefAngel[/color].[color=#CC6600]Init[/color]();  [color=#7E7E7E]//Initialize controller[/color]
    [color=#CC6600]ReefAngel[/color].[color=#CC6600]Use2014Screen[/color]();  [color=#7E7E7E]// Let's use 2014 Screen [/color]
    [color=#CC6600]ReefAngel[/color].[color=#CC6600]AddSalinityExpansion[/color]();  [color=#7E7E7E]// Salinity Expansion Module[/color]
    [color=#7E7E7E]// Ports toggled in Feeding Mode[/color]
    [color=#CC6600]ReefAngel[/color].[color=#006699]FeedingModePorts[/color] = [color=#006699]Port1Bit[/color] | [color=#006699]Port2Bit[/color] | [color=#006699]Port7Bit[/color];
    [color=#7E7E7E]// Ports toggled in Water Change Mode[/color]
    [color=#CC6600]ReefAngel[/color].[color=#006699]WaterChangePorts[/color] = [color=#006699]Port1Bit[/color] | [color=#006699]Port2Bit[/color] | [color=#006699]Port7Bit[/color];
    [color=#7E7E7E]// Ports toggled when Lights On / Off menu entry selected[/color]
    [color=#CC6600]ReefAngel[/color].[color=#006699]LightsOnPorts[/color] = [color=#006699]Port3Bit[/color] | [color=#006699]Port4Bit[/color];
    [color=#7E7E7E]// Ports turned off when Overheat temperature exceeded[/color]
    [color=#CC6600]ReefAngel[/color].[color=#006699]OverheatShutoffPorts[/color] = [color=#006699]Port5Bit[/color];
    [color=#7E7E7E]// Use T1 probe as temperature and overheat functions[/color]
    [color=#CC6600]ReefAngel[/color].[color=#006699]TempProbe[/color] = [color=#006699]T1_PROBE[/color];
    [color=#CC6600]ReefAngel[/color].[color=#006699]OverheatProbe[/color] = [color=#006699]T1_PROBE[/color];


    [color=#7E7E7E]// Ports that are always on[/color]
    [color=#CC6600]ReefAngel[/color].[color=#006699]Relay[/color].[color=#CC6600]On[/color]( [color=#006699]Port1[/color] );

    [color=#7E7E7E]////// Place additional initialization code below here[/color]
    

    [color=#7E7E7E]////// Place additional initialization code above here[/color]
}

[color=#CC6600]void[/color] [color=#CC6600]loop[/color]()
{
    [color=#CC6600]ReefAngel[/color].[color=#006699]Relay[/color].[color=#CC6600]DelayedOn[/color]( [color=#006699]Port2[/color] );
    [color=#CC6600]ReefAngel[/color].[color=#CC6600]DayLights[/color]( [color=#006699]Port3[/color] );
    [color=#CC6600]ReefAngel[/color].[color=#CC6600]ActinicLights[/color]( [color=#006699]Port4[/color] );
    [color=#CC6600]ReefAngel[/color].[color=#CC6600]StandardHeater[/color]( [color=#006699]Port5[/color] );
    [color=#CC6600]ReefAngel[/color].[color=#CC6600]Wavemaker1[/color]( [color=#006699]Port6[/color] );
    [color=#CC6600]ReefAngel[/color].[color=#006699]Relay[/color].[color=#CC6600]DelayedOn[/color]( [color=#006699]Port7[/color] );
    [color=#CC6600]ReefAngel[/color].[color=#CC6600]MoonLights[/color]( [color=#006699]Port8[/color] );
    [color=#CC6600]ReefAngel[/color].[color=#006699]PWM[/color].[color=#CC6600]DaylightPWMParabola[/color]();
    [color=#CC6600]ReefAngel[/color].[color=#006699]PWM[/color].[color=#CC6600]ActinicPWMParabola[/color]();
    [color=#7E7E7E]////// Place your custom code below here[/color]
    

    [color=#7E7E7E]////// Place your custom code above here[/color]
[color=#CC6600]if[/color]([color=#CC6600]hour[/color]()==19 && [color=#CC6600]minute[/color]()==0 && [color=#CC6600]second[/color]()==0) [color=#CC6600]ReefAngel[/color].[color=#CC6600]FeedingModeStart[/color]();
    [color=#7E7E7E]// This should always be the last line[/color]
    [color=#CC6600]ReefAngel[/color].[color=#CC6600]Portal[/color]( [color=#006699]"CBRpilot"[/color] );
    [color=#CC6600]ReefAngel[/color].[color=#CC6600]DDNS[/color]( [color=#006699]"mccurryair.mynetgear.com"[/color] ); [color=#7E7E7E]// Your DDNS is CBRpilot-mccurryair.mynetgear.com.myreefangel.com[/color]
    [color=#CC6600]ReefAngel[/color].[color=#CC6600]ShowInterface[/color]();
}



[/quote]
Image
CBRpilot
Posts: 15
Joined: Thu Mar 19, 2015 12:05 pm

Re: use float switch to turn skimmer off and add clouds

Post by CBRpilot »

how does this code look? will my delay on startup/feeding and water change still be in effect? it has everything but clouds....I'm still searching for that code



[/quote][/code]

Code: Select all

#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 <PH.h>
#include <WaterLevel.h>
#include <Humidity.h>
#include <DCPump.h>
#include <PAR.h>
#include <ReefAngel.h>

////// Place global variable code below here


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


void setup()
{
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    ReefAngel.Use2014Screen();  // Let's use 2014 Screen 
    ReefAngel.AddSalinityExpansion();  // Salinity Expansion Module
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port1Bit | Port2Bit | Port6Bit | Port7Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port7Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port3Bit | Port4Bit | Port6Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port5Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;


    // Ports that are always on
    ReefAngel.Relay.On( Port1 );
    ReefAngel.Relay.On( Port6 );

    ////// Place additional initialization code below here
    

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

void loop()
{
    ReefAngel.Relay.DelayedOn( Port2 );
    ReefAngel.DayLights( Port3 );
    ReefAngel.DayLights( Port4 );
    ReefAngel.StandardHeater( Port5 );
    ReefAngel.Relay.DelayedOn( Port7 );
    ReefAngel.MoonLights( Port8 );
    ReefAngel.PWM.DaylightPWMParabola();
    ReefAngel.PWM.ActinicPWMParabola();
    ////// Place your custom code below here 
    
ReefAngel.Relay.Set(Port2, ReefAngel.LowATO.IsActive() && ReefAngel.HighATO.IsActive());
  
if(hour()==19 && minute()==0 && second()==0) ReefAngel.FeedingModeStart();
    ////// Place your custom code above here

    // This should always be the last line
    ReefAngel.Portal( "CBRpilot" );
    ReefAngel.DDNS( "mccurryair.mynetgear.com" ); // Your DDNS is CBRpilot-mccurryair.mynetgear.com.myreefangel.com
    ReefAngel.ShowInterface();
Image
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: use float switch to turn skimmer off and add clouds

Post by cosmith71 »

Your delayed start will be overwritten by this line:

Code: Select all

ReefAngel.Relay.Set(Port2, ReefAngel.LowATO.IsActive() && ReefAngel.HighATO.IsActive());
Which if I'm understanding right, needs to be changed. You want either to turn off the relay, correct? Should be something like this.

Code: Select all

ReefAngel.Relay.Set(Port2, ReefAngel.LowATO.IsActive() || ReefAngel.HighATO.IsActive());
Float switch logic always confuses me. You may have to flip the logic by changing it to !ReefAngel.HighATO.IsActive().

--Colin
CBRpilot
Posts: 15
Joined: Thu Mar 19, 2015 12:05 pm

Re: use float switch to turn skimmer off and add clouds

Post by CBRpilot »

I may have to figure something else out then, I have to have delayed start or I'm sure the skimmer will be skimming way too wet (I haven't had an issue with overflowing skimmate locker but I had an extra float switch). I may have to find another port for the reactor, maybe do away with the fuge light as my macro hasn't really been growing anyway. back to the drawing boards,

thanks for the help Colin! i'll have time to play with it later this week, i'll let you know how it goes.
Image
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: use float switch to turn skimmer off and add clouds

Post by cosmith71 »

You could always use a regular old timer plugged into a power strip for the fuge light. :D

--Colin
Post Reply