Looking for somone to PAY $ to code.

Do you have a question on how to do something.
Ask in here.
Post Reply
jcondello
Posts: 22
Joined: Wed Sep 11, 2013 11:23 pm

Looking for somone to PAY $ to code.

Post by jcondello »

Looking for someone to pay to code my RA pretty basic function see below.

Setup the following

ATO (with Level Expansion)
Dosing Pumps x 3 (Via Power Control Expansion)
Water Change option (To Discuss)
everything else i require is currently in place just need the above addition.


please contact me ASAP to discuss further.

Thank you.
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Looking for somone to PAY $ to code.

Post by lnevo »

I'll help you for free. Most of what you want is supported by the wizard...ATO and Dosing are built in.

I have a routine in my code (link in signature) for auto water changing...it can be easily integrated with the code the wizard produces. I use it as a one shot weekly (simultaneous) water change but it could be very easily modified to run daily / hourly / or whatever schedule you want.

How about you start with the wizard, post your code up and then we can add what your missing.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Looking for somone to PAY $ to code.

Post by rimai »

Simply add this to loop():

Code: Select all

  ReefAngel.WaterLevelATO(Port1,60,45,50); // 60 sec timeout. Keep water between 45% and 50%
  ReefAngel.DosingPumpRepeat(Box1_Port1,0,60,5); // Doser 1 every 60min for 5 sec with 0min offset
  ReefAngel.DosingPumpRepeat(Box1_Port2,5,60,5); // Doser 2 every 60min for 5 sec with 5min offset
  ReefAngel.DosingPumpRepeat(Box1_Port3,10,60,5); // Doser 3 every 60min for 5 sec with 10min offset
Roberto.
jcondello
Posts: 22
Joined: Wed Sep 11, 2013 11:23 pm

Looking for somone to PAY $ to code.

Post by jcondello »

Thank you Inevo i really appreciate your help, ive managed to get everything going, the only solution i now require is a method to my auto water change what is the best way to do this i am goig to purchase a mains power pump for this function & i have one last output free for this no. 8. i just require a weekly change of 15% i would like to use the water level sensor to do this or maybe you have a better suggestion.

i ave attached my current file for you to look at below.

thank you again i look forward to your reply

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 <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.SetTemperatureUnit( Celsius );  // set to Celsius Temperature

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


    // Ports that are always on
    ReefAngel.Relay.On( Port3 );
    ReefAngel.Relay.On( Port4 );
    ReefAngel.Relay.On( Port5 );
    ReefAngel.Relay.On( Port6 );

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

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

void loop()
{
    ReefAngel.StandardLights( Port1,13,0,22,0 );
    ReefAngel.StandardHeater( Port2,240,255 );
    ReefAngel.StandardHeater( Port7,220,250 );
    ReefAngel.DosingPumpRepeat( Box1_Port1,0,1440,3 );
    ReefAngel.SingleATO( false,Box1_Port4,60,0 );
    ////// Place your custom code below here
    

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

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

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

    // Salinity
    ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,49,46, "SAL:" );
    ReefAngel.LCD.DrawSingleMonitor( ReefAngel.Params.Salinity,COLOR_DARKKHAKI,73,46, 10 );    
    pingSerial();

    // Water Level
    ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,75,63, "WL:" );
    ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,99,63, ReefAngel.WaterLevel.GetLevel() );
    pingSerial();

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

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

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

void DrawCustomGraph()
{
}
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Looking for somone to PAY $ to code.

Post by lnevo »

Ok before we get to coding the auto change. I need much more information...how do you envision this happening? Step by step what would you like to see? Is this going to be initiated by you or unattended? Do you have a salinity probe or are we just relying on water level?

My water change converts one port to an ATO attached to a pump thats in my fresh saltwater. I redirect my reactor pump to the drain. I turn on the reactor pump. As the water drains the ATO pump refills the sump with new saltwater. When the ATO pump times out or I have an option to drain for X seconds then it shuts off the reactor pump and its time to clean up.

Thats just one way to go, but everyone may have different ideas so lets hear what you have in mind...
jcondello
Posts: 22
Joined: Wed Sep 11, 2013 11:23 pm

Re: Looking for somone to PAY $ to code.

Post by jcondello »

I do have a sal probe, the way i see it happening is ill have 2 pumps one to drain & one to refill i wont use my ATO pump as its only 200ml per min. i will initiate the water change manually. but once started will run through the process automatically.

ill have premixes saltwater to refill.

so pump 1 will start until desired removal level reached, then pump 2 will draw fresh salt water and refill to 100% level.

i hope this helps
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Looking for somone to PAY $ to code.

Post by Sacohen »

Are the 2 pumps going to drain and fill at the same time, or is it going to drain and then fill.

It's hard to get 2 separate pumps (even of the same make and model) to pump at the exact same speed.
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Looking for somone to PAY $ to code.

Post by lnevo »

Ok,

So you'll be doing this as a simulated manual change. i.e Empty water level first, then refill water level. Mine is done as a continuous. As water is draining, then water is filling.

So, I'm seeing this as steps.

1) Enter water change mode (return pump, other equipment shut down) - Btw, is your WL sensor calibrated to handle the sump level when all equipment is off? I see you have it set for 90-95% at the moment so when equipment is off, we may be over 100%... Just something to consider.

2) Drain water till WL at X% (please define X)

3) Fresh water pumped in till WL at 100% (please confirm based on #1 answers as well)

4) Exit WC mode. Equipment comes back on.

Anyway, I think there's a good example we have to find where someone did this exact thing. Roberto is pretty good on finding those and he helped with that code so let's see what we can dig up and reuse.
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Looking for somone to PAY $ to code.

Post by lnevo »

Sacohen wrote:Are the 2 pumps going to drain and fill at the same time, or is it going to drain and then fill.

It's hard to get 2 separate pumps (even of the same make and model) to pump at the exact same speed.
He mentioned this:
jcondello wrote: so pump 1 will start until desired removal level reached, then pump 2 will draw fresh salt water and refill to 100% level.
Also, you said you didn't want to use your ATO pump. That's not what I meant... I meant I convert a spare outlet into an ATO outlet and use that to act like an ATO but with Salt Water... so as water is draining, the spare outlet is turning on the refill pump and keeping the water level the same while all my equipment is continuing to run.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Looking for somone to PAY $ to code.

Post by Sacohen »

Sorry I missed that., but I want to follow this anyway, for the future.
jcondello
Posts: 22
Joined: Wed Sep 11, 2013 11:23 pm

Re: Looking for somone to PAY $ to code.

Post by jcondello »

thank you for the reply, i will adjust the water level sensor with all gear off so that the sump is at it highest ( i can play with this as i test it for drain & topup), at this stage X will = 80% , which will give me a 20% water change (i can change this later if needed).
Just a quick question what is the benefit of running the water change with in & out at the same time ?
depending on your answer this might be an option.

I'm just trying to get the best outcome I'm open to all suggestions ?
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Looking for somone to PAY $ to code.

Post by lnevo »

To me the benefits are basically a convenience for the way that I run it and the parameters are more stable as the water is mixed as it's being changed. There is a slight con as you don't get the full effectiveness of X% of water. So a 30% change is more like a 26% change. For me to be able to do the size water change I do, I'd need to fully drain my sump and probably do it twice. So I'm able to change whatever volume I like without changing the methodology.

Here's a link describing the 'continuous' water change.

http://reefkeeping.com/issues/2005-10/rhf/index.php#13

One day, when I have the means to setup the proper plumbing feed and drain from my mixing stations, then I will set it up to run all the time.
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Looking for somone to PAY $ to code.

Post by lnevo »

So here's the code you can put inside your loop function

You can edit the first few lines here to define your ports and percentages.

Code: Select all

  // Please set to desired preferences
  #define DRAIN_PUMP Port7
  #define REFILL_PUMP Port8
  #define DRAIN_PCT 80
  #define REFILL_PCT 100
  
  static byte WC_status=0;
  /*
  0- No WC mode
  1- WC started, so DRAIN_PUMP is on
  2- WC started and water has reached DRAIN_PCT, so DRAIN_PUMP is off and REFILL_PUMP is on
  3- WC started and water has reached REFILL_PCT, so port 2 is off
  */ 
  
  if (ReefAngel.DisplayedMenu==WATERCHANGE_MODE && WC_status==0)
  {
    ReefAngel.Relay.On(DRAIN_PUMP);
    WC_status=1;
  }
  if (ReefAngel.WaterLevel.GetLevel()<=DRAIN_PCT && WC_status==1)
  {
    ReefAngel.Relay.Off(DRAIN_PUMP);
    ReefAngel.Relay.On(REFILL_PUMP);
    WC_status=2;
  }
  if (ReefAngel.WaterLevel.GetLevel()>=REFILL_PCT && WC_status==2)
  {
    ReefAngel.Relay.Off(REFILL_PUMP);
    ReefAngel.ATOClear();
    ButtonPress++;
    WC_status=3;
  }
  if (ReefAngel.DisplayedMenu!=WATERCHANGE_MODE)
  {
    WC_status=0;
  }
The code above does the following based on the code roberto wrote in this thread
http://forum.reefangel.com/viewtopic.php?t=3280

1. You enable WC mode
2. DRAIN_PUMP turns on until water level at DRAIN_PCT
3. DRAIN_PUMP turns off, REFILL_PUMP turns on until water level reaches REFILL_PCT
4. REFILL_PUMP turns off. ATO Timeout is cleared. WC mode is cancelled.
jcondello
Posts: 22
Joined: Wed Sep 11, 2013 11:23 pm

Re: Looking for somone to PAY $ to code.

Post by jcondello »

Thank you so much guys I will give it a go and post the outcome.
Post Reply