Float to cut off ato pump when low

Do you have a question on how to do something.
Ask in here.
Post Reply
JDP1130
Posts: 14
Joined: Thu Mar 20, 2014 1:59 pm

Float to cut off ato pump when low

Post by JDP1130 »

So i got a few other issues out the way and im moving on to the next. I want to use one of the float switchs to shut off my ato pump when its low. i tried to use the code below i took from another topic with no luck. Ideas?

if(ReefAngel.HighATO.IsActive())
{
ReefAngel.Relay.Override(Port8, 0);
}
else
{
ReefAngel.Relay.On(Port8);
}
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Float to cut off ato pump when low

Post by lnevo »

Did you try flipping the switch? It should work. Post your full code.
JDP1130
Posts: 14
Joined: Thu Mar 20, 2014 1:59 pm

Re: Float to cut off ato pump when low

Post by JDP1130 »

When i change terminals neither switch works

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 
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port3Bit | Port4Bit | Port8Bit;
    ReefAngel.FeedingModePortsE[0] = Port1Bit | Port8Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port8Bit;
    ReefAngel.WaterChangePortsE[0] = Port1Bit | Port8Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    ReefAngel.LightsOnPortsE[0] = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit | Port3Bit;
    ReefAngel.OverheatShutoffPortsE[0] = Port1Bit | Port5Bit | Port8Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 820 );


    // Ports that are always on
    ReefAngel.Relay.On( Port1 );
    ReefAngel.Relay.On( Port4 );
    ReefAngel.Relay.On( Box1_Port2 );
    ReefAngel.Relay.On( Box1_Port3 );
    ReefAngel.Relay.On( Box1_Port5 );
    ReefAngel.Relay.On( Box1_Port6 );
    ReefAngel.Relay.On( Box1_Port7 );
    ////// Place additional initialization code below here
ReefAngel.CustomLabels[0]="RETURN";  
ReefAngel.CustomLabels[1]="HEATER";  
ReefAngel.CustomLabels[2]="SKIMMER";  
ReefAngel.CustomLabels[3]="WP 10";  
ReefAngel.CustomLabels[4]="ACTINICS";  
ReefAngel.CustomLabels[5]="DAY LIGHTS";  
ReefAngel.CustomLabels[6]="FAN";  
ReefAngel.CustomLabels[7]="ATO";
ReefAngel.CustomLabels[8]="UV";
ReefAngel.CustomLabels[9]="DP-4";
ReefAngel.CustomLabels[10]="FUGE LIGHT";
ReefAngel.CustomLabels[11]= "LEDS";
ReefAngel.CustomLabels[12]="UNUSED";
ReefAngel.CustomLabels[13]="UNUSED";
ReefAngel.CustomLabels[14]="GYRE";
ReefAngel.CustomLabels[15]="Reactor";

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

void loop()
{
    ReefAngel.StandardHeater( Port2,770,790 );
    ReefAngel.Relay.DelayedOn( Port3,10 );
    ReefAngel.StandardLights( Port5,10,0,21,0 );
    ReefAngel.StandardLights( Port6,12,0,19,30 );
    ReefAngel.StandardFan( Port7,790,800 );
    ReefAngel.SingleATO( true,Port8,1440,0 );
    ReefAngel.StandardLights( Box1_Port4,9,0,23,0 );
    ReefAngel.StandardLights( Box1_Port8,6,0,22,0 );
    ReefAngel.PWM.SetDaylight( MoonPhase() );
    ReefAngel.PWM.SetActinic( MoonPhase() );
    ////// Place your custom code below here
    if (hour()>=10 && hour()<19) ReefAngel.Relay.Off(Box1_Port4);

if(ReefAngel.HighATO.IsActive())
{
ReefAngel.Relay.Override(Port8, 0);
}
else
{
ReefAngel.Relay.On(Port8);
}
    ////// Place your custom code above here
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Float to cut off ato pump when low

Post by lnevo »

No i meant if you manually trip the switch
JDP1130
Posts: 14
Joined: Thu Mar 20, 2014 1:59 pm

Re: Float to cut off ato pump when low

Post by JDP1130 »

And the same results apply. Don't work. I changed high n low as well. Didn't respond as intended.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Float to cut off ato pump when low

Post by lnevo »

Do you see the switch change in portal or app or of you having it display on the screen?
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Float to cut off ato pump when low

Post by lnevo »

The next steps if you cofirm the switch is registering as intended then you need some debug code to see why your not getting into that if statement and monitor in serial monitor
Post Reply