Page 2 of 3

Re: New ATO pressure switch-setup with Wizard?

Posted: Fri Oct 26, 2012 6:31 pm
by alexwbush
happy to test after next weekend when I return to SD :D

I have to figure out the wifi issues I've been having, but I'll open that discussion after I get back.

Re: New ATO pressure switch-setup with Wizard?

Posted: Tue Nov 13, 2012 9:07 pm
by barbianj
I can give this a try in the next few days. I see where the files get overwritten, but where does the code go?

rimai wrote:I pushed the libraries changes to branch issue54.
We just need to test :)
Anyone interested?
The function works like this:

Code: Select all

  ReefAngel.WaterLevelATO(Port1,30,61,63);
ATO pump on Port1
Timeout is 30 seconds
Low Level is 61
High Level is 63

You will need the attached files:
Overwrite the existing ones:
ReefAngel.cpp - Documents\Arduino\libraries\ReefAngel
ReefAngel.h - Documents\Arduino\libraries\ReefAngel
feature.txt - Documents\Arduino\update

Re: New ATO pressure switch-setup with Wizard?

Posted: Tue Nov 13, 2012 10:06 pm
by rimai
in the loop section.
Make sure you get rid of whatever other function you are using on the same port.

Re: New ATO pressure switch-setup with Wizard?

Posted: Tue Nov 13, 2012 10:34 pm
by barbianj
Like this?
#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
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port1Bit | Port5Bit | Port6Bit | Port8Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port7Bit | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port2Bit | Port3Bit | Port4Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = 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( 790 );


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

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


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

void loop()
{
ReefAngel.StandardLights( Port2,6,0,23,0 );
ReefAngel.StandardLights( Port3,13,30,22,0 );
ReefAngel.StandardLights( Port4,14,0,18,0 );
ReefAngel.WavemakerRandom( Port5,5,7 );
ReefAngel.StandardHeater( Port7,768,771 );
ReefAngel.WaterLevelATO(Port1,50,42,45);

////// Place your custom code below here



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

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

// Water Level
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,75,66, "WL:" );
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,99,66, ReefAngel.WaterLevel.GetLevel() );
pingSerial();

// Main Relay Box
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox( 12, 92, TempRelay );
pingSerial();

// Date and Time
ReefAngel.LCD.DrawDate( 6, 122 );
pingSerial();
}

void DrawCustomGraph()
{
}

Re: New ATO pressure switch-setup with Wizard?

Posted: Tue Nov 13, 2012 11:01 pm
by rimai
yeap

Re: New ATO pressure switch-setup with Wizard?

Posted: Wed Nov 14, 2012 5:24 pm
by barbianj
Ran the new code and everything seems to function fine. The pump cycled correctly without the rapid on-off clicking.

I used these settings:

ReefAngel.WaterLevelATO(Port1,60,43,45);

I tightened up the level from 42 to 43, giving a 2% total range. On the 100 gallon stock tank sump, that required the ATO pump to run for approximately 45 seconds, pumping about 1 gallon of water.

When I removed enough water to lower the sump level to 43, the ATO pump turned on, filled to 45, then turned off as expected.

Then, I removed enough water to lower the sump level to 40. The ATO turned on, then shut off after 60 seconds and the red status light on the controller lit up. After pressing ATO clear, the pump turned back on.

So far, so good.

Re: New ATO pressure switch-setup with Wizard?

Posted: Fri Nov 16, 2012 12:01 pm
by barbianj
The ATO is still working without issue. :D

Re: New ATO pressure switch-setup with Wizard?

Posted: Sat Nov 17, 2012 6:01 am
by Sebyte
For clarification when you do the 100% part of the calibration how much of the tube should be submerged?

The reason for asking is that on my RSM250 the sump is built into the back section of the tank. To get the skimmer to function well I need to have a constant water level in the sump section. When I calibrated the tube I set the the bottom of the top section cap to the desired water level.

Using the code given I removed water until the ATO pump started. This was around the 61% level, then refilled to about 63% as expected. This was no help to me. So I changed the settings in the code to 97 & 100.

This works but the pump flutters on and off a lot. Am I calibrating the tube correctly, any comments welcome.

Re: New ATO pressure switch-setup with Wizard?

Posted: Sat Nov 17, 2012 7:46 am
by barbianj
It sounds like you did the calibration correctly. After I did the calibration, I filled the sump to the level that i wanted to maintain, then zip tied the tube in the sump so that the water level was roughly in the middle of the tube. This gave a reading of 45. As long as the tube is in the same position, 45 will always be the max level.

You should fill your skimmer section to the desired level, then fasten the tube so that its halfway in the water, then whatever reading you get would be max fill, then go from there.

Re: New ATO pressure switch-setup with Wizard?

Posted: Sun Nov 18, 2012 1:59 pm
by Sebyte
It sounds like you did the calibration correctly. After I did the calibration, I filled the sump to the level that i wanted to maintain, then zip tied the tube in the sump so that the water level was roughly in the middle of the tube. This gave a reading of 45. As long as the tube is in the same position, 45 will always be the max level.
The problem being that the RSM250 is an all in one system. The sump part on the back is covered by the hood. I cannot raise the tube enough to have the desired water level in the centre of the tube. That is why I changed the values to 97, 99.

At the moment I cannot see a way around this. My best guess would be that mid range is the most stable area to have the sensor working in, not at the top end as is my situation.

Re: New ATO pressure switch-setup with Wizard?

Posted: Fri Nov 23, 2012 3:35 am
by dazza1304
Hi just to let you know, I also updated the files Roberto provided and tried this and it works a treat!! :D

Re: New ATO pressure switch-setup with Wizard?

Posted: Fri Nov 23, 2012 5:17 am
by rimai
Awesome!!!
I'll include the changes to the next update of the libraries :)

Re: New ATO pressure switch-setup with Wizard?

Posted: Tue Nov 27, 2012 5:11 am
by dazza1304
Hi Roberto,

It seems my WL sensor "bounces" around quite a bit, and I cannot see why? The chamber of my sump I am using it in, is very still so I cannot see why it bounces around so much.

My tube is def air tight also!!

Just to give you an indication, if I take 1 litre of water out, that causes the WL to drop by about 5%.

Any ideas?
wl.tiff
wl.tiff (137.13 KiB) Viewed 7796 times

Re: New ATO pressure switch-setup with Wizard?

Posted: Tue Nov 27, 2012 5:22 am
by rimai
Are you sure you calibrated it correctly?
Does it measure 1% when the water is just barely at the end of the pvc pipe and 100% when it is at the top of the pvc pipe?

Re: New ATO pressure switch-setup with Wizard?

Posted: Tue Nov 27, 2012 5:23 am
by dazza1304
rimai wrote:Are you sure you calibrated it correctly?
Does it measure 1% when the water is just barely at the end of the pvc pipe and 100% when it is at the top of the pvc pipe?
Yep, I have just recalibrated and will see what happens.

Re: New ATO pressure switch-setup with Wizard?

Posted: Tue Nov 27, 2012 5:27 am
by dazza1304
Very strange, just by redoing the calibration, it seems it is much more stable.

I will let it log for a few hours and post up the graph!

Re: New ATO pressure switch-setup with Wizard?

Posted: Tue Nov 27, 2012 8:14 am
by dazza1304
Definitely, more stable for some reason?

This first pic you can see the improvement just by recalibrating:
wl1.tiff
wl1.tiff (44.8 KiB) Viewed 7790 times
The next a zoom in post calibration - much more stable - but no idea why!!??
wl2.tiff
wl2.tiff (59.69 KiB) Viewed 7790 times

Re: New ATO pressure switch-setup with Wizard?

Posted: Tue Nov 27, 2012 10:00 am
by dazza1304
Well, it now seems that it is drifting - you can see by the pic after the cal, nice and stable and over time drifting, latest being a 5% swing.

Any ideas Roberto?

I am going to re route the sensor in case it is picking up some interference.
wl3.tiff
wl3.tiff (78.68 KiB) Viewed 7787 times

Re: New ATO pressure switch-setup with Wizard?

Posted: Tue Nov 27, 2012 10:37 am
by rimai
I think the first calibration could've been flaky.

Re: New ATO pressure switch-setup with Wizard?

Posted: Sat Dec 15, 2012 12:02 pm
by carlii
I tested the code today and it worked perfectly.

Re: New ATO pressure switch-setup with Wizard?

Posted: Fri Dec 21, 2012 8:27 am
by Sebyte
Hi Roberto
I pushed the libraries changes to branch issue54.
Just wondering when the libraries will be updated to contain the files you listed in the posting above so that they do not need re-installing after running RA Installer?

Also have a happy holiday :)

Re: New ATO pressure switch-setup with Wizard?

Posted: Fri Dec 21, 2012 10:02 am
by rimai
It's in the queue, but no target date yet.
I'm thinking sometime in Jan.
Happy holidays!!

Re: New ATO pressure switch-setup with Wizard?

Posted: Sun Dec 23, 2012 1:08 am
by barbianj
Still working flawlessly. The accuracy is amazing. Everyone should have this.

Re: New ATO pressure switch-setup with Wizard?

Posted: Sat Jan 12, 2013 5:27 am
by Sebyte
I have noticed this too, but not all of the time.

My RA head unit is in the base cabinet and I use remote monitoring via IPad or Cliant suite. My cut off setting is 90% because of how my RSM 250 is constructed with a back section. The reading on the head has shown 900 and 90% on the iPad.

For me it is not a major issue, but if it is a glitch in the display library it needs to be checked out at some time :)

Re: New ATO pressure switch-setup with Wizard?

Posted: Sat Jan 12, 2013 10:39 am
by rimai
It's a problem in your custom screen... It needs to erase the 3rd digit.
Easy to do.... Can you post the line that draws the WL in your custom screen?

Re: New ATO pressure switch-setup with Wizard?

Posted: Sat Jan 12, 2013 3:30 pm
by Sebyte
Roberto

Here is the section from my INO.
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();

    // Water Level
    ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,75,66, "WL:" );
    ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,99,66, ReefAngel.WaterLevel.GetLevel() );
    pingSerial();

    // Main Relay Box
    byte TempRelay = ReefAngel.Relay.RelayData;
    TempRelay &= ReefAngel.Relay.RelayMaskOff;
    TempRelay |= ReefAngel.Relay.RelayMaskOn;
    ReefAngel.LCD.DrawOutletBox( 12, 92, TempRelay );
    pingSerial();

    // Date and Time
    ReefAngel.LCD.DrawDate( 6, 122 );
    pingSerial();
}

void DrawCustomGraph()

Re: New ATO pressure switch-setup with Wizard?

Posted: Sat Jan 12, 2013 10:11 pm
by rimai
Try this:

Code: Select all

      ConvertNumToString(text, ReefAngel.WaterLevel.GetLevel() , 1);
      strcat(text,"  ");
      ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,99,66, text );

Re: New ATO pressure switch-setup with Wizard?

Posted: Sun Jan 13, 2013 9:15 am
by Sebyte
Thanks Roberto.

I have updated the code and will monitor display. It makes sense to turn the value into text and then display the text.

Re: New ATO pressure switch-setup with Wizard?

Posted: Fri Feb 01, 2013 9:44 am
by dazza1304
rimai wrote:It's in the queue, but no target date yet.
I'm thinking sometime in Jan.
Happy holidays!!
Hi Roberto, has this been added to the libraries?

I can see there is a library update, but don't want to update if at the moment if this is overwritten.

Also, where can we see what has been added/changed in the libraries?

Re: New ATO pressure switch-setup with Wizard?

Posted: Fri Feb 01, 2013 9:45 am
by rimai
Yes, the WaterLevelATO() function has been added to the libs.
Check the change log here:
http://forum.reefangel.com/viewtopic.php?f=7&t=1473