ORP Module troubles

Expansion modules and attachments
Post Reply
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

ORP Module troubles

Post by joshlawless »

I'm having some trouble with my ORP Expansion module:

The display on the main screen of the controller flashes two and three digit gibberish under the "ORP" label, and on the local Wifi page, the portal, and the r99 page, the ORP value shows up as zero. It worked for a few days, then stopped, and I don't recall any code change that would have impacted it. I tried re-calibrating (after changing the values in ReefAngel.cpp and ReefAngel_1.5_LCD.h from 470 to 400), and the calibration appears to work normally -- with the terminator on the BNC connection, I see a raw value of around 1660, and when I connect the probe and submerge in 400mV PinPoint calibration fluid, I see the raw value fall to around 400. So it's getting data from the probe, but it doesn't know what to do with it. I tried leaving the probe in the calibration fluid to see if maybe my tank values are outside of the measurable limit (don't worry, no livestock yet). Even in the 400mV calibration fluid, however, I just see a sort of gibberish on screen.
IMG_0697.jpg
IMG_0697.jpg (55.03 KiB) Viewed 6097 times
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: ORP Module troubles

Post by rimai »

The calibration numbers look correct.
Are they stable?
When you finish the calibration, leave the probe in the fluid. Does it still show wrong numbers for ORP values?
Roberto.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: ORP Module troubles

Post by joshlawless »

Calibration numbers are stable -- after finishing calibration, if I leave the probe in the 400mV solution, the screen immediately displays the above
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: ORP Module troubles

Post by rimai »

What happens if you go back to the original libraries?
Roberto.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: ORP Module troubles

Post by joshlawless »

I deleted all my library folders, uninstalled Arduino, re-installed from scratch, re-updated the libraries to 1.1.1, and compiled with my .ino file below:

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 <PAR.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.Use2014Screen();  // Let's use 2014 Screen 
    ReefAngel.AddSalinityExpansion();  // Salinity Expansion Module
    ReefAngel.AddORPExpansion();  // ORP Expansion Module
    ReefAngel.AddWaterLevelExpansion();  // Water Level Expansion Module
//    ReefAngel.AddExtraTempProbes();  // Accommodate 4th temperature probe in parallel
//    pinMode(lowATOPin,OUTPUT);  // Use ATO as dimming port (the low pin is furthest from centerline of controller)
//    pinMode(highATOPin,OUTPUT); // Use ATO as dimming port (the high pin is closest to centerline of controller)

//    ReefAngel.CustomVar[7]=255;   // inclusion of non-0 custom variable shows custom variables in the portal
     
     
// Ports toggled in Feeding Mode

    ReefAngel.FeedingModePorts = Port1Bit | Port2Bit | Port3Bit;
    ReefAngel.FeedingModePortsE[0] = Port1Bit | Port4Bit;

// Ports toggled in Water Change Mode

    ReefAngel.WaterChangePorts = Port1Bit | Port2Bit;
    ReefAngel.WaterChangePortsE[0] = Port1Bit | Port4Bit;

// Ports toggled when Lights On / Off menu entry selected

    ReefAngel.LightsOnPorts = 0;
    ReefAngel.LightsOnPortsE[0] = 0;

// Ports turned off when Overheat temperature exceeded

    ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit;
    ReefAngel.OverheatShutoffPortsE[0] = 0;

// Use T2 probe (in display tank) for temp functions and T3 probe (in skimmer section) for overheat functions

    ReefAngel.TempProbe = T2_PROBE;
    ReefAngel.OverheatProbe = T3_PROBE;

// Feeeding and Water Change mode speed

    ReefAngel.DCPump.FeedingSpeed=0;
    ReefAngel.DCPump.WaterChangeSpeed=0;



    // Ports that are always on
    ReefAngel.Relay.On( Port6 );
    ReefAngel.Relay.On( Box1_Port1 );  // Circulation pump
    ReefAngel.Relay.On( Box1_Port2 );  // FlowWolf
    ReefAngel.Relay.On( Box1_Port5 );  // return pump L
    ReefAngel.Relay.On( Box1_Port6 );  // return pump R
}

void loop()
{

    ReefAngel.StandardHeater( Port1 );  // Heater1 uses standard values in memory 
    if ( ReefAngel.Params.Temp[T1_PROBE] < (InternalMemory.HeaterTempOn_read() - 2)) { ReefAngel.Relay.On(Port2); };  // Heater2 uses wider range than Heater 1 (broadened by 0.2 degrees from each side of range), and is on less often
    if ( ReefAngel.Params.Temp[T1_PROBE] > (InternalMemory.HeaterTempOff_read() + 2)) { ReefAngel.Relay.Off(Port2); };  

    ReefAngel.Relay.DelayedOn( Port3 );  // Skimmer is delayed to allow water level in skimmer section to adjust following return pump activation
    ReefAngel.DosingPumpRepeat1( Port4 );  // Skimmer neck wipe is handled by internal memory location

    ReefAngel.DCPump.UseMemory = false;  // Return pump mode and settings handled by internal memory location
    ReefAngel.DCPump.Threshold = 45;
    ReefAngel.DCPump.SetMode(Sine,100,120); 
    ReefAngel.DCPump.DaylightChannel = Sync;  // Daylight channel handles right/left (determine) pump
    ReefAngel.DCPump.ActinicChannel = AntiSync ;  // Actinic channel handles left/right (determine) pump


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

    // This should always be the last line
    ReefAngel.Portal( "joshlawless" );
    ReefAngel.DDNS( "reef" ); // Your DDNS is joshlawless-reef.myreefangel.com
    ReefAngel.ShowInterface();
}
Still no luck.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: ORP Module troubles

Post by joshlawless »

i stand corrected. It's reading 306 now. Hmmm. Time to start uncommenting lines.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: ORP Module troubles

Post by joshlawless »

Uncommenting a few lines at a time I eventually was able to trigger the behavior again.

When I uncommented this block:

Code: Select all

    if (ReefAngel.Params.ORP>450) ReefAngel.Relay.Off(Port8);  // If ORP > 450mV, then turn off ozone generator
    if (ReefAngel.Params.ORP=0) ReefAngel.Relay.Off(Port8);  // If ORP =  0mV (e.g., probe disconnected), then turn off ozone generator
    if (ReefAngel.Params.ORP<400 && ReefAngel.Params.ORP>0) ReefAngel.Relay.On(Port8);  // If ORP < 400mV, then turn on ozone generator (unless ORP=0, indicating missing ORP probe)
It went back to displaying the glitch.

Commenting out the middle line

Code: Select all

    if (ReefAngel.Params.ORP=0) ReefAngel.Relay.Off(Port8);  // If ORP =  0mV (e.g., probe disconnected), then turn off ozone generator
Returned behavior to normal.

Oddly, I had this whole block commented out before, and the glitch was still happening.


In any event, I don't see a logical error in these lines -- and I want to preserve the functionality of turning the relay off, in the event the ozone generator is on when the probe is disconnected. Just the two lines remaining don't seem like they would ever turn it off.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: ORP Module troubles

Post by rimai »

When making a comparison, you must use == instead of =
Single = is a assignment instead of comparison.
Roberto.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: ORP Module troubles

Post by joshlawless »

That would explain it! It was toggling between the measured and assigned values on each loop(). Thanks for the help!
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: ORP Module troubles

Post by joshlawless »

So, apparently there's something else going on with my ORP probe. While in the process of calibrating the salinity probe, I noticed that my ORP values shot up to 550, and then pinned at 0, after removing the salinity probe from the tank, calibrating it in a reference solution, and then putting it back in. Pulling the salinity probe out of the tank would allow the ORP probe to return the expected values (~360). Alternately removing and replacing the probes, I could not get a consistent repetition of the behavior, but I note that the ORP would, variously:

drift down significantly (from 360 down to ~280 in a matter of minutes)
jump up to 550 and pin there
sometimes jump to 550 and then return a jibberish value (like in the photo)

Sometimes removing the salinity probe corrects the behavior, sometimes not.
Sometimes wiggling the BNC terminal on the ORP probe briefly causes the value to jump up to ~360 again, before returning to 280ish

I tried removing various other tank components from the power supply, in case there was some leaky voltage issue. Not sure where to go from here, though. Seems to be a problem between the ORP and Salinity probes, pretty consistently.

It might be that the probe wire for the ORP probe is a bit funky. Just manipulating the probe can cause the values to change dramatically -- maybe nothing to do with the salinity probe, just the action of moving the ORP probe while removing the salinity probe might be causing the issue.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: ORP Module troubles

Post by rimai »

Just to be sure, you did use separate power supplies for each of them, right?
Roberto.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: ORP Module troubles

Post by joshlawless »

I did. The original power supplies that came with, plugged in to the same power strip/surge protector.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: ORP Module troubles

Post by joshlawless »

Some more diagnostics -- if I fully submerge the probe, the ORP jumps to 550 and stays there, and sometimes even displays gibberish. If I submerge the bottom inch or so of the probe, it measures ~ 270. If I slowly increase the depth of the tip (yeah, I couldn't think of another way to word that), the measured ORP value increases.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: ORP Module troubles

Post by rimai »

Leave just the tip submerged and report back if everything works as intended.
Roberto.
Post Reply