Alrighty then. Glued the pieces together with primer and pvc cement, and zip tied it to the sump drain pipe. Very tight and secure.
Uploaded some code from the wizard so that the water level calibration showed up on the head unit. Calibrated the switch and set it back in place. Very simple and straightforward.
Where my PVC tube sat, the RA read around 42. I uploaded alexwbush's code, with values of 45 and 40, instead of 62 and 60, and changed his port5 to port1 for my ATO pump.
The code compiled and uploaded fine, and the ATO pump was not on initially, as was expected. Then, I took a bucket of water out of the sump, so that the level fell to about 38. The pump turned on and started to fill, as it should. However, when the level got close to 40, the pump switches off and on, rather than filling to 45, and then turning off. What am I missing?
#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>
////// 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
ReefAngel.FeedingModePorts = Port1Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
// 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 = Port7Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 800 );
// Ports that are always on
ReefAngel.Relay.On( Port6 );
ReefAngel.Relay.On( Port8 );
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardLights( Port2,6,0,23,0 );
ReefAngel.StandardLights( Port3,13,0,22,0 );
ReefAngel.StandardLights( Port4,14,0,18,0 );
ReefAngel.Wavemaker( Port5,6 );
ReefAngel.StandardHeater( Port7,766,770 );
////// Place your custom code below here
byte topofflevel=40;
// If water level less than 40, turn on auto top off relay; else, keep it off
if (ReefAngel.WaterLevel.GetLevel()<topofflevel)
{
topofflevel=45;
ReefAngel.Relay.On(Port1);
}
else
{
topofflevel=40;
ReefAngel.Relay.Off(Port1);
}
// If water level equals 0, turn off return relay; else, keep it on
if (ReefAngel.WaterLevel.GetLevel()==0) ReefAngel.Relay.Off(Port8);
else ReefAngel.Relay.On(Port8);
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "barbianj" );
ReefAngel.ShowInterface();
}
void DrawCustomMain()
{
int x,y;
char text[10];
// Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 20, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 20, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
pingSerial();
// Water Level
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,75,66, "WL:" );
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,99,66, ReefAngel.WaterLevel.GetLevel() );
pingSerial();
// Main Relay Box
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox( 12, 92, TempRelay );
pingSerial();
// Date and Time
ReefAngel.LCD.DrawDate( 6, 122 );
pingSerial();
}
void DrawCustomGraph()
{
}