Problem with lights not turning off

New members questions
Post Reply
Piper27
Posts: 29
Joined: Wed Jun 27, 2012 1:10 pm

Problem with lights not turning off

Post by Piper27 »

So I have had issues with my t5s not turning off. The controller says the port turns off but lights stay on. I have tried moving ports and such but it's happened with two different lights so far. Was working and turning off for a week and now they stayed on again. It's hard for me to get code from the computer I am using too but if needed I can find a way.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: Problem with lights not turning off

Post by rossbryant1956 »

we need you to post the code. Email it to me and I'll post it so we can all look at it. Sent you a PM
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
Piper27
Posts: 29
Joined: Wed Jun 27, 2012 1:10 pm

Re: Problem with lights not turning off

Post by Piper27 »

I will have to find a way to get it off the computer tomorrow mourning.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Problem with lights not turning off

Post by rimai »

How many ballasts do you have on that port?
Roberto.
Piper27
Posts: 29
Joined: Wed Jun 27, 2012 1:10 pm

Re: Problem with lights not turning off

Post by Piper27 »

I have two 250s on the first box and one 400 on the second.

I think this is all the code.

#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 <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
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = 0;
ReefAngel.FeedingModePortsE[0] = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = 0;
ReefAngel.WaterChangePortsE[0] = 0;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
ReefAngel.LightsOnPortsE[0] = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port2Bit | Port3Bit | Port7Bit;
ReefAngel.OverheatShutoffPortsE[0] = Port1Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 821 );


// Ports that are always on

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


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

void loop()
{
ReefAngel.StandardLights( Port1,9,30,18,30 );
ReefAngel.StandardLights( Port2,12,0,17,0 );
ReefAngel.StandardLights( Port3,12,0,17,0 );
ReefAngel.StandardLights( Port4,9,30,18,30 );
ReefAngel.Wavemaker( Port5,240 );
ReefAngel.Relay.Set( Port6, !ReefAngel.Relay.Status( Port5 ) );
ReefAngel.StandardLights( Port7,10,0,18,0 );
ReefAngel.StandardLights( Port8,9,30,18,30 );
ReefAngel.StandardLights( Box1_Port1,12,0,17,0 );
ReefAngel.StandardLights( Box1_Port2,11,45,17,30 );
ReefAngel.StandardLights( Box1_Port3,11,45,17,30 );
ReefAngel.StandardLights( Box1_Port4,11,45,17,30 );
ReefAngel.Wavemaker( Box1_Port5,240 );
ReefAngel.Relay.Set( Box1_Port6, !ReefAngel.Relay.Status( Port5 ) );
ReefAngel.StandardLights( Box1_Port7,17,0,2,0 );
ReefAngel.StandardLights( Box1_Port8,17,0,2,0 );
////// Place your custom code below here


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

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

void DrawCustomMain()
{
int x,y;
char text[10];
// Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 62, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 62, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
pingSerial();

// Main Relay Box
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox( 12, 93, TempRelay );
pingSerial();

// Relay Expansion
TempRelay = ReefAngel.Relay.RelayDataE[0];
TempRelay &= ReefAngel.Relay.RelayMaskOffE[0];
TempRelay |= ReefAngel.Relay.RelayMaskOnE[0];
ReefAngel.LCD.DrawOutletBox( 12, 106, TempRelay );
pingSerial();

// Date and Time
ReefAngel.LCD.DrawDate( 6, 122 );
pingSerial();
}

void DrawCustomGraph()
{
ReefAngel.LCD.DrawGraph( 5, 5 );
}
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Problem with lights not turning off

Post by rimai »

Are both ports doing this? Which one are they?
Roberto.
Piper27
Posts: 29
Joined: Wed Jun 27, 2012 1:10 pm

Re: Problem with lights not turning off

Post by Piper27 »

So far one and four on box one and seven and eight on box two...
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Problem with lights not turning off

Post by rimai »

2 ballasts in the same port is always not a good idea.
Are all 4 ports stuck on now?
Can you use the ControllerTester code to go through each port?
File->Sketchbook->Example Codes->ControllerTester
Roberto.
Piper27
Posts: 29
Joined: Wed Jun 27, 2012 1:10 pm

Re: Problem with lights not turning off

Post by Piper27 »

No each ballast is in a separate outlet. The ports randomly work when they want. Port 7 on the second box has worked since I assigned it so far, port eight on box 2 has never turned on but said it was on (I think that's what happened). Port One on box one has never actually turned the lights but turned them on the first mourning. Port four box one worked for a few days this week and now tonight didnt shut off. I will try and use the control tester in the mourning. Why am I having so much trouble with this issue? How do I fix it?
Piper27
Posts: 29
Joined: Wed Jun 27, 2012 1:10 pm

Re: Problem with lights not turning off

Post by Piper27 »

What am I looking for, or what does this test do? I am getting kinda worried that something is wrong, I have so much equipment that I moved so I could hook this thing up I can't imagine moving everything back and using my old controller.
Piper27
Posts: 29
Joined: Wed Jun 27, 2012 1:10 pm

Re: Problem with lights not turning off

Post by Piper27 »

Also if I plug it in the outlet it makes a pop noise and I see sparks. Doesn't seem good at ALL.
Piper27
Posts: 29
Joined: Wed Jun 27, 2012 1:10 pm

Re: Problem with lights not turning off

Post by Piper27 »

Roberto I went to the controller tester, I am not sure what I am supposed to do once I get there.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Problem with lights not turning off

Post by rimai »

Test each port.
If you press the joysick, it will turn every single one of your ports.
You can only do that on the main relay box.
So, test one box and hook up your other box as main box and do the test again for your other one.
Do all ports turn on and off accordingly?
Roberto.
Piper27
Posts: 29
Joined: Wed Jun 27, 2012 1:10 pm

Re: Problem with lights not turning off

Post by Piper27 »

Okay so with this thing port four worked when I manually did it. Port one still won't turn off.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Problem with lights not turning off

Post by rimai »

How about the other box?
Roberto.
Piper27
Posts: 29
Joined: Wed Jun 27, 2012 1:10 pm

Re: Problem with lights not turning off

Post by Piper27 »

That's a lot of plugs to mess with to figure that one out. I am confused on how this is going to help, I mean Port four worked just a min ago when I tested it, but two nights ago it wouldn't turn off. It worked for a week before that. So why am I testing ports if I know that they can still not turn off at random times? I can unscrew the second relay if I have to test it for some reason.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Problem with lights not turning off

Post by rimai »

We are just trying to find out here what is causing the issue.
We know it is hardware related by what you found out with the main box.
If the expansion relay box is not accessible, we change the code to send signals to the expansion box too.
Let me get to a computer to change it.
Roberto.
Piper27
Posts: 29
Joined: Wed Jun 27, 2012 1:10 pm

Re: Problem with lights not turning off

Post by Piper27 »

I see I will unplug everything and unscrew everything to hook it up I a little bit. I will get back to you, appreciate the help!
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Problem with lights not turning off

Post by rimai »

Use this code for the expansion relay box:

Code: Select all

#include <Salinity.h>
#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 <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <ReefAngel.h>

int port=0;

void setup()
{
  ReefAngel.Init();  
}

void loop()
{
  
  /*
  This code will display:
  
  Temperature probes
  pH probe
  Daylight PWM % (if the feature is enabled)
  Actinic PWM % (if the feature is enabled)
  Relay box
  Time/Date
  ATO port status
  
  It will blink the red status LED and increment the PWM % every second.
  
  Moving or pressing the joystick will activate another port in the relay box.
  
  */
  if (ReefAngel.Joystick.IsUp() || ReefAngel.Joystick.IsRight()) port++;
  if (ReefAngel.Joystick.IsButtonPressed()) port++;
  if (ReefAngel.Joystick.IsDown() || ReefAngel.Joystick.IsLeft()) port--;
  if (port>7) port=0;
  if (port<0) port=7;
  ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,15,10,"Port   On");
  ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,45,10,port+1); 
  ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,15,20,"Low ATO");
  if (ReefAngel.LowATO.IsActive())
    ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,65,20,"Closed");
  else
    ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,65,20,"Open  ");
  ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,15,30,"High ATO");
  if (ReefAngel.HighATO.IsActive())
    ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,70,30,"Closed");
  else
    ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,70,30,"Open  ");
  ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,15,40,"Status LED ");
  if (now()%2==0)
  {
    ReefAngel.LED.On();
    ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,80,40,"On ");
  }
  else
  {
    ReefAngel.LED.Off();
    ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,80,40,"Off");
  }
  ReefAngel.Relay.RelayData=1<<port;
  //Box1_Port
  ReefAngel.Relay.RelayDataE[0]=1<<port;  
#if defined DisplayLEDPWM && ! defined RemoveAllLights
  ReefAngel.PWM.SetActinic(now()%100);
  ReefAngel.PWM.SetDaylight(now()%100);
  ReefAngel.LCD.DrawMonitor(15, 70, ReefAngel.Params,
  ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue());
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
  ReefAngel.LCD.DrawMonitor(15, 70, ReefAngel.Params);
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
  ReefAngel.LCD.DrawOutletBox(12, 103, ReefAngel.Relay.RelayData);
  ReefAngel.LCD.DrawDate(6, 122);
  ReefAngel.Relay.Write();
  ReefAngel.Refresh();
}
Roberto.
Piper27
Posts: 29
Joined: Wed Jun 27, 2012 1:10 pm

Re: Problem with lights not turning off

Post by Piper27 »

Thanks, so the second box everything turned on and off correctly.
Piper27
Posts: 29
Joined: Wed Jun 27, 2012 1:10 pm

Re: Problem with lights not turning off

Post by Piper27 »

I rechecked the first box and it's still only port one that is not turning off.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Problem with lights not turning off

Post by rimai »

Ok, so we know 1 port is bad.
You got PM.
Since you tested the others and they all seem to be working, ca we move some stuff around and see what happens?
I've changed you code a little to switch some stuff around and staggered them so they turn on/off at different times, instead of all at once.

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 <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
 // Ports toggled in Feeding Mode
 ReefAngel.FeedingModePorts = 0;
 ReefAngel.FeedingModePortsE[0] = 0;
 // Ports toggled in Water Change Mode
 ReefAngel.WaterChangePorts = 0;
 ReefAngel.WaterChangePortsE[0] = 0;
 // Ports toggled when Lights On / Off menu entry selected
 ReefAngel.LightsOnPorts = 0;
 ReefAngel.LightsOnPortsE[0] = 0;
 // Ports turned off when Overheat temperature exceeded
 ReefAngel.OverheatShutoffPorts = Port2Bit | Port3Bit | Port7Bit;
 ReefAngel.OverheatShutoffPortsE[0] = Port1Bit;
 // Use T1 probe as temperature and overheat functions
 ReefAngel.TempProbe = T1_PROBE;
 ReefAngel.OverheatProbe = T1_PROBE;
 // Set the Overheat temperature setting
 InternalMemory.OverheatTemp_write( 821 );


 // Ports that are always on

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


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

void loop()
{
 ReefAngel.StandardLights( Port1,12,0,17,0 );
 ReefAngel.StandardLights( Port2,9,31,18,31 );
 ReefAngel.StandardLights( Port3,9,30,18,30 );
 ReefAngel.StandardLights( Port4,12,1,17,1 );
 ReefAngel.Wavemaker( Port5,240 );
 ReefAngel.Relay.Set( Port6, !ReefAngel.Relay.Status( Port5 ) );
 ReefAngel.StandardLights( Port7,10,0,18,0 );
 ReefAngel.StandardLights( Port8,9,32,18,32 );
 ReefAngel.StandardLights( Box1_Port1,12,2,17,2 );
 ReefAngel.StandardLights( Box1_Port2,11,45,17,30 );
 ReefAngel.StandardLights( Box1_Port3,17,0,2,0 );
 ReefAngel.StandardLights( Box1_Port4,17,3,2,3 );
 ReefAngel.Wavemaker( Box1_Port5,240 );
 ReefAngel.Relay.Set( Box1_Port6, !ReefAngel.Relay.Status( Port5 ) );
 ReefAngel.StandardLights( Box1_Port7,11,44,17,29 );
 ReefAngel.StandardLights( Box1_Port8,11,43,17,28 );
 ////// Place your custom code below here


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

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

void DrawCustomMain()
{
 int x,y;
 char text[10];
 // Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
 ReefAngel.LCD.DrawMonitor( 15, 62, ReefAngel.Params,
 ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
 ReefAngel.LCD.DrawMonitor( 15, 62, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
 pingSerial();

 // Main Relay Box
 byte TempRelay = ReefAngel.Relay.RelayData;
 TempRelay &= ReefAngel.Relay.RelayMaskOff;
 TempRelay |= ReefAngel.Relay.RelayMaskOn;
 ReefAngel.LCD.DrawOutletBox( 12, 93, TempRelay );
 pingSerial();

 // Relay Expansion
 TempRelay = ReefAngel.Relay.RelayDataE[0];
 TempRelay &= ReefAngel.Relay.RelayMaskOffE[0];
 TempRelay |= ReefAngel.Relay.RelayMaskOnE[0];
 ReefAngel.LCD.DrawOutletBox( 12, 106, TempRelay );
 pingSerial();

 // Date and Time
 ReefAngel.LCD.DrawDate( 6, 122 );
 pingSerial();
}

void DrawCustomGraph()
{
 ReefAngel.LCD.DrawGraph( 5, 5 );
}
Can you let me know what you observe?
Roberto.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Problem with lights not turning off

Post by rimai »

BTW, what did you have plugged in into the port1 of main box, which is the one that is bad?
Roberto.
Piper27
Posts: 29
Joined: Wed Jun 27, 2012 1:10 pm

Re: Problem with lights not turning off

Post by Piper27 »

I have a Icecap with 4 39w t5s.
Post Reply