Page 1 of 1

ORP as a controller

Posted: Sun Dec 16, 2012 7:03 am
by butcherman
Can i use the orp expantion as a controller to turn ozone unit on and off?

Re: ORP as a controller

Posted: Sun Dec 16, 2012 8:33 am
by binder
butcherman wrote:Can i use the orp expantion as a controller to turn ozone unit on and off?
Yes, you can do this. I do not believe this functionality is built into the libraries. You can do something like this:

Code: Select all

if (ReefAngel.Params.ORP >= 400 ) ReefAngel.Relay.Off(Port8);
if (ReefAngel.Params.ORP <= 300 ) ReefAngel.Relay.On(Port8);
This code simply says if the ORP is above 400, turn off Port 8 and if it's below 300, turn on Port 8. So once it turns on Port 8, it will say on until it gets to 400 and then it will shut it off and stay off until it gets as low as 300.
You would place this code inside your loop() along with the other functions. You can also change the values. I do not know what values are good for ORP, so I just picked some to use as an example.

Re: ORP as a controller

Posted: Sun Dec 16, 2012 9:46 am
by butcherman
Can i use the ph funcion on port8 on the wizzard and change the ph code to orp code?

Re: ORP as a controller

Posted: Sun Dec 16, 2012 9:53 am
by butcherman
will this work

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()
{
}

Re: ORP as a controller

Posted: Sun Dec 16, 2012 10:31 am
by rimai
No, it won't work :(
You will need to use the code posted by binder

Re: ORP as a controller

Posted: Sun Dec 16, 2012 10:43 am
by butcherman
rimai wrote:No, it won't work :(
You will need to use the code posted by binder
i incorperated it in the code
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

Re: ORP as a controller

Posted: Sun Dec 16, 2012 10:50 am
by rimai
You got it :)

Re: ORP as a controller

Posted: Sun Dec 16, 2012 11:07 am
by butcherman
thx, as soon as i get some orp calibration fluid ill try it out.

Re: ORP as a controller

Posted: Mon Dec 17, 2012 3:26 am
by butcherman
if i change the library code can i use 220mV calibration fluid?

Re: ORP as a controller

Posted: Mon Dec 17, 2012 9:12 am
by rimai
yes

Re: ORP as a controller

Posted: Mon Dec 17, 2012 11:44 am
by butcherman
Thanks will see what i can get me hands on.

Re: ORP as a controller

Posted: Wed Dec 19, 2012 10:07 am
by butcherman
how do I know if the orp expansion os working. I have a STD pwm module wifi unit and orp expansion module. I have loaded the code and ,injected the expansion module. The orp readout remains 0 even in calibration fluid. After calibration. There are do values displayed during calibration either besides 0. What should I try to test the expansion module or the USB port on the relay box?

Sent from my GT-I9100 using Tapatalk 2

Re: ORP as a controller

Posted: Wed Dec 19, 2012 10:11 am
by rimai
Have you checked the jumpers in the head unit?

Re: ORP as a controller

Posted: Wed Dec 19, 2012 10:21 am
by butcherman
I will re-check that.

Anything else?

Sent from my GT-I9100 using Tapatalk 2

Re: ORP as a controller

Posted: Wed Dec 19, 2012 9:12 pm
by butcherman
My unit only had one jumper I had only moved it. I added a second and it and now it seems to be working. do I need both jumpers inplace?

Sent from my GT-I9100 using Tapatalk 2

Re: ORP as a controller

Posted: Wed Dec 19, 2012 9:14 pm
by rimai
You need all 3.
If you are missing any and don't have laying around, send me a PM

Re: ORP as a controller

Posted: Wed Dec 19, 2012 11:35 pm
by butcherman
I have spares from old hard drives and cdroms, I'll put in all 3

Sent from my GT-I9100 using Tapatalk 2