Continuos Water Change

Do you have a question on how to do something.
Ask in here.
User avatar
Posts: 187
Joined: Wed Apr 10, 2013 2:48 pm
Location: Athens, Ga
PostPosted: Sat Jan 17, 2015 10:09 pm
I am thinking about implementing a continuos water change and have two Spectapure dosing pumps that are up to the task.
I am switching to internal memory and was wondering if there is a way to turn my stand alone Avastmarine ATO off when the pumps are set to withdraw water/replace water? (I plan to replace the water every 9 min.)

Is there also a way to reduce the offset off when one pump turns off and the other turns on using internal memory as well?

Can you mix hard coding and coding to internal memory in the sketch?

Many thanks for your help. ;)
Image
User avatar
Posts: 5416
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sun Jan 18, 2015 6:06 am
I would just put a statement if either spectrapure pump is on then turn off the ato relay. However the offset you mentioned would prob leave a window where neither is running? Can you elaborate with the on/off timeline of what you want?

Yes you can mix hard coded and memory
User avatar
Posts: 187
Joined: Wed Apr 10, 2013 2:48 pm
Location: Athens, Ga
PostPosted: Sun Jan 18, 2015 8:35 am
lnevo wrote:I would just put a statement if either spectrapure pump is on then turn off the ato relay. However the offset you mentioned would prob leave a window where neither is running? Can you elaborate with the on/off timeline of what you want?

Yes you can mix hard coded and memory


I plan to have the pumps change 18 mL every 9 minutes, 24 hours a day, 7 days a week. This comes out to 150x a day.

I would like Pump 1 to remove 18 mL of water from the tank which would take 6.17 seconds (it pumps 175 ml/min). Then as soon as Pump 1 is finished Pump 2 would add 18 mL of fresh saltwater to the tank which would take 5.4 seconds (it pumps 200 mL/min). I would like to minimize the offset if possible. I do not know how to code and copy and paste bits and pieces as I need them. Could you please tell me how to code the if statement. My ATO is currently on an expansion relay box 1 Relay 14. The pumps will be on 5 and 6 of relay box 1.
Image
User avatar
Posts: 5416
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sun Jan 18, 2015 8:37 am
Are you dosing 2 part? Meaning are you using the dosing pumps in the portal configuration?
User avatar
Posts: 187
Joined: Wed Apr 10, 2013 2:48 pm
Location: Athens, Ga
PostPosted: Sun Jan 18, 2015 8:49 am
I am not dosing 2 part. I was going to use the dosing pump function in the wizard to get the pumps to turn on/off to change my water. I was going to have it coded to the memory so if I need to change it later I can through the portal or RA app on my phone.
Image
User avatar
Posts: 5416
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sun Jan 18, 2015 1:38 pm
Ok. cool. That will certainly be the easiest way, but it will have a built in offset between dosing pump 1 and dosing pump 2. We can do it one of two ways. I can work on some code to know when the first pump is triggered and keep the ATO off, or we can manually setup the two dosing pumps to use the internal memory but not have an offset in between. While either pump is off the ATO won't trigger. Let me know you're preference with that, the main thing would be how customizable do you want the offset between the pumps... or if you want to drain, then add, then ato pump back on.

Just for shits and giggles...another option you could do is to add some water first, then remove some water. Since the amount of water changed is the same it won't kick on your ATO and we won't have to do anything custom. Since you're changing so little water, it really won't make that much of a difference. What do you think of that? It's certainly the easiest and most flexible code-wise...
User avatar
Posts: 187
Joined: Wed Apr 10, 2013 2:48 pm
Location: Athens, Ga
PostPosted: Mon Jan 19, 2015 6:23 am
lnevo wrote:Ok. cool. That will certainly be the easiest way, but it will have a built in offset between dosing pump 1 and dosing pump 2. We can do it one of two ways. I can work on some code to know when the first pump is triggered and keep the ATO off, or we can manually setup the two dosing pumps to use the internal memory but not have an offset in between. While either pump is off the ATO won't trigger. Let me know you're preference with that, the main thing would be how customizable do you want the offset between the pumps... or if you want to drain, then add, then ato pump back on.

Just for shits and giggles...another option you could do is to add some water first, then remove some water. Since the amount of water changed is the same it won't kick on your ATO and we won't have to do anything custom. Since you're changing so little water, it really won't make that much of a difference. What do you think of that? It's certainly the easiest and most flexible code-wise...


I was thinking to drain then fill with ATO off. But more importantly I would like to be able to adjust the amount of water being pumped in/out using internal memory if changes need to be made with minimum hassle. I am a new parent and my priority is my daughter. As a result I have not been able to do water changes as often as I like. If it works out better to fill then remove then I game for that.

I appreciate your help.
Image
User avatar
Posts: 5416
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Jan 19, 2015 6:25 am
Cool. I think especially with the frequency you are doing, it doesn't really matter which way you go :)

I'll write up the code for you. Can you post your current INO and which ports you need for the spectrapure and ato
User avatar
Posts: 5416
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Jan 19, 2015 6:26 am
Oh and congratulations on your new daughter! Thats one area where RA definitely helps with having things automated!
User avatar
Posts: 187
Joined: Wed Apr 10, 2013 2:48 pm
Location: Athens, Ga
PostPosted: Mon Jan 19, 2015 8:37 am
Thanks. Its an amazing feeling when you become a parent. I find having a child is like having a reef tank, a lot of work but one of the greatest things you can do in life.
    Main Relay
    1. Skimmer
    2. LED fan
    3. LED power supply 1
    4. LED power supply 2
    5. RW8
    6. MJ1200 water mixing station
    7. Heater
    8. DC3000

    Expansion Relay 1
    1. ATO
    2. Not Used
    3. Not Used
    4. Not Used
    5. Autowater change 1
    6. Autowater change 2

    7. Not Used
    8. Not Used

In the INO below I set the relays for the autowater change 1 & 2 pumps to not used because I was not sure what to choose from in the wizard.

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 = Port1Bit | Port5Bit | Port8Bit;
    ReefAngel.FeedingModePortsE[0] = Port1Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port3Bit | Port4Bit | Port5Bit | Port8Bit;
    ReefAngel.WaterChangePortsE[0] = Port1Bit | Port4Bit | Port7Bit;
    // 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 = Port2Bit | Port3Bit | Port4Bit | Port8Bit;
    ReefAngel.OverheatShutoffPortsE[0] = Port7Bit;
    // 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( Port8 );

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

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

void loop()
{
    ReefAngel.DayLights( Port2 );
    ReefAngel.DayLights( Port3 );
    ReefAngel.DayLights( Port4 );
    ReefAngel.DayLights( Port5 );
    ReefAngel.DosingPumpRepeat1( Port6 );
    ReefAngel.StandardHeater( Port7 );
    ReefAngel.DayLights( Box1_Port1 );
    ReefAngel.PWM.Channel0PWMParabola();
    ReefAngel.PWM.Channel1PWMParabola();
    ReefAngel.PWM.Channel2PWMParabola();
    ReefAngel.PWM.Channel3PWMParabola();
    ReefAngel.PWM.Channel4PWMParabola();
    ReefAngel.PWM.Channel5PWMParabola();
    ////// Place your custom code below here
   

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

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

Return to How do I code ...

Who is online

Users browsing this forum: No registered users and 2 guests