Relay activity

Related to the Portal
Post Reply
Elevatorguy1
Posts: 42
Joined: Wed Apr 17, 2013 6:21 pm

Relay activity

Post by Elevatorguy1 »

Hello,

I was just looking at the relay activity charts on the portal and noticed that my dosing pumps are turning on and off for different amounts of time. One time they will turn on for 5 minutes and the next time they will turn on for 10 minutes. I have them set for 12 minutes 5 times a day with a 20 minute offset. Here's my current code. Not sure if I'm looking at the info wrong or coded something wrong?

#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
InternalMemory.LCDID_write(0);
ReefAngel.Init(); //Initialize controller
ReefAngel.AddStandardMenu(); // Add Standard Menu
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = 0;
ReefAngel.FeedingModePortsE[0] = Port1Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = 0;
ReefAngel.WaterChangePortsE[0] = Port2Bit | Port3Bit | Port4Bit | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
// 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( 869 );


// Ports that are always on
ReefAngel.Relay.On( Port3 ); //*Actinic
ReefAngel.Relay.On( Port4 ); //*Daylight
ReefAngel.Relay.On( Port5 ); //*Bio pellet reactor
ReefAngel.Relay.On( Box1_Port1 ); //*skimmer
ReefAngel.Relay.On( Box1_Port2 ); //*return pump
ReefAngel.Relay.On( Box1_Port3 ); //*cir pump
ReefAngel.Relay.On( Box1_Port4 ); //*cir pump
ReefAngel.Relay.On( Box1_Port7 ); //*water level controller
ReefAngel.Relay.On( Box1_Port8 ); //*top fuge pump
////// Place additional initialization code below here


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

void loop()
{
ReefAngel.StandardLights( Port1,22,30,13,30 ); //*sump fuge light
ReefAngel.StandardLights( Port2,13,30,22,30 ); //*top fuge light
ReefAngel.DosingPumpRepeat( Box1_Port5,0,288,720 ); //*Alk pump
ReefAngel.DosingPumpRepeat( Box1_Port6,20,288,720 ); //*Cal pump
ReefAngel.StandardATO( Port6,6000 ); //*Fresh water solenoid
ReefAngel.StandardHeater( Port7,775,785 );
ReefAngel.StandardLights( Port8,13,30,22,30 ); //*Light fan
ReefAngel.PWM.SetDaylight( PWMSlope(13,30,22,30,0,55,30,0) );
ReefAngel.PWM.SetActinic( PWMSlope(13,30,22,30,0,60,30,0) );
////// Place your custom code below here


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

// This should always be the last line
ReefAngel.Portal("elevatorguy1","****");
ReefAngel.ShowInterface();
}
void DrawCustomMain()
{
byte x;
byte y = 2;
char text[7];



ReefAngel.LCD.DrawText(DefaultFGColor, DefaultBGColor, 30, 2, "Gonzo's Reef"); // Put a banner at the top
ReefAngel.LCD.DrawDate(6, 119); // Put the date and time at the bottom
ReefAngel.LCD.Clear(COLOR_BLACK, 1, 11, 132, 11); // Draw a black line under the banner
x = 12;
y += MENU_START_ROW+1; // MENU_START_ROW is 10, according to globals.h, so y=2+10+1=13
ReefAngel.LCD.DrawText(COLOR_BLUE, COLOR_WHITE, x, y+6, "Tank Temp pH");
ConvertNumToString(text, ReefAngel.Params.PH, 100); // Get pH reading and convert
ReefAngel.LCD.DrawLargeText(PHColor, DefaultBGColor, x+75, y+18, text, Font8x16); // Put pH on the screen
ConvertNumToString(text, ReefAngel.Params.Temp[T1_PROBE], 10); // Get T1 temp and convert
y += MENU_START_ROW*2;
x = 10;
ReefAngel.LCD.DrawHugeNumbers(COLOR_WHITE, COLOR_BLACK, x, y, text); // Draw the temperature, white numbers on a colored background
x += (16*4) + 8;
ReefAngel.LCD.DrawText(DPColor,DefaultBGColor,8,y+25,"White %");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetDaylightValue(), DPColor, 24, y+35, 1); // Draw the white light %
ReefAngel.LCD.DrawText(APColor,DefaultBGColor,x+8,y+25,"Blue %");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetActinicValue(), APColor, x+24, y+35, 1); // Draw the blue light %

// Code for drawing the relay box
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox(12, 92, TempRelay);
// Relay Expansion
TempRelay = ReefAngel.Relay.RelayDataE[0];
TempRelay &= ReefAngel.Relay.RelayMaskOffE[0];
TempRelay |= ReefAngel.Relay.RelayMaskOnE[0];
ReefAngel.LCD.DrawOutletBox( 12, 107, TempRelay);
pingSerial();
}

void DrawCustomGraph()
{
}
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Relay activity

Post by lnevo »

They aren't...the ra only sends data to the portal every 5 minutes so it just looks that way.
Elevatorguy1
Posts: 42
Joined: Wed Apr 17, 2013 6:21 pm

Re: Relay activity

Post by Elevatorguy1 »

Thanks Inevo! I should have realized that reading though the forum but I didn't make the connection.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Relay activity

Post by lnevo »

There's a post and I have it in my code that logs the amount of seconds the relay is on and sends it to one of the portal custom variables. There's a thread too where I helped kirkwood I believe log this as well. So you have a few examples if you NEED to see how long the dosers are in fact running..
Post Reply