Floating switches as indicators and hood temperature

Do you have a question on how to do something.
Ask in here.
Post Reply
OceanWolf
Posts: 58
Joined: Sun Sep 22, 2013 4:59 pm
Location: Morgan Hill, CA

Floating switches as indicators and hood temperature

Post by OceanWolf »

I want to do two things

First I want to control my fans in the hood by the T1 probe. I placed the probe close to the heat sink. I am using ReefAngel.Standartfan ( Port8, 850, 770) to turn on and off the fans. Fan control works fine, my problem is it also turns off my heater. How can I use the T2 probe for Heater control?

Second question, i don't have an ATO pump yet, I would like to use my switches as an indicator of the water level. I set one of clips to the bottom and the other to the second setting. How can I see the water level on the portal. I would like to see green when both are all the way to the top and when the water level goes down, the first one will turn red and later if I don't add water the second goes red?

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 <Humidity.h>
#include <DCPump.h>
#include <ReefAngel.h>

////// Place global variable code below here
/*  #define Lights       1
    #define Moonlight    2
    #define Heater       3
    #define Skimmer      4
    #define Circulation1 5
    #define Circulation2 6
    #define Korelia      7 
    #define Hood Fan     8
*/

////// Place global variable code above here


void setup()
{
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    ReefAngel.Use2014Screen();  // Let's use 2014 Screen 
    ReefAngel.AddStandardMenu();
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port4Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port4Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port1Bit | Port2Bit | Port8Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port1Bit | Port4Bit | Port5Bit | Port6Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T2_PROBE;
    InternalMemory.OverheatTemp_write( 840 );
    // Ports that are always on
    ReefAngel.Relay.On( Port1 );
    ReefAngel.Relay.On( Port4 );
    ReefAngel.Relay.On( Port7 );

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

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

void loop()
{
    ReefAngel.MoonLights( Port2 );
    ReefAngel.StandardHeater( Port3 );
    ReefAngel.WavemakerRandom1( Port5,90,120 );
    ReefAngel.Relay.Set( Port6, !ReefAngel.Relay.Status( Port5 ) );
    ReefAngel.StandardFan( Port8,850,770 );	
    ReefAngel.PWM.SetDaylight( PWMSlope(13,0,22,0,20,55,60,0) );
    ReefAngel.PWM.SetActinic( PWMSlope(12,0,23,0,20,45,60,0) );
    // LOW Switch
//	ReefAngel.SingleATOLow(1);
	// HIGH Switch
//	ReefAngel.SingleATOHigh(1);
    ////// Place your custom code below here
    

    ////// Place your custom code above here
 if (ReefAngel.DisplayedMenu!=FEEDING_MODE || ReefAngel.DisplayedMenu!=WATERCHANGE_MODE)
  {
    if (hour()>=23 || hour()<7)
    {
      ReefAngel.RF.UseMemory=false;
      ReefAngel.RF.SetMode(Lagoon,10,0);
    }
    else
    {
      ReefAngel.RF.UseMemory=true;
    }
  }
    // This should always be the last line
    ReefAngel.Portal( "Oceanwolf" );
    ReefAngel.ShowInterface();
}


Thanks
Onur

Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Floating switches as indicators and hood temperature

Post by lnevo »

Search for StandardHeater2

You will need a custom function to do it. I think examples have been posted for it.

As far as ATO, the standard function doesnt work as you described. The float switches represent power to the ATO pump, meaning normally both are OFF (red). When the "low" switch turns green the pump turns on until the "high" switch turns green. Thats when the pump turns off.

If you really want the switches to behave as you want you will need a custom function written.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Floating switches as indicators and hood temperature

Post by rimai »

The ATO status on the Portal will show the opposite. They are green when not floating and red when floating.
So, what you will see is the opposite of what you want.
You can revert the float switch function by removing the clip and flipping the float up side down and putting the clip back in.
That should give you greens when floating and red when not floating.
Check this post for the heater: http://forum.reefangel.com/viewtopic.php?p=24731#p24731
Roberto.
Post Reply