New to code ra and controls

Request new hardware or ideas for the controller

Posts: 214
Joined: Sat Oct 10, 2015 9:17 pm
PostPosted: Sat Oct 10, 2015 9:53 pm
I have no idea what I'm doing I just won a bid for ra plus with dimming and wifi expansion .
I have
75g display
30g long sump
2 marsaqua 165w leds plan to add led moonlights (I can hack the 0-10v anolog )
300w heater
skimmer
1 jabeo rw4 powerhead plan on adding 1 or 2 more

LIGHTING :
I would like to have for lighting control east to west sunrise/sunset via 2 blue ch and 2 white ch lots of random days like storm, cloud, severe storm, light cycles to mimic the great barrier reef ,lunar calendar and cycles , and coral aculmate setting

FEED FEATURES :
I would like to have for pump setting feed mode to turn off skimmer, return pump , and powerhead, for 5 mins then return powerheads to on, return pump 2 mins after powerheads returns to on, and skimmer 2 minutes after return pump returns to on

POWERHEAD FEATURES :
I would like to have for powerheads to have random mode to control 2 or 3 jabeo rw4s would like it to alternate from wave to else modes randomly and to kinda go along with the lights weater Cycle and have night time mode

ATO FEATURE :
I would like to run 3 floats 1 float for ro bucket when low will break the circuit and alert me so ato pump will not run dry. Float 2 will be a low water level and turn on when low and incase if switch stops working will have 3rd for high level

LOW WATER LEVEL RETURN PUMP :
Would like to have a float turn off return pump and alert me to look at tank and see why and not to return to on till I tell it to

SKIMMER FEATURE :
I would like 2 floats for skimmer 1 for water level in skimmer chamber to turn off skimmer if to high to keep from overflowing. 1 float in skimmer cup to shut off when full and alert me

HEATER FEATURE :
I would like to keep heater at 80f and not go less then 79.5 or higher then 80.5 or if there is a seasonal temp for the great barrier reef. And to alert if it varies more then 2°f from set temp if temp exceeds 3° over set temp turn off heater,return pump, and skimmer

WATER CHANGE FEATURE :
turn off return, skimmer,powerheads,ato, and heater

MONITORING FEATURE:
I would like to be able to see temp and salinity values on my phone

I have no idea what I'm doing if anyone can help what parts to I need for the ra
Image
User avatar
Posts: 5343
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sun Oct 11, 2015 5:04 am
Go to downloads and start on your base code with the wizard (under the Tools menu). Then post your code and we'll go feature by feature. Also get the Users manual and read through it. All your features are doable and a lot are in my INO as a reference. My code isn't the simplest but I've tried to keep blocks of code in separate functions to make it easy for reuse.

Posts: 214
Joined: Sat Oct 10, 2015 9:17 pm
PostPosted: Sun Oct 11, 2015 11:31 am
this is what i came up with didnt give me i/o expasion to set all the floats and didnt set wifi attacment since i dont know the info yet

#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 <PAR.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.Use2014Screen(); // Let's use 2014 Screen
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = 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 = 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( 802 );

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


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

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


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

void loop()
{
ReefAngel.StandardLights( Port1,10,0,20,0 );
ReefAngel.StandardLights( Port2,12,0,18,0 );
ReefAngel.StandardHeater( Port3,795,800 );
ReefAngel.SingleATO( true,Port4,60,0 );
ReefAngel.Relay.DelayedOn( Port5,5 );
ReefAngel.PWM.SetChannel( 0, PWMParabola(10,0,20,0,15,100,15) );
ReefAngel.PWM.SetChannel( 1, PWMParabola(12,0,18,0,15,40,15) );
ReefAngel.DCPump.UseMemory = false;
ReefAngel.DCPump.SetMode( Else,100,10 );
ReefAngel.DCPump.DaylightChannel = None;
ReefAngel.DCPump.ActinicChannel = None;
ReefAngel.DCPump.ExpansionChannel[0] = None;
ReefAngel.DCPump.ExpansionChannel[1] = None;
ReefAngel.DCPump.ExpansionChannel[2] = Sync;
ReefAngel.DCPump.ExpansionChannel[3] = AntiSync;
ReefAngel.DCPump.ExpansionChannel[4] = None;
ReefAngel.DCPump.ExpansionChannel[5] = None;
////// Place your custom code below here


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

// This should always be the last line
ReefAngel.AddWifi();
ReefAngel.ShowInterface();
}
Image
User avatar
Posts: 5343
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sun Oct 11, 2015 3:47 pm
The only info you need for the wifi is your portal username. There's a separate utility to configure the wifi. Did you get an IO expansion?

Posts: 214
Joined: Sat Oct 10, 2015 9:17 pm
PostPosted: Sun Oct 11, 2015 4:08 pm
No i/o yet but was going to later so that and salinity isn't needed yet
Image
User avatar
Posts: 5343
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sun Oct 11, 2015 9:11 pm
Yeah those should be really easy to add later. You don't need the wizard for them.

Posts: 214
Joined: Sat Oct 10, 2015 9:17 pm
PostPosted: Mon Oct 12, 2015 9:11 am
What do I do to add everything else I want in this code
Image
User avatar
Posts: 5343
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Oct 12, 2015 11:48 am
Well a good amount should be taken up by the wizard. Most of the rest you can find a lot of the code in my INO, if coding is going to be a challenge, then if you could list out the rest by priority, we'll take a couple at a time. Aside from me building your INO completely which would take me quite a lot of time, then we can do it together with you learning on the way. Try some searches, much of what you want has examples in the forum already.

Posts: 214
Joined: Sat Oct 10, 2015 9:17 pm
PostPosted: Mon Oct 12, 2015 2:55 pm
Just need moon calander cycle ,geometric location for sunrise sunset, and random days for no storms or clouds and some with.
And have the jabeos tied in to the storms to go up and down to 100% constant flow during stormy daysand night time for powerheads.
And have days where one day be w1 and days with else mode
Last edited by troylong45 on Mon Oct 12, 2015 4:07 pm, edited 2 times in total.
Image
User avatar
Posts: 5343
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Oct 12, 2015 6:30 pm
My code is in my signature. Alerts you'll setup in the portal once you have the wifi connected.

The jaebos tied to storm mode isn't implemented yet. I'm sure colin will be happy to add that.

I'll post some links and sample code up to get you going on some of the above.
Next

Return to Requests

Who is online

Users browsing this forum: No registered users and 2 guests

cron