ORP calibration with 220mV fluid


Posts: 21
Joined: Wed Mar 27, 2013 2:58 am
Location: Johannesburg, South Africa
PostPosted: Tue Jun 11, 2013 4:51 am
Hi All
Can anyone help me with the code that I would need to calibrate my ORP if I have 220mV fluid?
Thanks!

Posts: 12275
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Tue Jun 11, 2013 8:59 am
You need to update the libraries, but the problem with updating the libraries is that everytime there is an update, it will overwrite the changes you've made.
But, if you want to give it a shot, you must change the lines:
https://github.com/reefangel/Libraries/ ... l.cpp#L886
https://github.com/reefangel/Libraries/ ... .cpp#L5513
Look for the 470 and change it to 220 or whatever standard that you have.
Roberto.

Posts: 21
Joined: Wed Mar 27, 2013 2:58 am
Location: Johannesburg, South Africa
PostPosted: Wed Jun 12, 2013 3:12 am
Thanks Roberto
To be honest, I am not a code person at all... I tried to take the relevant lines from your links and put them into my code, but I got the error "'Params' was not declared in the scope" or "'ORP' was not declared in this script. Here is my code at the moment:
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 <LCD_Timer.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.Timer[LCD_TIMER].SetInterval(84600);
    ReefAngel.PHMin=523;
    ReefAngel.PHMax=828;
    ReefAngel.UseFlexiblePhCalibration();
    ReefAngel.SetTemperatureUnit( Celsius );  // set to Celsius Temperature

    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port5Bit | Port6Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port5Bit | Port6Bit;
    // 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.TempProbe = T2_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 290 );


    // Ports that are always on
    ReefAngel.Relay.On( Port7 );
    ReefAngel.Relay.On( Port8 );

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

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

void loop()
{
    ReefAngel.StandardATO( Port1,1000 );
    ReefAngel.WavemakerRandom1( Port5,15,60 );
    ReefAngel.WavemakerRandom2( Port6,15,60 );
    ////// Place your custom code below here
   
#if defined ORPEXPANSION
   unsigned long temporp=0;
    for (int a=0;a<20;a++)
    {
       temporp+=ORP.Read();
    }
   Params.ORP=temporp/20;
   if (Params.ORP!=0)
   {
      Params.ORP=map(Params.ORP, ORPMin, ORPMax, 0, 470); // apply the calibration to the sensor reading
      Params.ORP=constrain(Params.ORP,0,550);
   }
   RefreshScreen();
#endif  // defined ORPEXPANSION



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

    // This should always be the last line
    ReefAngel.Portal( "Graham2212" );
    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();

    // Salinity
    ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,15,66, "SAL:" );
    ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,39,66, ReefAngel.Params.Salinity );
    pingSerial();
   
     // ORP
    ReefAngel.LCD.DrawText( COLOR_PALEVIOLETRED,DefaultBGColor,75,54, "ORP:" );
    ReefAngel.LCD.DrawText( COLOR_PALEVIOLETRED,DefaultBGColor,99,54, 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()
{
}


Is there anyway to say maybe "UseFlexibleORPCalibration()" under the setup section, so that I can define in reef angel, that I am using 220mV?

Thank you

Posts: 12275
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Wed Jun 12, 2013 10:07 am
Oh, it won't work if you use in your code.
It needs to be changed in the libraries itself. That's why I said is not a good practice to do that.
Nobody created a "UseFlexibleORPCalibration()" yet.
Maybe if you bug phrusher long enough, he may be able to do that for us :)
He was the one that created the "UseFlexiblePHCalibration()" function.
Roberto.
User avatar
Posts: 5351
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Wed Jun 12, 2013 10:10 am
I can take a look, but I would have no way to test :)

Posts: 21
Joined: Wed Mar 27, 2013 2:58 am
Location: Johannesburg, South Africa
PostPosted: Wed Jun 12, 2013 1:04 pm
I'm very happy to test!! I would really appreciate your help!!

Posts: 90
Joined: Thu Apr 18, 2013 2:16 am
Location: Stockport, Cheshire, UK
PostPosted: Sat Jun 29, 2013 4:41 pm
Hi
I would be really interested in this as well, I have found it impossible to get the 470mv calibration fluid in the uk, some say they can get it but 2 months on nothing.
Image
User avatar
Posts: 5351
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sat Jun 29, 2013 4:45 pm
Sorry i have not had any time to put something together for this..

Posts: 90
Joined: Thu Apr 18, 2013 2:16 am
Location: Stockport, Cheshire, UK
PostPosted: Sat Jun 29, 2013 4:51 pm
lnevo wrote:Sorry i have not had any time to put something together for this..


Sorry no pressure just wanted to register interest :-)

I raised this a while ago and didn't like the idea of messing with the libraries, especially after reading so many posts that said it wasnt wise.

Thanks for the reply though :-)
Image
User avatar
Posts: 5351
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sat Jun 29, 2013 4:56 pm
Sorry i have not had any time to put something together for this..
Next

Return to Ask anything here

Who is online

Users browsing this forum: No registered users and 3 guests

cron