ORP as a controller
Posted: Sun Dec 16, 2012 7:03 am
Can i use the orp expantion as a controller to turn ozone unit on and off?
Community discussion about Reef Angel Controllers and reefing related subjects
https://forum.reefangel.com/
Yes, you can do this. I do not believe this functionality is built into the libraries. You can do something like this:butcherman wrote:Can i use the orp expantion as a controller to turn ozone unit on and off?
Code: Select all
if (ReefAngel.Params.ORP >= 400 ) ReefAngel.Relay.Off(Port8);
if (ReefAngel.Params.ORP <= 300 ) ReefAngel.Relay.On(Port8);
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 <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 = Port5Bit | Port6Bit | Port7Bit | Port8Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port2Bit | Port3Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port5Bit | Port7Bit;
// 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( Port6 );
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardATO( Port1,120 );
ReefAngel.StandardLights( Port2,7,0,20,0 );
ReefAngel.StandardLights( Port3,7,0,20,0 );
ReefAngel.StandardFan( Port4,250,260 );
ReefAngel.StandardHeater( Port5,240,250 );
ReefAngel.StandardHeater( Port7,240,250 );
if (ReefAngel.Params.ORP >= 400 ) ReefAngel.Relay.Off(Port8);
if (ReefAngel.Params.ORP <= 300 ) ReefAngel.Relay.On(Port8);
ReefAngel.PWM.SetDaylight( PWMParabola(9,0,20,0,11,100,11) );
ReefAngel.PWM.SetActinic( PWMParabola(9,0,20,0,10,100,10) );
////// Place your custom code below here
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "butcherman" );
ReefAngel.ShowInterface();
}
void DrawCustomMain()
{
int x,y;
char text[10];
// Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 20, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 20, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
pingSerial();
// ORP
ReefAngel.LCD.DrawText( COLOR_PALEVIOLETRED,DefaultBGColor,75,66, "ORP:" );
ReefAngel.LCD.DrawText( COLOR_PALEVIOLETRED,DefaultBGColor,99,66, ReefAngel.Params.ORP );
pingSerial();
// Main Relay Box
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox( 12, 93, TempRelay );
pingSerial();
// Date and Time
ReefAngel.LCD.DrawDate( 6, 122 );
pingSerial();
}
void DrawCustomGraph()
{
}
i incorperated it in the coderimai wrote:No, it won't work
You will need to use the code posted by binder
void loop()
{
ReefAngel.StandardATO( Port1,120 );
ReefAngel.StandardLights( Port2,7,0,20,0 );
ReefAngel.StandardLights( Port3,7,0,20,0 );
ReefAngel.StandardFan( Port4,250,260 );
ReefAngel.StandardHeater( Port5,240,250 );
ReefAngel.StandardHeater( Port7,240,250 );
if (ReefAngel.Params.ORP >= 400 ) ReefAngel.Relay.Off(Port8);
if (ReefAngel.Params.ORP <= 300 ) ReefAngel.Relay.On(Port8);
ReefAngel.PWM.SetDaylight( PWMParabola(9,0,20,0,11,100,11) );
ReefAngel.PWM.SetActinic( PWMParabola(9,0,20,0,10,100,10) );
////// Place your custom code below here