Page 1 of 1

Controll ORP

Posted: Thu Nov 07, 2013 2:14 pm
by anderzon_
Is it possible to control the ozone generator with a ORP expansion to a specific level. Type to shut off if it gets too high and turns on when it gets too low?

Re: Controll ORP

Posted: Fri Nov 08, 2013 11:53 am
by butcherman
Yes. Very easy. I got a thread somewhere if you do a search you will find it. Sorry but im on tapatalk only atm

Sent from my GT-I9500 using Tapatalk

Re: Controll ORP

Posted: Tue Dec 03, 2013 9:30 am
by anderzon_
will this code work even if it says further up in the code that port 3 is always on?

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

    ReefAngel.Use2014Screen();  // Let's use 2014 Screen 
    ReefAngel.AddORPExpansion();  // ORP Expansion Module
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port6Bit | Port7Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port3Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
    // 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( 270 );

    // Feeeding and Water Change mode speed
    ReefAngel.DCPump.FeedingSpeed=0;
    ReefAngel.DCPump.WaterChangeSpeed=0;


    // 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.StandardLights( Port4,17,0,20,0 );
    ReefAngel.Relay.DelayedOn( Port5,5 );
    ReefAngel.StandardHeater( Port6,249,255 );
    ReefAngel.Relay.DelayedOn( Port8,5 );
    if (ReefAngel.Params.ORP>=400)ReefAngel.Relay.Off(Port3);
    if (ReefAngel.Params.ORP>=300)ReefAngel.Relay.On(Port3);
    ReefAngel.DCPump.UseMemory = false;
    ReefAngel.DCPump.SetMode( ReefCrest,65,10 );
    ReefAngel.DCPump.DaylightChannel = Sync;
    ReefAngel.DCPump.ActinicChannel = AntiSync;
    ////// Place your custom code below here
    

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

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



Re: Controll ORP

Posted: Tue Dec 03, 2013 9:32 am
by rimai
Yes, it works.
setup() section only happens once at start up and never again.
But your logic is wrong.
You used >= on both lines.

Code: Select all

    if (ReefAngel.Params.ORP>=400)ReefAngel.Relay.Off(Port3);
    if (ReefAngel.Params.ORP>=300)ReefAngel.Relay.On(Port3);

Re: Controll ORP

Posted: Tue Dec 03, 2013 10:15 am
by anderzon_
Thanks

I see, would this work?

Code: Select all

if (ReefAngel.Params.ORP >= 400 ) ReefAngel.Relay.Off(Port3);
if (ReefAngel.Params.ORP <= 300 ) ReefAngel.Relay.On(Port3);

Re: Controll ORP

Posted: Tue Dec 03, 2013 10:23 am
by rimai
That works :)

Re: Controll ORP

Posted: Tue Dec 03, 2013 1:49 pm
by anderzon_
Thank u

If I delete this line from the setup section what would happen then?

Code: Select all

ReefAngel.Relay.On( Port3 );

Re: Controll ORP

Posted: Tue Dec 03, 2013 1:57 pm
by rimai
Nothing you would see.
You would probably save a few bytes of code, but nothing noticeable would happen.

Re: Controll ORP

Posted: Wed Dec 04, 2013 1:20 am
by Pny
The code you posted here has an undefined region between 300 and 400. The code line in the setup will turn on your ozone unit at power up (power cycle)... If the line is removed I assume it will be off until the Orp level goes down to 300.