Water Level expansion starting and stopping intermittently

Expansion modules and attachments
Endaar
Posts: 28
Joined: Tue Apr 02, 2013 9:56 pm

Water Level expansion starting and stopping intermittently

Post by Endaar »

Working on getting my Water Level Expansion working. I have used the code that has been posted.
It seems to be turning on intermittently. I'm using the ATO pump I ordered from RA. I have tried the code below on ports 1, 5 and 8 and they all do the same thing so I assume I have done something wrong. The pump has never ran uninterrupted for the 300 seconds. Even when the water level reads 62, the ATO will start and stop for 5-10 seconds.
I have also tried a water level of 81-83 and it does the same thing. I haven't noticed it turning on as long as the level stays above 63. What am I missing?

Code: Select all

void loop()
{
    ReefAngel.StandardHeater( Port3,772,778 );
//    ReefAngel.WaterLevelATO(Port8,300,61,63);
    ReefAngel.WaterLevelATO(Port1,300,61,63);

    ReefAngel.DosingPumpRepeat( Port6,30,120,1 );
    ReefAngel.DosingPumpRepeat( Port7,0,60,2 );
    ////// Place your custom code below here
    
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water Level expansion starting and stopping intermittent

Post by rimai »

Do you have the float switches connected?
Are you using them?
Roberto.
Endaar
Posts: 28
Joined: Tue Apr 02, 2013 9:56 pm

Re: Water Level expansion starting and stopping intermittent

Post by Endaar »

No float switches. Just the water level sensor.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water Level expansion starting and stopping intermittent

Post by rimai »

The way the function works is it will only turn on when level is below 61 and will only turn off when it reaches 63.
So, it is not supposed to turn on when it is above 63%.
Do you have any other function using the same port?
Can we see the entire code?
Roberto.
Endaar
Posts: 28
Joined: Tue Apr 02, 2013 9:56 pm

Re: Water Level expansion starting and stopping intermittent

Post by Endaar »

I used the wizard to generate the code below and I removed the float ATO code and cut and pasted the water level expansion code from one of your post.

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 <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 = 0;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port3Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T2_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 820 );


    // Ports that are always on
  //  ReefAngel.Relay.On( Port1 );
    ReefAngel.Relay.On( Port2 );
    ReefAngel.Relay.On( Port4 );

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

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

void loop()
{
    ReefAngel.StandardHeater( Port3,772,778 );
//    ReefAngel.WaterLevelATO(Port8,300,61,63);
    ReefAngel.WaterLevelATO(Port1,300,61,63);

    ReefAngel.DosingPumpRepeat( Port6,30,120,1 );
    ReefAngel.DosingPumpRepeat( Port7,0,60,2 );
    ////// Place your custom code below here
    

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

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

void DrawCustomMain()
{
    int x,y;
    char text[10];
    // Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params,
    ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
    pingSerial();

    // Salinity
    ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,15,54, "SAL:" );
    ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,39,54, ReefAngel.Params.Salinity );
    pingSerial();

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

    // Main Relay Box
    byte TempRelay = ReefAngel.Relay.RelayData;
    TempRelay &= ReefAngel.Relay.RelayMaskOff;
    TempRelay |= ReefAngel.Relay.RelayMaskOn;
    ReefAngel.LCD.DrawOutletBox( 12, 95, 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: Water Level expansion starting and stopping intermittent

Post by rimai »

Is the red status LED on?
Did you try clearing ATO timeout?
The code looks good.
Roberto.
Endaar
Posts: 28
Joined: Tue Apr 02, 2013 9:56 pm

Re: Water Level expansion starting and stopping intermittent

Post by Endaar »

The red status light was not on. I tried clearing it anyway.
I will see if it did anything.
Endaar
Posts: 28
Joined: Tue Apr 02, 2013 9:56 pm

Re: Water Level expansion starting and stopping intermittent

Post by Endaar »

Roberto,
The ATO is still coming on intermittently. I'm currently at 61 and the pump just cam on for a few seconds then stopped for a minute and ran for a few more seconds.
Any ideas?
Ant
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Water Level expansion starting and stopping intermittently

Post by lnevo »

I would extend your range between the 61 and 63.

The water level sensor bounces around +/-1 or so.. So could easily be hitting unhitting the target numbers..
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water Level expansion starting and stopping intermittent

Post by rimai »

Is your level showing up and down on your screen?
Could it be that it did hit 63% and that's when it stopped?
Roberto.
Endaar
Posts: 28
Joined: Tue Apr 02, 2013 9:56 pm

Re: Water Level expansion starting and stopping intermittent

Post by Endaar »

It's bouncing between 61 and 62 on the screen. If it is at 61 it should run for several minutes before it shuts off since your ATO only does 200mL/min.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water Level expansion starting and stopping intermittent

Post by rimai »

When that 1 minute pause happens, did you check on screen what color port 1 is?
Roberto.
Endaar
Posts: 28
Joined: Tue Apr 02, 2013 9:56 pm

Re: Water Level expansion starting and stopping intermittent

Post by Endaar »

It seems to run continuously if it is under 61 when it gets to 61 it stops and the 1 on the screen shows the relay in the off position. when it is above 61 and it does the start and stop the relay toggles on and off. So it isn't the pump.
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Water Level expansion starting and stopping intermittently

Post by lnevo »

I would still suggest trying 60, 70 as a test.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water Level expansion starting and stopping intermittent

Post by rimai »

What libraries version are you using?
It's not making sense... :?
Roberto.
Endaar
Posts: 28
Joined: Tue Apr 02, 2013 9:56 pm

Re: Water Level expansion starting and stopping intermittent

Post by Endaar »

1.0.3
alexwbush
Posts: 327
Joined: Tue Mar 22, 2011 12:45 am
Location: San Diego, CA

Re: Water Level expansion starting and stopping intermittent

Post by alexwbush »

I was just getting ready to come on here and post the same problem, but I realized I had my low and high levels mixed up. Your symptom would make perfect sense if you accidentally used:

Code: Select all

ReefAngel.WaterLevelATO(Port1,300,63,61);
Since the function is:

Code: Select all

ReefAngel.WaterLevelATO(Port,ATOtimeout,ATOlow,ATOhigh);
But in your case, I am just as puzzled as roberto.
Endaar
Posts: 28
Joined: Tue Apr 02, 2013 9:56 pm

Re: Water Level expansion starting and stopping intermittent

Post by Endaar »

Using the code I have above if I set port 1 to off with the Portal which is the ATO, should it stay in the off position? I had it set to off when I went to bed and woke up this morning to the sound of the ATO running. So it seems the RA reset itself again. The screen locked up like the post above and pushing the controller twice had no effect. Could there be a problem with my head unit?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water Level expansion starting and stopping intermittent

Post by rimai »

The controller will always reset itself when it detects something abnormal.
The ATO and the reset are two different issues. They are not related.
I think the screen scrambling is just the screen, which we can easily replace.
But, if you want to send the whole head unit for replacement, please PM for RMA.
That will still not resolve the issue with the ATO.
Like alexbush mentioned, it would make sense if the values were inverted, but this is not the case for you.
So, let's try another route.
Remove this:

Code: Select all

    ReefAngel.WaterLevelATO(Port1,300,61,63);
And use this instead:

Code: Select all

  if (ReefAngel.WaterLevel.GetLevel()>63) ReefAngel.Relay.Off(Port1);
  if (ReefAngel.WaterLevel.GetLevel()<61 && ReefAngel.WaterLevel.GetLevel()>0) ReefAngel.Relay.On(Port1);
Let us know what happens.
Roberto.
Endaar
Posts: 28
Joined: Tue Apr 02, 2013 9:56 pm

Re: Water Level expansion starting and stopping intermittent

Post by Endaar »

I changed the code and it still stops once the level reaches 61, but this time it is only momentarily a few times then continues running until it goes above 63.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water Level expansion starting and stopping intermittent

Post by rimai »

That just is not making sense...
Are you sure that in these momentary stops the port turns red on the screen?
Are you also sure that in these momentary stops, the level is displaying something below 63?
Roberto.
Endaar
Posts: 28
Joined: Tue Apr 02, 2013 9:56 pm

Re: Water Level expansion starting and stopping intermittent

Post by Endaar »

Yes to both. I wish I was making it up. :)
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water Level expansion starting and stopping intermittent

Post by rimai »

Are you able to make a video showing the screen when one of these momentary stops happen?
Roberto.
Endaar
Posts: 28
Joined: Tue Apr 02, 2013 9:56 pm

Re: Water Level expansion starting and stopping intermittent

Post by Endaar »

Roberto,
Here is a video. After it stopped the second time it never came back on.
Also when I went to the RA the screen was frozen again and i had to unplug it to get control back.
Ant
Endaar
Posts: 28
Joined: Tue Apr 02, 2013 9:56 pm

Re: Water Level expansion starting and stopping intermittent

Post by Endaar »

Finally. had to shrink it down. In 32 seconds it repeated the on/off twice and stayed off with the display at 61.
Attachments
IMG_0052.zip
(583.6 KiB) Downloaded 436 times
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water Level expansion starting and stopping intermittent

Post by rimai »

What happens if we increase the range and do this:

Code: Select all

ReefAngel.WaterLevelATO(Port1,300,60,66);
It almost looks like you are hitting the 63%, but it is so fast that it doesn't have a chance to display it.
Roberto.
Endaar
Posts: 28
Joined: Tue Apr 02, 2013 9:56 pm

Re: Water Level expansion starting and stopping intermittent

Post by Endaar »

Does the same thing only worse. Seems the same as it was then we had it at ReefAngel.WaterLevelATO(Port1,300,61,63); The if/ten does it less frequent.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water Level expansion starting and stopping intermittent

Post by rimai »

I want to see what kind or reading you are getting....
Can you add this line to the loop():

Code: Select all

  byte l = ReefAngel.WaterLevel.GetLevel();
  if (l>63) ReefAngel.Relay.Off(Port1);
  if (l<61 && l>0) ReefAngel.Relay.On(Port1);

  if (now()%20<10)
  {
    Serial.print(l);
    Serial.print("\t");
    Serial.println(ReefAngel.Relay.Status(Port1));
  }
Don't forget to remove the other functions from loop().
Then, open Serial Monitor and make sure it is set to 57600 baud.
It will print every 10 seconds.
Paste the results here.
Roberto.
Endaar
Posts: 28
Joined: Tue Apr 02, 2013 9:56 pm

Re: Water Level expansion starting and stopping intermittent

Post by Endaar »

I wasn't sure how long you wanted me to run it?

Code: Select all

64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
65	0
64	0
64	0
64	0
64	0
65	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
65	0
64	0
64	0
64	0
64	0
65	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
65	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
63	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
65	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
64	0
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water Level expansion starting and stopping intermittent

Post by rimai »

That was good, but I wanted you to try to catch that momentary stop, just like you did in the video.
64 is the % and 0 is port 1 off.
Roberto.
Post Reply