Relay Not Responding

Expansion modules and attachments
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Relay Not Responding

Post by rimai »

Man, I think it can only be bad equipment.
We went through all my ideas.
The last thing I can think of is actually testing every port with the ControllerTester code to make sure it is indeed defective.
File->Sketchbook->Example Codes->ControllerTester
Roberto.
btorrenga
Posts: 100
Joined: Mon Apr 16, 2012 10:22 pm

Re: Relay Not Responding

Post by btorrenga »

Ugh, ok, I did the controller tester on each relay twice, one time with each VGA cable. Port 4 on my original main relay box (before swapped, with the swapped results being shown in the recent test results) being stuck always on. All other ports went ok.

Considering that, does it sound like there is one bad port causing all the errors? Or, does it sound like there is one bad port and some code errors/bugs?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Relay Not Responding

Post by rimai »

How about the expansion box?
Roberto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Relay Not Responding

Post by rimai »

You can add this line to test:

Code: Select all

  ReefAngel.Relay.RelayDataE[0]=1<<port;
Roberto.
btorrenga
Posts: 100
Joined: Mon Apr 16, 2012 10:22 pm

Re: Relay Not Responding

Post by btorrenga »

Compile error:

ControllerTester.cpp: In function 'void loop()':
ControllerTester:82: error: 'class RelayClass' has no member named 'RelayDataE'
btorrenga
Posts: 100
Joined: Mon Apr 16, 2012 10:22 pm

Re: Relay Not Responding

Post by btorrenga »

I added that line like this:

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 <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;
  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();
}



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

Re: Relay Not Responding

Post by rimai »

Sorry, the auto-feature is not able to recognize that keyword.
Just add this anywhere in the code:

Code: Select all

  //Box1_Port1
Roberto.
btorrenga
Posts: 100
Joined: Mon Apr 16, 2012 10:22 pm

Re: Relay Not Responding

Post by btorrenga »

Having trouble getting both relays to work with the test code. This compiles ok, but still only shows one relay on the display, cannot control the expansion:

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 <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;
  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();
}

 //Box1_Port1

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

Re: Relay Not Responding

Post by rimai »

The expansion box should follow the same as displayed for the main box.
Roberto.
btorrenga
Posts: 100
Joined: Mon Apr 16, 2012 10:22 pm

Re: Relay Not Responding

Post by btorrenga »

I see. Tested both relays while both are hooked up, same result. One port is stuck on. I still have the first expansion box I bought that has two bad ports in it. Can I open the boxes up and salvage something? Or is that asking for trouble?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Relay Not Responding

Post by rimai »

Are you saying that the expansion box is working ok for all relays?
Roberto.
btorrenga
Posts: 100
Joined: Mon Apr 16, 2012 10:22 pm

Re: Relay Not Responding

Post by btorrenga »

Yes, under the test code one relay box is perfect, the other has port 4 stuck on. I have a third box, the original one I purchased, which has I believe two bad ports. Can I disassemble that one and make one working box from the parts?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Relay Not Responding

Post by rimai »

Yes, you can pop it open to scavenge the relay.
What did you have connected on that port?
You mentioned they were working before you put all together with a night lamp.
And this still doesn't explain how the expansion box works with the test code and not with your code... :?
Roberto.
btorrenga
Posts: 100
Joined: Mon Apr 16, 2012 10:22 pm

Re: Relay Not Responding

Post by btorrenga »

Right, that I tested everything with a lamp previously is troubling. I may have missed that port somehow though. The bad port has always had two korellia powerheads plugged into it. My understanding is that heavy loads, if anything, would be a problem, such as a bunch of metal halide ballasts. In this instance, however, it has either been a small incandescent lamp or two powerheads.
btorrenga
Posts: 100
Joined: Mon Apr 16, 2012 10:22 pm

Re: Relay Not Responding

Post by btorrenga »

Four screws on the top come out fine, but the rest seems to be pretty tight to pull apart. Are there any tricks I need to know about when disassembling the relay?

--Nevermind, I got it. Brute force through some glue. The relays are not soldered, right? It looks like they plug in, which I believe is the part to replace. So I popped out the bad relay #4, and took one of the working relays from my original box that was replaced. Unfortunately I get the same result - relay #4 is still stuck in the on position! The relay I scavenged should be one of the working ones, so I am not worried that I replaced a broken part with a different broken part.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Relay Not Responding

Post by rimai »

Yes, the relays are soldered.
The part you replaced is probably just the socket.
The relay is a square piece that is soldered on the board.
Roberto.
btorrenga
Posts: 100
Joined: Mon Apr 16, 2012 10:22 pm

Re: Relay Not Responding

Post by btorrenga »

Ok, I understand now. I replaced the socket.
btorrenga
Posts: 100
Joined: Mon Apr 16, 2012 10:22 pm

Re: Relay Not Responding

Post by btorrenga »

I replaced the relay. The replaced relay is stuck in the off position. What does that indicate is broken?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Relay Not Responding

Post by rimai »

You got pm.
Roberto.
Post Reply