ATO port stuck on! Flooded my sump =(

Share you PDE file with our community

Posts: 51
Joined: Mon Nov 19, 2012 9:22 pm
PostPosted: Sun Jun 30, 2013 7:15 pm
I updated my libraries to the latest, but my subsequent code wouldn't fit, so I downgraded the libraries to 1.03... which I assume was the original version I had.

So after I downgrade the libraries and uploaded my minor change in code, My top off port came on and flooded my sump. I didn't change any of my ATO code. I'm not sure why it's always ON now. I'm using a single ATO (low) and using the ATO high as backup. Both show as red dots in my portal page, but my ATO port is green (on).

Can anyone tell me what I'm doing wrong?

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 <ReefAngel.h>
/*
// ports by name
#define halide 1
#define actinics 2
#define mainPump 3
#define skimmer 4
#define pump1 5
#define pump2 6
#define doser1 7
#define doser2 8

#define ato Box1_Port1
#define gfo Box1_Port2
#define unused3 Box1_Port3
#define unused4 Box1_Port4
#define pump3 Box1_Port5
#define pump4 Box1_Port6
#define heater1 Box1_Port7
#define heater2 Box1_Port8
*/

#define halide 1
#define actinics 2
#define unused3 3
#define unused4 4
#define pump1 5 // off
#define pump4 6 // off
#define doser1 7
#define doser2 8

#define ato Box1_Port1
#define heater1 Box1_Port2
#define skimmer Box1_Port3
#define heater2 Box1_Port4
#define pump2 Box1_Port5
#define pump3 Box1_Port6
#define gfo Box1_Port7
#define mainPump Box1_Port8

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


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


void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller


// Ports toggled in Feeding Mode
// mainPump, skimmer, pump2, pump3, ato, gfo
ReefAngel.FeedingModePorts = Port5Bit | Port6Bit;
ReefAngel.FeedingModePortsE[0] = Port1Bit | Port3Bit | Port7Bit | Port8Bit;

// Ports toggled in Water Change Mode
// mainPump, Skimmer, all 4 pumps, all 2 dosers, ato, gfo
ReefAngel.WaterChangePorts = Port7Bit | Port8Bit;
ReefAngel.WaterChangePortsE[0] = Port1Bit | Port3Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;

// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port1Bit | Port2Bit;
ReefAngel.LightsOnPortsE[0] = 0;

// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port1Bit;
ReefAngel.OverheatShutoffPortsE[0] = Port2Bit;

// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;


// Ports that are always on
// ReefAngel.Relay.On( mainPump );
ReefAngel.Relay.On( skimmer );
ReefAngel.Relay.Off( pump1 );
ReefAngel.Relay.On( pump2 );
ReefAngel.Relay.On( pump3 );
ReefAngel.Relay.Off( pump4 );
ReefAngel.Relay.On( gfo );
ReefAngel.Relay.Off( unused3 );
ReefAngel.Relay.Off( unused4 );

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

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

void loop()
{
ReefAngel.DayLights( halide );
ReefAngel.ActinicLights( actinics );
ReefAngel.DosingPumpRepeat1( doser1 );
ReefAngel.DosingPumpRepeat2( doser2 );
// ReefAngel.StandardATO( ato );
ReefAngel.StandardHeater( heater1 );
ReefAngel.StandardHeater( heater2 );
ReefAngel.PWM.DaylightPWMParabola();
ReefAngel.PWM.ActinicPWMParabola();
////// Place your custom code below here

// set single ato

ReefAngel.SingleATO(true,ato,60,0);
if (ReefAngel.HighATO.IsActive()) ReefAngel.Relay.Off(ato);

ReefAngel.Relay.DelayedOn( skimmer );
ReefAngel.Relay.DelayedOn( ato );
ReefAngel.Relay.DelayedOn( gfo );


////// Place your custom code above here

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

void DrawCustomMain()
{
int x,y;
char text[10];
// Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 62, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 62, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
pingSerial();

// Main Relay Box
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox( 12, 93, TempRelay );
pingSerial();

// Relay Expansion
TempRelay = ReefAngel.Relay.RelayDataE[0];
TempRelay &= ReefAngel.Relay.RelayMaskOffE[0];
TempRelay |= ReefAngel.Relay.RelayMaskOnE[0];
ReefAngel.LCD.DrawOutletBox( 12, 107, TempRelay );
pingSerial();

// Date and Time
ReefAngel.LCD.DrawDate( 6, 122 );
pingSerial();
}

void DrawCustomGraph()
{
ReefAngel.LCD.DrawGraph( 5, 5 );
}

Posts: 12272
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Sun Jun 30, 2013 7:25 pm
You should remove this:
Code: Select all
ReefAngel.Relay.DelayedOn( ato );

This line will turn on your ato port after the delay and it will never turn off.
Roberto.

Posts: 51
Joined: Mon Nov 19, 2012 9:22 pm
PostPosted: Sun Jun 30, 2013 7:32 pm
rimai wrote:You should remove this:
Code: Select all
ReefAngel.Relay.DelayedOn( ato );

This line will turn on your ato port after the delay and it will never turn off.


ahh jeez ok. thanks robert.

is there a way for me to delay the ATO high/low for maybe about 5 minutes until it can check itself after a water change? i just want to be sure the level is OK right after a change

Posts: 12272
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Sun Jun 30, 2013 7:39 pm
Latest version would make this simpler for you if you can fit your code with it.
This is what you would need:
Code: Select all
if (ReefAngel.DisplayedMenu==WATERCHANGE_MODE) bitClear(ReefAngel.Relay.RelayMaskOffE[0],0);

This would apply mask off on the ato port and you can clear the override when you are done with the visual check.
Roberto.

Posts: 51
Joined: Mon Nov 19, 2012 9:22 pm
PostPosted: Sun Jun 30, 2013 7:42 pm
thanks roberto!!!

Return to My PDE/INO file

Who is online

Users browsing this forum: No registered users and 1 guest