Auto Water change

Post Reply
MDB1029
Posts: 178
Joined: Wed Nov 12, 2014 3:10 pm
Location: An Oklahoman in Ohio

Auto Water change

Post by MDB1029 »

Would it be possible to do automatic water changes by having one pump turn on draining X amount of water until a float swith or water level sensor hits then turn on another pump of new water until it rises back up to the normal level or to the
ATO switch? I thought if it did this once a day at a certain time you could have it turn off the ATO at that time and then once the cycle finishes it kicks the ATO back on?

I am hoping this would be a way around having a dual head pump but i may be wrong. Let me know if you think it is possible.
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Auto Water change

Post by lnevo »

Yep. Perfect way to go about it. If you use the ato float, you can use the ato function to refill the saltwater too.
MDB1029
Posts: 178
Joined: Wed Nov 12, 2014 3:10 pm
Location: An Oklahoman in Ohio

Re: Auto Water change

Post by MDB1029 »

lnevo wrote:Yep. Perfect way to go about it. If you use the ato float, you can use the ato function to refill the saltwater too.
So i could use the existing ATO float for for the refill and put another float under the water line for the low end and then just have 2 pumps?

If that is correct, what would the code look like for doing this?
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Auto Water change

Post by lnevo »

Here's an example thats also using the water level sensor. I know there's a few others posted. I can try giving a better example if needed.

http://forum.reefangel.com/viewtopic.php?t=1837#p46373
MDB1029
Posts: 178
Joined: Wed Nov 12, 2014 3:10 pm
Location: An Oklahoman in Ohio

Re: Auto Water change

Post by MDB1029 »

I think i am missing something with that link.
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Auto Water change

Post by lnevo »

It's on the more complex side. Figured I'd start with that. I'll write something up later for you.
MDB1029
Posts: 178
Joined: Wed Nov 12, 2014 3:10 pm
Location: An Oklahoman in Ohio

Re: Auto Water change

Post by MDB1029 »

I appreciate that.
Image
fishflipper
Posts: 121
Joined: Fri Jul 03, 2015 8:29 am

Re: Auto Water change

Post by fishflipper »

I would also like this. is this possible to be done using the water change button on the app? My setup would be pretty similar. looking to press the water change button on the app and have it turn my return pump, skimmer, and ATO pump off. then when all is off have it turn on the pump that drains the water down to a certain level and then kick on the pump that refills the salt water. once all this is completed I would like the return pump to turn back on. is this something that is possible? I have a RV diaphragm pump in my basement that I have been testing out for a few weeks as my ATO pump and so far is working great! they are only $20 and have a good head height for pumping from very far away. I will use 2 more of these same pumps to remove the water from the sump and to pump fresh salt water back to the tank.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Auto Water change

Post by lnevo »

Yes. I actually needed to know what you wanted to trigger all this :) gonna need some time to put the code together, I did not get to work on it yesterday.
MDB1029
Posts: 178
Joined: Wed Nov 12, 2014 3:10 pm
Location: An Oklahoman in Ohio

Re: Auto Water change

Post by MDB1029 »

No rush. I figure I would have to start with two float switches, one being the ATO float switch. Whatever other info you need just let me know.
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Auto Water change

Post by lnevo »

The standard ato uses two float switches. You could use one but you lose redundancy
MDB1029
Posts: 178
Joined: Wed Nov 12, 2014 3:10 pm
Location: An Oklahoman in Ohio

Re: Auto Water change

Post by MDB1029 »

lnevo wrote:The standard ato uses two float switches. You could use one but you lose redundancy
I am pretty open to how it should be set up. I only have one good float switch so i will have to buy new ones anyway. So if i need the 2 float ato and then a low one for the water change I am open to it but if I/O expansion is required, i don't have one.

I have the RA+ dimming expansion and wifi currently. If any other modules would be needed i am open for suggestions.

Thanks again
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Auto Water change

Post by lnevo »

The waterlevel sensor is a great tool for this. You could get a 5 pack of switches on ebay for under 10. I'm off tomorrow so I'll try and get code out, easily modifiable however we do.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Auto Water change

Post by lnevo »

And no we could use the two for ato and reuse the same two for water change.
MDB1029
Posts: 178
Joined: Wed Nov 12, 2014 3:10 pm
Location: An Oklahoman in Ohio

Re: Auto Water change

Post by MDB1029 »

The water level sensor is on the list, just can't afford it yet.
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Auto Water change

Post by lnevo »

Ok, here you go. First change all the settings where I commented ChangeMe.

Second, you'll trigger this by turning on WaterChange Mode and then once everything has drained, you can start it up by turning on the drain port. This will run for "runtime" seconds or until the Low ATO switch is no longer up. It will immediately start refilling with the SW pump until the High ATO switch is then active.

When you exit water change mode, the drain and refill ports will be off and then ATO will then be active. Make sure to remove any other ATO statements you have and set this one as the preferred.

Code: Select all

    ////// Place your custom code below here
    static time_t t; // Timer for drain port
    
    byte ATOPort = Port1; // ChangeMe
    byte DrainPort = Port2; // ChangeMe
    byte SWPort = Port3; // ChangeMe
    int runtime=300; // ChangeMe
    
    if (ReefAngel.DisplayedMenu==WATERCHANGE_MODE) { // We're in WC Mode
      ReefAngel.Relay.Off(ATOPort); // Disable the ATO
      
      // Trigger by turning the drain pump on
      if (ReefAngel.Relay.isMaskOn(DrainPort)) {
        ReefAngel.Relay.Auto(DrainPort);
        t=now();
      }  

      if (now()-t < runtime) { // Timer is running
        if (ReefAngel.LowATO.IsActive()) { // Low Float switch is up
          ReefAngel.Relay.On(DrainPort); // Drain is on
        }
      } else { // Timer expires
        if (!ReefAngel.HighATO.IsActive()) { // High Float switch is down
          ReefAngel.Relay.On(SWPort);
        }
      }
    
    } else { // Business as Usual
      ReefAngel.StandardATO(ATOPort,60); // This becomes your ATO statement
      ReefAngel.Relay.Off(DrainPort); // This ensures your drain pump is off
      ReefAngel.Relay.Off(SWPort);
    }
    ////// Place your custom code above here
JclaasSA
Posts: 25
Joined: Fri Aug 18, 2017 10:11 am

Re: Auto Water change

Post by JclaasSA »

Hi everyone :), I am new here... based in East London, Eastern Cape, South Africa.

I hope you are all well!! I am needing some help with adding an AUTOMATIC WATERCHANGE to my Reef Angel (RA) system.

I want to use the ReefAngel.StandardAto (Two float switches) connected to channnel 2 and channel 3 on the i/o expansion module.

I will need to have Relay Expansion code added as well as my ports are getting few (Please assist her as well).
I want the function to be as follows:
Waterchange active-
Turn ATO1 off
Turn RETURN off
Float High made (AS water flows to sump)
Turn DRAINPUMP on
Float Low made
Turn DRAINPUMP off
Turn FILLPUMP on
Float High made (As water fills the sump)
Turn FILLPUMP off
Turn RETURN on
Turn ATO1 on

@rimai and others..

Code is as follows:

#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 <ReefAngel.h>
#include <Salinity.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>


byte x,y;
byte bkcolor;

void DrawCustomMain()
{
// the graph is drawn/updated when we exit the main menu &
// when the parameters are saved
ReefAngel.LCD.DrawDate(6, 112);
pingSerial();
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor(15, 60, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue());
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor(15, 60, ReefAngel.Params);
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
pingSerial();
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox(12, 93, TempRelay);
y=10;
x=15;
for (int a=0;a<6;a++)
{
if(ReefAngel._IO.GetChannel(a)) bkcolor=COLOR_RED;
else bkcolor=COLOR_GREEN;
if (a>2) x=75;
if (a==3) y=10;
ReefAngel.LCD.Clear(bkcolor, x, y-3, x+40,y-1);
ReefAngel.LCD.Clear(bkcolor, x, y+8, x+40,y+10);
ReefAngel.LCD.Clear(bkcolor, x, y, x+3,y+8);
ReefAngel.LCD.Clear(bkcolor, x+37, y, x+40,y+8);
ReefAngel.LCD.DrawText(COLOR_WHITE, bkcolor, x+3, y, "Input");
ReefAngel.LCD.DrawText(COLOR_WHITE, bkcolor, x+32, y, a);
y+=15;
}
}

void DrawCustomGraph()
{
}

/*

For more information about custom main screen (RA forum URL removed)
*/

// Define Relay Ports By Name
#define ATO1 1
#define ATO2 2
#define Skimmer 3
#define Daylights 4
#define Flowpumps1 5
#define Flowpumps2 6
#define Heaters 7
#define Return 8

*Adme - DRAINPUMP to relay box 2 port 1
*Adme - FILLPUMP to relay box 2 port 2
*Adme - Relay expansion (Ports 1 - 8)

void setup()
{
ReefAngel.Init(); // Initialize Controller
ReefAngel.AddDateTimeMenu();
ReefAngel.AddStandardMenu();
ReefAngel.SetTemperatureUnit(Celsius); // set Temperature to Celsius
ReefAngel.FeedingModePorts = Port5Bit | Port6Bit; // Turn off Ports 5 and 6 when Feeding Mode is activated
ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port3Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit; // Turn off Ports 1, 2, 3, 5, 6, 7 and 8 when Water Change Mode is activated
ReefAngel.OverheatShutoffPorts = Port4Bit | Port7Bit; // Turn off Ports 4 and 7 when Overheat Occurs
ReefAngel.LightsOnPorts = Port4Bit; // Turn on/off Ports 4 when Turn Lights On/Off is activated
ReefAngel.OverheatProbe = T1_PROBE | T2_PROBE | T3_PROBE; // Use Temperature probe 1, 2 and 3 to check for overheat
ReefAngel.TempProbe = T1_PROBE | T2_PROBE | T3_PROBE; // Use Temperature probe 1, 2 and 3 to check temperature

// Always on
ReefAngel.Relay.On(Return);
ReefAngel.Relay.On(Skimmer);
ReefAngel.Relay.On(Flowpumps1);
ReefAngel.Relay.On(Flowpumps2);
}

void loop()
{
ReefAngel.StandardATO(ATO1); // Standard ATO
ReefAngel.StandardLights(Daylights); // Daylight Lights
ReefAngel.StandardHeater(Heaters); // Heater
ReefAngel.PWM.StandardDaylight(); // Dimming for Daylight Channel
ReefAngel.PWM.StandardActinic(30); // Dimming for Actinic Channel
ReefAngel.ShowInterface(); // Display everything on the LCD screen
}
Post Reply