Adding Expansion HUb and Salinity Expansion

Expansion modules and attachments
Post Reply
ganjero
Posts: 147
Joined: Fri Jul 05, 2013 5:29 am

Adding Expansion HUb and Salinity Expansion

Post by ganjero »

I'm getting the expansion hub and the salinity expansion. How do I add this to my code to function properly? I currently have two relay boxes; I'm assuming I would have to plug the expansion hub first and the second box to the hub along with the salinity expansion, is this correct?

Thanks
Image
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Adding Expansion HUb and Salinity Expansion

Post by Sacohen »

The hub plugs into the relay and then all of your modules plug into the hub.

Here is a link to the installation manual...

http://www.reefangel.com/files/Salinity ... _1.4.2.pdf

Make sure that this is in the beginning part of your code with all the other includes.

#include <Salinity.h>
That should be all you need to get it to work,
ganjero
Posts: 147
Joined: Fri Jul 05, 2013 5:29 am

Re: Adding Expansion HUb and Salinity Expansion

Post by ganjero »

Sacohen wrote:The hub plugs into the relay and then all of your modules plug into the hub.

Here is a link to the installation manual...

http://www.reefangel.com/files/Salinity ... _1.4.2.pdf

Make sure that this is in the beginning part of your code with all the other includes.

#include <Salinity.h>
That should be all you need to get it to work,
Thanks, that is in my code and I installed everything as directed.


I installed these today and cant get them to work, the expansion relay doesnt respond to manual commands (turning off ports) and the salinity calibration shows 0, and my salinity shows 6 in the portal.

any help is appreciated, thanks.
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Adding Expansion HUb and Salinity Expansion

Post by lnevo »

Did you upload new code referencing any of the ports in the expansion? You need to set at least one port somewhere to do something for the relay expansion to be enabled.
ganjero
Posts: 147
Joined: Fri Jul 05, 2013 5:29 am

Re: Adding Expansion HUb and Salinity Expansion

Post by ganjero »

this is my code

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.Use2014Screen();  // Let's use 2014 Screen 
            ReefAngel.AddSalinityExpansion();  // Salinity Expansion Module
            // Ports toggled in Feeding Mode
            ReefAngel.FeedingModePorts = Port7Bit;
            ReefAngel.FeedingModePortsE[0] = 0;
            // Ports toggled in Water Change Mode
            ReefAngel.WaterChangePorts = Port7Bit | Port8Bit;
            ReefAngel.WaterChangePortsE[0] = Port3Bit;
            // Ports toggled when Lights On / Off menu entry selected
            ReefAngel.LightsOnPorts = Port1Bit | Port4Bit;
            ReefAngel.LightsOnPortsE[0] = 0;
            // Ports turned off when Overheat temperature exceeded
            ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit | Port3Bit | Port5Bit;
            ReefAngel.OverheatShutoffPortsE[0] = 0;
            // Use T2 probe as temperature and overheat functions
            ReefAngel.TempProbe = T2_PROBE;
            ReefAngel.OverheatProbe = T2_PROBE;
            // Set the Overheat temperature setting
            InternalMemory.OverheatTemp_write( 851 );
            //Feeedin mode length
            ReefAngel.Timer[FEEDING_TIMER].SetInterval(300);
            

            // Feeeding and Water Change mode speed
             


            // Ports that are always on
            ReefAngel.Relay.On( Port8 );
            ReefAngel.Relay.On( Box1_Port1);
            ReefAngel.Relay.On( Box1_Port2 );
            ReefAngel.Relay.On( Box1_Port3 );
            ReefAngel.Relay.On( Box1_Port4 );
            ReefAngel.Relay.On( Box1_Port7 );
            ReefAngel.Relay.On( Box1_Port8 );
           

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

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

        void loop()
        {
            ReefAngel.StandardLights( Port1,13,0,19,0 );
            ReefAngel.StandardLights( Port2,14,0,20,0 );
            ReefAngel.StandardLights( Port3,19,55,22,0 );
            ReefAngel.StandardLights( Port4,13,0,20,15 );
            ReefAngel.StandardHeater( Port5,780,785 );
            ReefAngel.StandardFan( Port6,780,800 );
            ReefAngel.DCPump.UseMemory = true;
            pinMode(lowATOPin,OUTPUT);
            ////// Place your custom code below here
            ////disable ReefAngel.PWM.SetDaylight( ElseMode(70,30,true ));                     // ElseMode on sync mode, 70 +/- 30%
            
            static time_t StartFeeding=0;
           if (ReefAngel.DisplayedMenu==FEEDING_MODE)
                StartFeeding=now(); // if we entered feeding mode, register what time it was.
              if (now()-StartFeeding > 1800 && now()-StartFeeding < 9900) // if feeding run then Nutrient Transport mode between 1800 and 9900 seconds
{              ReefAngel.PWM.SetDaylight( NutrientTransportMode(40,80,700,true) ); //  Nutrient Transport on sync mode
                ReefAngel.PWM.SetActinic( NutrientTransportMode(40,80,700,false) ); // Nutrient Transport on anti-sync mode
}
            else if (now()%SECS_PER_DAY>=64800 && now()%SECS_PER_DAY<66600)
{
              ReefAngel.PWM.SetDaylight( 100 );
              ReefAngel.PWM.SetActinic( 100 ); 
}            
              else
  {
                ReefAngel.PWM.SetDaylight( ReefCrestMode(80,20,true) ); // ReefCrest at 80% +/- 20% on sync mode
                ReefAngel.PWM.SetActinic( ReefCrestMode(80,20,true) ); // ReefCrest at 80% +/- 20% on sync mode
  }
           
              //sump flow pump reefcrest, after feeding nutrient export, at 6pm 100% for 30min         
              if (ReefAngel.DisplayedMenu==FEEDING_MODE)
              StartFeeding=now(); // if we entered feeding mode, register what time it was.
              if (now()-StartFeeding > 1800 && now()-StartFeeding < 5400) // if feeding started between 1800 and 5400 seconds
{             analogWrite(lowATOPin,100*2.55);
}              
              else if (now()%SECS_PER_DAY>=64800 && now()%SECS_PER_DAY<66600)
{
              analogWrite(lowATOPin,100*2.55); 
}      
              else
{
              analogWrite(lowATOPin, ReefCrestMode(70,30,true)*2.55);
}              
              //sump pump flow constant 70%, 100% between 8pm and 9pm
              ////disable if (hour()==8)
              ////disable analogWrite(lowATOPin,100*2.55);
              ////disable else
              ////disable analogWrite(lowATOPin,70*2.55);
              
              //DT flow pumps in constant speed at 40% during waterchange mode
              if (ReefAngel.DisplayedMenu==WATERCHANGE_MODE)
{
              ReefAngel.PWM.SetDaylight( 40 );
              ReefAngel.PWM.SetActinic( 40 ); 
}

            //// Control display heater based on display temp sensor
            if (ReefAngel.Params.Temp[T1_PROBE]<780) ReefAngel.Relay.On(Box1_Port6);
            if (ReefAngel.Params.Temp[T1_PROBE]>785) ReefAngel.Relay.Off(Box1_Port6); 
            ///// Delay Start Turn off on Booting - Start
             
            static unsigned long startTime=now();
            
            if (startTime==LastStart) {
              ReefAngel.Relay.On(Port7);
             } else {
              ReefAngel.Relay.DelayedOn(Port7);
             }
      
            ///// Delay Start Turn off on Booting - End
            ////// Place your custom code above here

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

       
           //// Jebao Else Mode - Start
            byte ElseMode( byte MidPoint, byte Offset, boolean WaveSync )
            {
              // Static's only initialize the first time they are called
              static unsigned long LastChange=millis();        // Set the inital time that the last change occurred
              static int Delay = random( 500, 3000);           // Set the initial delay
              static int NewSpeed = MidPoint;                  // Set the initial speed
              static int AntiSpeed = MidPoint;                 // Set the initial anti sync speed
              if ((millis()-LastChange) > Delay)               // Check if the delay has elapsed
              {
                Delay=random(500,5000);                        // If so, come up with a new delay
                int ChangeUp = random(Offset);                 // Amount to go up or down
                if (random(100)<50)                            // 50/50 chance of speed going up or going down
                {
                  NewSpeed = MidPoint - ChangeUp;
                  AntiSpeed = MidPoint + ChangeUp;
                }
                else
                {
                  NewSpeed = MidPoint + ChangeUp;
                  AntiSpeed = MidPoint - ChangeUp;
                }
                LastChange=millis();                           // Reset the time of the last change
              }
              if (WaveSync)
              {
                return NewSpeed;
              }
              else
              {
                return AntiSpeed;
              }
            }
            //// Jebao Else Mode - End
Image
ganjero
Posts: 147
Joined: Fri Jul 05, 2013 5:29 am

Re: Adding Expansion HUb and Salinity Expansion

Post by ganjero »

I also just noticed that the main relay is keeping all the programmed ports on even though they show off in portal and the phone app.
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Adding Expansion HUb and Salinity Expansion

Post by rimai »

Does the LED of the side of hub light up when you connect it to the main relay box?
Do you get any readings from the salinity module if you connect it straight to the main relay box and not use the hub?
Roberto.
ganjero
Posts: 147
Joined: Fri Jul 05, 2013 5:29 am

Re: Adding Expansion HUb and Salinity Expansion

Post by ganjero »

Yes to both.
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Adding Expansion HUb and Salinity Expansion

Post by rimai »

If I'm following this correctly, your salinity module seems to be working fine since it works when connected straight into the relay box and your relay expansion module also works fine since it was originally working connected straight into the relay box, correct?
But, when you connect the hub, neither one works, correct?
Before we RMA the hub, can you try swapping around usb cables?
Roberto.
ganjero
Posts: 147
Joined: Fri Jul 05, 2013 5:29 am

Re: Adding Expansion HUb and Salinity Expansion

Post by ganjero »

Yes Roberto.
The salinity expansion works if I plug it straight to the relay box, and also the expansion relay box works correctly if a plug it direrctly to the main relay box. If I use the expansion hub that I just bought this week all the expansion (salinity and expansion relay box) don't respond/work correctly.

I will try swapping ables. Are the RA different from a common mini USB cable? I have other equipment in my house that use similar cables, maybe I can try with one of those.

Does it matter with usb ports I use in the expansion hub? Does the hub need a power adapter like the salinity expansion?

Thanks for your help.
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Adding Expansion HUb and Salinity Expansion

Post by rimai »

Same USB cable. No need for power on the hub

Sent from my Galaxy S3 using Tapatalk
Roberto.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Adding Expansion HUb and Salinity Expansion

Post by Sacohen »

The expansion hub does not need a power supply, mine does not have one.
Also it can use a similar USB cable.

I needed a longer one today for something I was testing and used one from a USB drive I had and it worked.
ganjero
Posts: 147
Joined: Fri Jul 05, 2013 5:29 am

Re: Adding Expansion HUb and Salinity Expansion

Post by ganjero »

Swapped some cables with some from my other equipment and it seems to be working now.

Now Im having issues calibrating the probe. Do I need to rinse it and let it dry before calibration? I put it in a cup with water at 35ppm, calibrated it but it shows my tank at 44 when my tank is actually 32. Does water temp matter?

Thanks
Last edited by ganjero on Sun Feb 02, 2014 7:18 pm, edited 2 times in total.
Image
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Adding Expansion HUb and Salinity Expansion

Post by Sacohen »

Looks like you have a bad cable. Glad it was resolved.

Sent from my HTC One VX using Tapatalk
ganjero
Posts: 147
Joined: Fri Jul 05, 2013 5:29 am

Re: Adding Expansion HUb and Salinity Expansion

Post by ganjero »

Well now that the probe seems to be not working correctly.

Looking at the salinity chart this morning it shows the salinity at ~44 it goes down to ~22 and jumps back up to 44.

There a not bubbles in the area, the temp is steady...not sure how correct this.
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Adding Expansion HUb and Salinity Expansion

Post by rimai »

Shake the probe to make sure there is no bubble trapped in the tip.
What happens if you place the probe in a cup with tank water?
Roberto.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Adding Expansion HUb and Salinity Expansion

Post by Sacohen »

Ouch. I hate when a bubble get trapped on the tip.

Sent from my HTC One VX using Tapatalk
ganjero
Posts: 147
Joined: Fri Jul 05, 2013 5:29 am

Re: Adding Expansion HUb and Salinity Expansion

Post by ganjero »

Roberto,

I shook it but I don't think it was air trapped as it kept going up and down. Around 8pm last night I put it in a cup of saltwater and it has been showing stable salinity. See the chart below.

Do you know what could be the issue when I sue it in my sump?


Thanks
Image
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Adding Expansion HUb and Salinity Expansion

Post by rimai »

Something else that is connected to your setup is doing that.
Roberto.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Adding Expansion HUb and Salinity Expansion

Post by Sacohen »

I've been watching this for a bit and just want to though in my 2¢.

Do you have an ATO that is feeding fresh water into the sump, possibly close to the Salinity Probe?
ganjero
Posts: 147
Joined: Fri Jul 05, 2013 5:29 am

Re: Adding Expansion HUb and Salinity Expansion

Post by ganjero »

rimai wrote:Something else that is connected to your setup is doing that.
Roberto,

When you say setup, do you mean the reefangel controller? or my entire reef system?



Sacohen wrote:I've been watching this for a bit and just want to though in my 2¢.

Do you have an ATO that is feeding fresh water into the sump, possibly close to the Salinity Probe?
Good point, and believe it was somehow close. I will try setting them on opposite sides and see how that works, but if that is the case shouldn't it just go down and then back to 32-34 instead of 44?


Thanks
Image
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Adding Expansion HUb and Salinity Expansion

Post by Sacohen »

Sacohen wrote:I've been watching this for a bit and just want to though in my 2¢.

Do you have an ATO that is feeding fresh water into the sump, possibly close to the Salinity Probe?
Good point, and believe it was somehow close. I will try setting them on opposite sides and see how that works, but if that is the case shouldn't it just go down and then back to 32-34 instead of 44?


Thanks[/quote]

That is true it should go back to normal and not 44ppt.
Is your ATO dosing Kalkwasser too?
I had my Salinity probe get covered with calcium deposits and it gave me crazy reading.
ganjero
Posts: 147
Joined: Fri Jul 05, 2013 5:29 am

Re: Adding Expansion HUb and Salinity Expansion

Post by ganjero »

Placed in a different area in the sump and still have the same issues.

Does anyone know what equipment commonly cause issues with this probe?
Image
Albe
Posts: 20
Joined: Thu Dec 19, 2013 8:13 am

Re: Adding Expansion HUb and Salinity Expansion

Post by Albe »

Have you checked for stray voltage?
ganjero
Posts: 147
Joined: Fri Jul 05, 2013 5:29 am

Re: Adding Expansion HUb and Salinity Expansion

Post by ganjero »

Measured for Stray voltage. I have a ground probe installed so I removed it, my multimeter shows a reading of 14. I turned everything off and almost every piece of equipment added a point.

When I put the ground probe back in the reading goes back to zero, but I found that if I leave it out the salinity reading stays constant, 5 points off but constant.

Any thoughts?
Last edited by ganjero on Sun Feb 16, 2014 2:57 pm, edited 1 time in total.
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Adding Expansion HUb and Salinity Expansion

Post by rimai »

Do you have another 12VDC power supply to try connecting to the salinity module?
Roberto.
User avatar
heatdissipation
Posts: 52
Joined: Wed Aug 14, 2013 5:25 am

Re: Adding Expansion HUb and Salinity Expansion

Post by heatdissipation »

Is this the same salinity expansion I bought off of you today?
Post Reply