ph control

Post Reply
Barendvh
Posts: 19
Joined: Sun Feb 03, 2013 8:26 am
Location: Johannesburg

ph control

Post by Barendvh »

How does this control work?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: ph control

Post by rimai »

That's meant for equipment that raise pH.
Turn on when it gets lower than X pH and turns off when it gets higher than Y pH.
Roberto.
Barendvh
Posts: 19
Joined: Sun Feb 03, 2013 8:26 am
Location: Johannesburg

Re: ph control

Post by Barendvh »

Thank you Roberto is this based on the main pH reading or the PH expansion unit?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: ph control

Post by rimai »

main pH, but we can easily replicate that to work on the expansion too.
Roberto.
Barendvh
Posts: 19
Joined: Sun Feb 03, 2013 8:26 am
Location: Johannesburg

Re: ph control

Post by Barendvh »

Thank you I cannot program so I rely on the wizard. Is it easy to change? If not I am just going to keep the main tank on the expansion unit. What is the tolerances for the switching?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: ph control

Post by rimai »

You can code it as tight as you want, like turn on at 7.91 and off at 7.92, but that is going to give you a lot of turn on/off.
If you want to use the ph expansion module, you can add this to your code:

Code: Select all

  if (ReefAngel.Params.PHExp <= 791) ReefAngel.Relay.On(Port5);  
  if (ReefAngel.Params.PHExp >= 800) ReefAngel.Relay.Off(Port5); 
Roberto.
Barendvh
Posts: 19
Joined: Sun Feb 03, 2013 8:26 am
Location: Johannesburg

Re: ph control switching

Post by Barendvh »

p
Hi I am still struggling to get the RA to switch on and off with the PH control
Please could you look at the code below and tell me what I am doing wrong


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

// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = 0;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = 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( 275 );


// Ports that are always on
ReefAngel.Relay.On( Port1 );
ReefAngel.Relay.On( Port2 );
ReefAngel.Relay.On( Port3 );
ReefAngel.Relay.On( Port7 );

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


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

void loop()
{
ReefAngel.StandardHeater( Port4,247,252 );
ReefAngel.StandardFan( Port5,255,260 );
ReefAngel.StandardLights( Port6,19,0,7,0 );
ReefAngel.PHControl( Port8,625,650 );
////// Place your custom code below here


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

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

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

// Salinity
ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,15,54, "SAL:" );
ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,39,54, ReefAngel.Params.Salinity );
pingSerial();

// pH Expansion
ReefAngel.LCD.DrawText( COLOR_MEDIUMSEAGREEN,DefaultBGColor,15,75, "PHE:" );
ReefAngel.LCD.DrawText( COLOR_MEDIUMSEAGREEN,DefaultBGColor,39,75, ReefAngel.Params.PHExp );
pingSerial();

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

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

void DrawCustomGraph()
{
}
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: ph control

Post by rimai »

Which equipment are you trying to control based on pH?
PHControl is for equipments that raise pH and CO2Control is for equipments that lower pH.
Roberto.
Barendvh
Posts: 19
Joined: Sun Feb 03, 2013 8:26 am
Location: Johannesburg

Re: ph control

Post by Barendvh »

I am trying to control my calcium Reactor
Barendvh
Posts: 19
Joined: Sun Feb 03, 2013 8:26 am
Location: Johannesburg

Re: ph control

Post by Barendvh »

solinoid valve
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: ph control

Post by rimai »

You must use the CO2Control and not PHControl.
Your equipment lowers pH.
Roberto.
Barendvh
Posts: 19
Joined: Sun Feb 03, 2013 8:26 am
Location: Johannesburg

Re: ph control

Post by Barendvh »

I am not measuring CO2
Barendvh
Posts: 19
Joined: Sun Feb 03, 2013 8:26 am
Location: Johannesburg

Re: ph control

Post by Barendvh »

I am trying to switch the solenoid of when the PH is 6.2 and on if the PH gets above 6.5.
Barendvh
Posts: 19
Joined: Sun Feb 03, 2013 8:26 am
Location: Johannesburg

Re: ph control

Post by Barendvh »

I am trying to switch the solenoid of when the PH is 6.2 and on if the PH gets above 6.5.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: ph control

Post by rimai »

Exactly... You are controlling something that lowers pH.
Roberto.
Barendvh
Posts: 19
Joined: Sun Feb 03, 2013 8:26 am
Location: Johannesburg

Re: ph control

Post by Barendvh »

So how should I do this
Barendvh
Posts: 19
Joined: Sun Feb 03, 2013 8:26 am
Location: Johannesburg

Re: ph control

Post by Barendvh »

So how should I do this
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: ph control

Post by rimai »

Use this:

Code: Select all

ReefAngel.CO2Control ( Port8,625,650 );
Roberto.
Barendvh
Posts: 19
Joined: Sun Feb 03, 2013 8:26 am
Location: Johannesburg

Re: ph control

Post by Barendvh »

You are a absolute star it is working. Where are you in the world?
I am in South Africa
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: ph control

Post by rimai »

Cool :)
Glad you got it working now. I'm in the USA
Roberto.
Barendvh
Posts: 19
Joined: Sun Feb 03, 2013 8:26 am
Location: Johannesburg

Re: ph control

Post by Barendvh »

Should you ever come to South Africa you are welcome to look me up.
Have a great day
Post Reply