Log Water level

Do you have a question on how to do something.
Ask in here.

Posts: 19
Joined: Wed Sep 03, 2014 12:40 am
PostPosted: Sun Sep 28, 2014 1:37 am
Hi guys,

Just wondering if there's a way i can log the water level. I have the waterlevel expansion and i was just wanting to generate some simple graphs like the default ph and Temp ones but for waterlevel. Any ideas how to do this?
Image
User avatar
Posts: 20
Joined: Sun Mar 10, 2013 12:22 am
PostPosted: Sun Sep 28, 2014 3:06 am
I think this is what you're after:

http://forum.reefangel.com/status/chart.aspx?id=tom_swell&filter=wl

full details are on this thread:

http://forum.reefangel.com/viewtopic.php?f=20&t=771

Posts: 19
Joined: Wed Sep 03, 2014 12:40 am
PostPosted: Mon Sep 29, 2014 1:29 am
Cheers mate,

These are the codes I'm using right now which rely on water level. First one is for ATO and second one is too ensure pump switches off if water level gets so high:

ReefAngel.WaterLevelATO( Port6,60,88,92 );
////// Place your custom code below here
if (ReefAngel.WaterLevel.GetLevel() >= 100) ReefAngel.Relay.Off(Port6);

My only problem is, the Water has been topped up by the ATO to 96, and it keeps on topping it up to a higher level than it should according to that code. Like i've seen it turn on when the water level is already at 94 and add water to the tank. Anyone have ideas why this is happening?
Image
User avatar
Posts: 5361
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Sep 29, 2014 5:25 am
First make sure your ATO pump isn't getting a siphon. That was the issue the last time we saw this problem. Even though it was a peristaltic pump!!

Second, post your full code so we can make sure there are no other issues conflicting.

Posts: 19
Joined: Wed Sep 03, 2014 12:40 am
PostPosted: Tue Sep 30, 2014 12:15 am
Definitely not creating a siphon as the ato reservoir is below the tank and the hose output is about 8cm above water level so there's no way it could create a siphon and even if it did, that would result in water flowing down into the reservoir leaving a lower water level. My issue is that mater level is too high for some reason.

Here's my full code:
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.AddWaterLevelExpansion();  // Water Level Expansion Module
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port1Bit | Port2Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port3Bit | Port5Bit | Port6Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port4Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port3Bit | Port4Bit;
    // 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( Port1 );
    ReefAngel.Relay.On( Port2 );
    ReefAngel.Relay.On( Port4 );
    ReefAngel.Relay.On( Port5 );

    ////// Place additional initialization code below here
    ReefAngel.CustomLabels[0]="Left Wavemaker"; 
    ReefAngel.CustomLabels[1]="Right Wavemaker"; 
    ReefAngel.CustomLabels[2]="Heater"; 
    ReefAngel.CustomLabels[3]="Light"; 
    ReefAngel.CustomLabels[4]="Skimmer"; 
    ReefAngel.CustomLabels[5]="ATO"; 
    ReefAngel.CustomLabels[6]="Unused"; 
    ReefAngel.CustomLabels[7]="Unused"; 

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

void loop()
{
    ReefAngel.StandardHeater( Port3,240,250 );
    ReefAngel.WaterLevelATO( Port6,60,88,92 );
    ////// Place your custom code below here
    if (ReefAngel.WaterLevel.GetLevel() >= 100) ReefAngel.Relay.Off(Port6);

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

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



Thanks a lot,
Tom
Image

Posts: 12288
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Tue Sep 30, 2014 7:59 am
I don't see anything wrong with it.
Can we try something different?
Try this code instead:
Code: Select all
if (ReefAngel.WaterLevel.GetLevel() > 0 && ReefAngel.WaterLevel.GetLevel() <= 88)
  ReefAngel.Relay.On(Port6);
if (ReefAngel.WaterLevel.GetLevel() >= 92)
  ReefAngel.Relay.Off(Port6);
Roberto.

Posts: 19
Joined: Wed Sep 03, 2014 12:40 am
PostPosted: Tue Sep 30, 2014 3:14 pm
Hi Roberto, does that just go where the old ATO code was or should it go in the custom code section? Thanks for all your help!
Image

Posts: 12288
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Tue Sep 30, 2014 4:11 pm
Yes, remove the old ATO function and add this code.
Roberto.

Return to How do I code ...

Who is online

Users browsing this forum: No registered users and 2 guests