New ATO pressure switch-setup with Wizard?

Expansion modules and attachments
alexwbush
Posts: 327
Joined: Tue Mar 22, 2011 12:45 am
Location: San Diego, CA

Re: New ATO pressure switch-setup with Wizard?

Post 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.
barbianj
Posts: 56
Joined: Sat Jul 21, 2012 12:25 pm

Re: New ATO pressure switch-setup with Wizard?

Post 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
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: New ATO pressure switch-setup with Wizard?

Post by rimai »

in the loop section.
Make sure you get rid of whatever other function you are using on the same port.
Roberto.
barbianj
Posts: 56
Joined: Sat Jul 21, 2012 12:25 pm

Re: New ATO pressure switch-setup with Wizard?

Post 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()
{
}
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: New ATO pressure switch-setup with Wizard?

Post by rimai »

yeap
Roberto.
barbianj
Posts: 56
Joined: Sat Jul 21, 2012 12:25 pm

Re: New ATO pressure switch-setup with Wizard?

Post 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.
Image
barbianj
Posts: 56
Joined: Sat Jul 21, 2012 12:25 pm

Re: New ATO pressure switch-setup with Wizard?

Post by barbianj »

The ATO is still working without issue. :D
Image
Sebyte

Re: New ATO pressure switch-setup with Wizard?

Post 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.
barbianj
Posts: 56
Joined: Sat Jul 21, 2012 12:25 pm

Re: New ATO pressure switch-setup with Wizard?

Post 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.
Image
Sebyte

Re: New ATO pressure switch-setup with Wizard?

Post 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.
dazza1304
Posts: 154
Joined: Sat Aug 04, 2012 4:22 am

Re: New ATO pressure switch-setup with Wizard?

Post by dazza1304 »

Hi just to let you know, I also updated the files Roberto provided and tried this and it works a treat!! :D
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: New ATO pressure switch-setup with Wizard?

Post by rimai »

Awesome!!!
I'll include the changes to the next update of the libraries :)
Roberto.
dazza1304
Posts: 154
Joined: Sat Aug 04, 2012 4:22 am

Re: New ATO pressure switch-setup with Wizard?

Post 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 7017 times
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: New ATO pressure switch-setup with Wizard?

Post 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?
Roberto.
dazza1304
Posts: 154
Joined: Sat Aug 04, 2012 4:22 am

Re: New ATO pressure switch-setup with Wizard?

Post 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.
dazza1304
Posts: 154
Joined: Sat Aug 04, 2012 4:22 am

Re: New ATO pressure switch-setup with Wizard?

Post 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!
dazza1304
Posts: 154
Joined: Sat Aug 04, 2012 4:22 am

Re: New ATO pressure switch-setup with Wizard?

Post 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 7011 times
The next a zoom in post calibration - much more stable - but no idea why!!??
wl2.tiff
wl2.tiff (59.69 KiB) Viewed 7011 times
dazza1304
Posts: 154
Joined: Sat Aug 04, 2012 4:22 am

Re: New ATO pressure switch-setup with Wizard?

Post 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 7008 times
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: New ATO pressure switch-setup with Wizard?

Post by rimai »

I think the first calibration could've been flaky.
Roberto.
carlii
Posts: 84
Joined: Sat Mar 17, 2012 7:22 pm

Re: New ATO pressure switch-setup with Wizard?

Post by carlii »

I tested the code today and it worked perfectly.
Sebyte

Re: New ATO pressure switch-setup with Wizard?

Post 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 :)
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: New ATO pressure switch-setup with Wizard?

Post by rimai »

It's in the queue, but no target date yet.
I'm thinking sometime in Jan.
Happy holidays!!
Roberto.
barbianj
Posts: 56
Joined: Sat Jul 21, 2012 12:25 pm

Re: New ATO pressure switch-setup with Wizard?

Post by barbianj »

Still working flawlessly. The accuracy is amazing. Everyone should have this.
Image
Sebyte

Re: New ATO pressure switch-setup with Wizard?

Post 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 :)
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: New ATO pressure switch-setup with Wizard?

Post 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?
Roberto.
Sebyte

Re: New ATO pressure switch-setup with Wizard?

Post 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()
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: New ATO pressure switch-setup with Wizard?

Post by rimai »

Try this:

Code: Select all

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

Re: New ATO pressure switch-setup with Wizard?

Post 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.
dazza1304
Posts: 154
Joined: Sat Aug 04, 2012 4:22 am

Re: New ATO pressure switch-setup with Wizard?

Post 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?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: New ATO pressure switch-setup with Wizard?

Post 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
Roberto.
Post Reply