Relay expansion and 12v

Expansion modules and attachments
Post Reply
User avatar
cody.sheridan-2008
Posts: 31
Joined: Tue Feb 05, 2013 9:39 pm

Relay expansion and 12v

Post by cody.sheridan-2008 »

Hi all,

I want to have 2 relays and also be able to have the 12v power control expansion. Is this possible to do with the wizard?

Cheers
Cody
Cheers
Cody
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Relay expansion and 12v

Post by rimai »

Sure you can :)
Up to 8 mix/match total
Roberto.
User avatar
cody.sheridan-2008
Posts: 31
Joined: Tue Feb 05, 2013 9:39 pm

Re: Relay expansion and 12v

Post by cody.sheridan-2008 »

rimai wrote:Sure you can :)
Up to 8 mix/match total
Thanks rimai, how do I get them to display in the wizard so I can program them?
Cheers
Cody
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Relay expansion and 12v

Post by rimai »

I don't think the wizard can do that, but the code would be the same, except for the port you are using.
For example.
For the 1st box:

Code: Select all

ReefAngel.Relay.On(Box1_Port1);
And for the 2nd Box:

Code: Select all

ReefAngel.Relay.On(Box2_Port1);
And for the power control:

Code: Select all

ReefAngel.Relay.On(Box3_Port1);
Roberto.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Relay expansion and 12v

Post by Sacohen »

The 12v Power Control module shows up in the wizard like any other relay expansion.
User avatar
cody.sheridan-2008
Posts: 31
Joined: Tue Feb 05, 2013 9:39 pm

Re: Relay expansion and 12v

Post by cody.sheridan-2008 »

rimai wrote:I don't think the wizard can do that, but the code would be the same, except for the port you are using.
For example.
For the 1st box:

Code: Select all

ReefAngel.Relay.On(Box1_Port1);
And for the 2nd Box:

Code: Select all

ReefAngel.Relay.On(Box2_Port1);
And for the power control:

Code: Select all

ReefAngel.Relay.On(Box3_Port1);
So could I generate the code with the wizard and copy paste it in?
Cheers
Cody
User avatar
cody.sheridan-2008
Posts: 31
Joined: Tue Feb 05, 2013 9:39 pm

Re: Relay expansion and 12v

Post by cody.sheridan-2008 »

This is my current stuff from the wizard, could you give an example of what it would look like if I had another relay with the same settings? Or just a few examples.

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


////// 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

    ReefAngel.Use2014Screen();  // Let's use 2014 Screen 
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port1Bit;
    ReefAngel.FeedingModePortsE[0] = 0;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port3Bit;
    ReefAngel.WaterChangePortsE[0] = 0;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port2Bit;
    ReefAngel.LightsOnPortsE[0] = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit | Port4Bit;
    ReefAngel.OverheatShutoffPortsE[0] = 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( 290 );

    // Feeeding and Water Change mode speed
    ReefAngel.DCPump.FeedingSpeed=0;
    ReefAngel.DCPump.WaterChangeSpeed=0;


    // Ports that are always on
    ReefAngel.Relay.On( Port3 );
    ReefAngel.Relay.On( Box1_Port2 );
    ReefAngel.Relay.On( Box1_Port3 );
    ReefAngel.Relay.On( Box1_Port4 );
    ReefAngel.Relay.On( Box1_Port5 );
    ReefAngel.Relay.On( Box1_Port6 );
    ReefAngel.Relay.On( Box1_Port7 );

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

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

void loop()
{
    ReefAngel.StandardLights( Port1,0,0,0,0 );
    ReefAngel.StandardLights( Port2,15,0,21,0 );
    ReefAngel.StandardHeater( Port4,240,250 );
    ReefAngel.WavemakerRandom( Port5,60,100 );
    ReefAngel.WavemakerRandom( Port6,60,100 );
    ReefAngel.CO2Control( Port7,670,650 );
    ReefAngel.StandardFan( Port8,270,280 );
    ReefAngel.StandardATO( Box1_Port1,5400 );
    ReefAngel.DCPump.UseMemory = false;
    ReefAngel.DCPump.SetMode( Lagoon,50,10 );
    ReefAngel.DCPump.DaylightChannel = Sync;
    ReefAngel.DCPump.ActinicChannel = Sync;
    ////// Place your custom code below here
    

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

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

Much appreciated.
Cody
Cheers
Cody
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Relay expansion and 12v

Post by rimai »

I already posted a few examples a couple posts back.
Anywhere you see PortX, it refers to a port in the main box. All references to the 1st relay box have Box1_PortX.
Let's suppose you now have 2 relay boxes and 1 power control with this configuration:
ID1 - Relay Box
ID2 - Relay Box
ID3 - Power control
You can change the ID through the dip switch inside the module. Check the manual for more info.
So, all ports of the 2nd relay box would be called Box2_PortX and all ports of the power control would be called Box3_PortX.
Let's say you want to use your heater on the 1st port of the 2nd relay box. The code would be like this:

Code: Select all

    ReefAngel.StandardHeater( Box2_Port1,240,250 );
Roberto.
User avatar
cody.sheridan-2008
Posts: 31
Joined: Tue Feb 05, 2013 9:39 pm

Re: Relay expansion and 12v

Post by cody.sheridan-2008 »

Thanks Roberto, I think I have it now. Been playing around with my unit a bit.

Is it possible to get one of the small box's that come with the Relay expansion? I have the main box already... would prefer to spend the money on other expansions/attachments.
Cheers
Cody
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Relay expansion and 12v

Post by rimai »

Send me a PM
Roberto.
Post Reply