Page 1 of 1
ph control
Posted: Thu May 02, 2013 8:39 am
by Barendvh
How does this control work?
Re: ph control
Posted: Thu May 02, 2013 8:41 am
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.
Re: ph control
Posted: Thu May 02, 2013 8:43 am
by Barendvh
Thank you Roberto is this based on the main pH reading or the PH expansion unit?
Re: ph control
Posted: Thu May 02, 2013 8:43 am
by rimai
main pH, but we can easily replicate that to work on the expansion too.
Re: ph control
Posted: Thu May 02, 2013 8:56 am
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?
Re: ph control
Posted: Thu May 02, 2013 9:06 am
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);
Re: ph control switching
Posted: Mon May 06, 2013 8:10 am
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()
{
}
Re: ph control
Posted: Mon May 06, 2013 8:16 am
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.
Re: ph control
Posted: Mon May 06, 2013 8:27 am
by Barendvh
I am trying to control my calcium Reactor
Re: ph control
Posted: Mon May 06, 2013 8:28 am
by Barendvh
solinoid valve
Re: ph control
Posted: Mon May 06, 2013 8:29 am
by rimai
You must use the CO2Control and not PHControl.
Your equipment lowers pH.
Re: ph control
Posted: Mon May 06, 2013 8:32 am
by Barendvh
I am not measuring CO2
Re: ph control
Posted: Mon May 06, 2013 8:36 am
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.
Re: ph control
Posted: Mon May 06, 2013 8:36 am
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.
Re: ph control
Posted: Mon May 06, 2013 8:37 am
by rimai
Exactly... You are controlling something that lowers pH.
Re: ph control
Posted: Mon May 06, 2013 8:43 am
by Barendvh
So how should I do this
Re: ph control
Posted: Mon May 06, 2013 8:43 am
by Barendvh
So how should I do this
Re: ph control
Posted: Mon May 06, 2013 8:46 am
by rimai
Use this:
Code: Select all
ReefAngel.CO2Control ( Port8,625,650 );
Re: ph control
Posted: Mon May 06, 2013 8:54 am
by Barendvh
You are a absolute star it is working. Where are you in the world?
I am in South Africa
Re: ph control
Posted: Mon May 06, 2013 8:59 am
by rimai
Cool

Glad you got it working now. I'm in the USA
Re: ph control
Posted: Mon May 06, 2013 9:30 am
by Barendvh
Should you ever come to South Africa you are welcome to look me up.
Have a great day