Page 1 of 1

WM off when lights off?

Posted: Sat Nov 24, 2012 9:15 pm
by bigHUN
Just did the replacement, RA board to RA+, loaded the internal mem, and generated the first code with the Wizard...
I must say what an upgrade, I really like the job you folks did there.
My lights went OFF for first time, and than realized my WMs still running. I wen't through the wizard several times, just can't see the button where to turn the wavemakers off in the dark?
how this command shall look? and where to place? thanks

Re: WM off when lights off?

Posted: Sat Nov 24, 2012 9:37 pm
by bigHUN
just realized this may not be a best idea...in next few days I will look for some nice thunderstorm effects here on forum, this may smoke my WMs very quickly, better me put on timer than?
let say turn on 30 minutes after first light on and turn off 30 minutes before last light off?
how this code shall look?

Re: WM off when lights off?

Posted: Sun Nov 25, 2012 5:24 am
by rimai
just set them up as timed ports just like lights.

Re: WM off when lights off?

Posted: Sun Nov 25, 2012 7:06 am
by bigHUN
first night over. in the morning I saw the skimmer was off overnight...
is this a default than?
- when lights off WMs ON and skimmer OFF ?
where can I see that setting?
I have 2 WMs, one big polario and one circulating pump to take care of............especially because on the closed loop there is one inline heater for case if the main pump goes psycho...

Re: WM off when lights off?

Posted: Sun Nov 25, 2012 7:48 am
by dbmet
Can you post the code you uploaded to the ReefAngel from the Wizard?

Re: WM off when lights off?

Posted: Sun Nov 25, 2012 8:25 pm
by bigHUN
RA+ controller, anyhow I can insert the timing through the GUI for wavemakers do not work at all when the lights are off? I don't know how to write it and where to insert below....
#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
    ReefAngel.SetTemperatureUnit( Celsius ); // set to Celsius Temperature

    ReefAngel.AddStandardMenu(); // Add Standard Menu

    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port1Bit | Port8Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port3Bit | Port4Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port2Bit | Port8Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 265 );


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

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

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

void loop()
{
    ReefAngel.StandardATO( Port1,60 );
    ReefAngel.StandardHeater( Port2,240,255 );
    ReefAngel.StandardLights( Port3,9,0,19,0 );
    ReefAngel.StandardLights( Port4,11,0,17,0 );
    ReefAngel.Wavemaker( Port5,5 );
    ReefAngel.Wavemaker( Port6,6 );
    ReefAngel.Relay.DelayedOn( Port7,3 );
    ReefAngel.PWM.SetChannel( 0, PWMParabola(9,0,20,0,15,100,15) );
    ReefAngel.PWM.SetChannel( 1, PWMParabola(10,0,19,0,15,100,15) );
    ReefAngel.PWM.SetChannel( 2, PWMParabola(10,0,18,0,15,100,15) );
    ReefAngel.PWM.SetChannel( 3, PWMParabola(11,0,17,0,15,100,15) );
    ReefAngel.PWM.SetChannel( 4, PWMParabola(12,0,15,0,15,60,15) );
    ////// Place your custom code below here
    

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

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

void DrawCustomMain()
{
    int x,y;
    char text[10];
    // Dimming Expansion
    x = 15;
    y = 2;
    for ( int a=0;a<6;a++ )
    {
      if ( a>2 ) x = 75;
      if ( a==3 ) y = 2;
      ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x,y,"Ch :" );
      ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x+12,y,a );
      ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x+24,y,ReefAngel.PWM.GetChannelValue(a) );
      y += 10;
    }
    pingSerial();

    // I/O Expansion
    byte bkcolor;
    x = 14;
    y = 39;
    for ( int a=0;a<6;a++ )
    {
      ReefAngel.LCD.DrawCircleOutline( x+(a*20),y,4,COLOR_MEDIUMORCHID );
      if ( ReefAngel.IO.GetChannel(a) ) bkcolor=COLOR_WHITE; else bkcolor=COLOR_GRAY;
      ReefAngel.LCD.FillCircle( x+(a*20),y,2,bkcolor );
    }
    pingSerial();

    // Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 53, ReefAngel.Params,
    ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 53, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
    pingSerial();

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

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

void DrawCustomGraph()
{
}

Re: WM off when lights off?

Posted: Mon Nov 26, 2012 5:00 am
by rimai
Let me see if I understand.
You want the WM on port 5 and 6 to be off when lights on port 3 is off. Is it correct?

Re: WM off when lights off?

Posted: Mon Nov 26, 2012 8:16 am
by bigHUN
correct, can you show me one example how this shall look like: WM on when ligts on and off when .. off (either actinic or daylight)
also, can you give me a sample code: light on, WM delayed on + 20 minutes (after the lights comes on), WM advanced off -20 minutes from lights off (before the lights go off).
based on these two examples I shall be able to do several other things as well.
also, where to pleace the lines? between? // place your custom codes here //
thanks

Re: WM off when lights off?

Posted: Mon Nov 26, 2012 9:41 am
by rimai
Replace this:

Code: Select all

    ReefAngel.Wavemaker( Port5,5 );
    ReefAngel.Wavemaker( Port6,6 );
With this:

Code: Select all

if (hour()>=9 && hour()<20)
{
    ReefAngel.Wavemaker( Port5,5 );
    ReefAngel.Relay.Set(Port6,ReefAngel.Relay.Status(Port5));
}
else
{
    ReefAngel.Relay.Off(Port5);
    ReefAngel.Relay.Off(Port6);
}

Re: WM off when lights off?

Posted: Mon Nov 26, 2012 4:06 pm
by bigHUN
Roberto, many thanks.
btw, word by word what this line means?

ReefAngel.Relay.Set(Port6,ReefAngel.Relay.Status(Port5));

[set the relay port6 when the status is.. what?...and what that means port5 in brackets?....]

will this conflict with WMs timing? or if I switch them in the future to alternate?

Re: WM off when lights off?

Posted: Mon Nov 26, 2012 7:07 pm
by bigHUN
rimai wrote:Replace this:

Code: Select all

    ReefAngel.Wavemaker( Port5,5 );
    ReefAngel.Wavemaker( Port6,6 );
With this:

Code: Select all

if (hour()>=9 && hour()<20)
{
    ReefAngel.Wavemaker( Port5,5 );
    ReefAngel.Relay.Set(Port6,ReefAngel.Relay.Status(Port5));
}
else
{
    ReefAngel.Relay.Off(Port5);
    ReefAngel.Relay.Off(Port6);
}
I did the replace, right now the time is 9.03 pm, lights are off,
1.) both WM ports in the same time toggling on/off every 5 sec
2.) since sitting here in front of it, noticed the skimmer went off 8.59 pm, and came on 9.03
I don't see anything else in the code but the "delay 3 min" on port 7 ?????????????
#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
    ReefAngel.SetTemperatureUnit( Celsius ); // set to Celsius Temperature

    ReefAngel.AddStandardMenu(); // Add Standard Menu

    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port1Bit | Port8Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port3Bit | Port4Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = 0;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 265 );


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

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

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

void loop()
{
    ReefAngel.StandardATO( Port1,62 );
    ReefAngel.StandardHeater( Port2,240,255 );
    ReefAngel.StandardLights( Port3,8,55,20,5 );
    ReefAngel.StandardLights( Port4,11,5,15,55 );
    if (hour()>=9,3 && hour()<19,57)
{
    ReefAngel.Wavemaker( Port5,5 );
    ReefAngel.Relay.Set(Port6,ReefAngel.Relay.Status(Port5));
}
else
{
    ReefAngel.Relay.Off(Port5);
    ReefAngel.Relay.Off(Port6);
}
    ReefAngel.Relay.DelayedOn( Port7,3 );
    ReefAngel.PWM.SetChannel( 0, PWMParabola(9,5,19,55,15,100,15) );
    ReefAngel.PWM.SetChannel( 1, PWMParabola(10,5,18,55,15,100,15) );
    ReefAngel.PWM.SetChannel( 2, PWMParabola(11,5,15,55,15,100,15) );
    ReefAngel.PWM.SetChannel( 3, PWMParabola(11,35,17,55,15,100,15) );
    ReefAngel.PWM.SetChannel( 4, PWMParabola(18,35,3,5,15,100,15) );
    ////// Place your custom code below here
    

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

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

void DrawCustomMain()
{
    int x,y;
    char text[10];
    // Dimming Expansion
    x = 15;
    y = 2;
    for ( int a=0;a<6;a++ )
    {
      if ( a>2 ) x = 75;
      if ( a==3 ) y = 2;
      ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x,y,"Ch :" );
      ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x+12,y,a );
      ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x+24,y,ReefAngel.PWM.GetChannelValue(a) );
      y += 10;
    }
    pingSerial();

    // I/O Expansion
    byte bkcolor;
    x = 14;
    y = 39;
    for ( int a=0;a<6;a++ )
    {
      ReefAngel.LCD.DrawCircleOutline( x+(a*20),y,4,COLOR_MEDIUMORCHID );
      if ( ReefAngel.IO.GetChannel(a) ) bkcolor=COLOR_WHITE; else bkcolor=COLOR_GRAY;
      ReefAngel.LCD.FillCircle( x+(a*20),y,2,bkcolor );
    }
    pingSerial();

    // Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 53, ReefAngel.Params,
    ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 53, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
    pingSerial();

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

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

void DrawCustomGraph()
{
}


Re: WM off when lights off?

Posted: Tue Nov 27, 2012 3:55 am
by rimai
That's exactly why I used that way.
The line means that port6 will be set to the status of port 5.
For opposite, you can simply add ! sign to invert the status of port 5.

Code: Select all

    ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5));

Re: WM off when lights off?

Posted: Tue Nov 27, 2012 8:36 pm
by bigHUN
Thank you so much Roberto