When first setup, calibrated to 35 ppt, and salt added to the setup, it would show much higher than my refractometer (45 ppt with the refractometer at 35 ppt). On further attempts to calibrate it, it got closer, but not quite there. During one attempt, the salinity went to 5.9 and hasn't moved since.
I got another probe since I'd need two anyway (water change salt station) and the same results, a solid 5.9 all the time. I just received my second salinity module today (w/third probe as I forgot it came with one) and swapped it in and the salinity still doesn't move.
My code is below, any suggestions:
Another thing, when I go to perform a salinity calibration, my RA* cycles ports on my relay expansion box as if it were rebooting.
Code: Select all
#include <Salinity.h>
#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_TS.h>
#include <RA_TouchLCD.h>
#include <RA_TFT.h>
#include <RA_TS.h>
#include <Font.h>
#include <RA_Wifi.h>
#include <RA_Wiznet5100.h>
#include <SD.h>
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetDHCP.h>
#include <PubSubClient.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_ATO.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 <RA_CustomLabels.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <Humidity.h>
#include <PAR.h>
#include <DCPump.h>
#include <ReefAngel.h>
#include <SoftwareSerial.h>
////// Place global variable code below here
#define Heater1 Box1_Port1
#define Heater2 Box1_Port3
#define Heater3 Box1_Port5
#define Salexp Box1_Port7
#define Return Box1_Port2
#define Topoff Box1_Port4
#define Skimmer Box1_Port6
#define QTFiltHeat Box1_Port8
////// Place global variable code above here
void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
ReefAngel.Star();
ReefAngel.AddSalinityExpansion(); // Salinity Expansion Module
ReefAngel.AddMultiChannelWaterLevelExpansion(); // Multi-Channel Water Level Expanion Module
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = 0;
ReefAngel.FeedingModePortsE[0] = Port2Bit | Port4Bit | Port6Bit;
ReefAngel.FeedingModePortsE[1] = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = 0;
ReefAngel.WaterChangePortsE[0] = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port5Bit | Port6Bit;
ReefAngel.WaterChangePortsE[1] = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = 0;
ReefAngel.OverheatShutoffPortsE[0] = Port1Bit | Port3Bit | Port5Bit | Port6Bit | Port7Bit;
ReefAngel.OverheatShutoffPortsE[1] = 0;
// Ports turned off when Leak is detected
ReefAngel.LeakShutoffPorts = 0;
ReefAngel.LeakShutoffPortsE[0] = Port1Bit | Port3Bit | Port4Bit | Port5Bit | Port6Bit;
ReefAngel.LeakShutoffPortsE[1] = 0;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
ReefAngel.LightsOnPortsE[0] = 0;
ReefAngel.LightsOnPortsE[1] = 0;
// Add fourth temperature probe
// ReefAngel.Params.Temp[T4_PROBE];
// Displays Temp 4, 5, and 6
ReefAngel.AddExtraTempProbes();
// Use T2 probe as temperature and overheat functions
ReefAngel.TempProbe = T2_PROBE;
ReefAngel.OverheatProbe = T2_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 810 );
// Ports that are always on
ReefAngel.Relay.On( Return );
ReefAngel.Relay.On( Salexp );
ReefAngel.Relay.On( QTFiltHeat );
// Ports that are always off
ReefAngel.Relay.Off( Topoff );
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardHeater( T2_PROBE,Heater1,770,790 );
ReefAngel.StandardHeater( T2_PROBE,Heater2,760,790 );
ReefAngel.StandardHeater( T2_PROBE,Heater3,750,790 );
// ReefAngel.Relay.DelayedOn( Topoff,3 ); // Time is in minutes
ReefAngel.Relay.DelayedOn( Skimmer,3 ); // Time is in minutes
boolean buzzer=false;
if ( ReefAngel.isOverheat() ) buzzer=true;
if ( ReefAngel.isBusLock() ) buzzer=true;
if ( buzzer ) ReefAngel.BuzzerOn(2); else ReefAngel.BuzzerOff();
if ( ReefAngel.WaterLevel.GetLevel(2) <= 36 ) ReefAngel.Relay.Off( Return );
if ( ReefAngel.WaterLevel.GetLevel(2) >= 81 ) ReefAngel.Relay.On( Return );
if ( ReefAngel.WaterLevel.GetLevel(2) <= 45 && ReefAngel.WaterLevel.GetLevel(2) > 9 ) ReefAngel.Relay.On( Topoff );
if ( ReefAngel.WaterLevel.GetLevel(2) >= 81 ) ReefAngel.Relay.Off( Topoff );
if ( ReefAngel.WaterLevel.GetLevel(2) <= 9 ) ReefAngel.Relay.Off( Topoff );
if ( ReefAngel.WaterLevel.GetLevel(1) < 72 && ReefAngel.WaterLevel.GetLevel(1) > 9 ) // Main Heater run-dry protection
{
ReefAngel.Relay.Off( Heater1 );
ReefAngel.Relay.Off( Heater2 );
ReefAngel.Relay.Off( Heater3 );
}
if ( ReefAngel.WaterLevel.GetLevel(3) < 99 ) // Quarantine tank run-dry proctection (no auto topoff yet)
{
ReefAngel.Relay.Off( QTFiltHeat );
buzzer=true;
}
else ReefAngel.Relay.On( QTFiltHeat );
////// Place your custom code below here
////// Place your custom code above here
ReefAngel.Network.Cloud();
// This should always be the last line
ReefAngel.ShowTouchInterface();
}
// RA_STRING1=U2FsdGVkX1++tf9HT7e2xzsveeJ58UUddShZ2D1rfts=
// RA_STRING2=null
// RA_STRING3=null
// RA_LABEL LABEL_ACTINIC=Actinic
// RA_LABEL LABEL_ACTINIC2=Actinic 2
// RA_LABEL LABEL_DAYLIGHT=Daylight
// RA_LABEL LABEL_DAYLIGHT2=Daylight 2
// RA_LABEL LABEL_PORT11=Heater 1
// RA_LABEL LABEL_PORT12=Return DCP-10000
// RA_LABEL LABEL_PORT13=Heater 2
// RA_LABEL LABEL_PORT14=ATO (Level 2)
// RA_LABEL LABEL_PORT15=Heater 3
// RA_LABEL LABEL_PORT16=Skimmer
// RA_LABEL LABEL_PORT17=Salinity expansion
// RA_LABEL LABEL_PORT18=QT heat/filter
// RA_LABEL LABEL_PORT21=Port 21
// RA_LABEL LABEL_PORT22=Port 22
// RA_LABEL LABEL_PORT23=Port 23
// RA_LABEL LABEL_PORT24=Port 24
// RA_LABEL LABEL_PORT25=Port 25
// RA_LABEL LABEL_PORT26=Port 26
// RA_LABEL LABEL_PORT27=Port 27
// RA_LABEL LABEL_PORT28=Port 28