Page 1 of 2

Power outage alert

Posted: Tue Nov 01, 2011 9:55 pm
by jsclownfish
Can the system be configured to alert me of a power outage?

Re: Power outage alert

Posted: Wed Nov 02, 2011 8:43 am
by rimai
When would you like to get the notification?

Re: Power outage alert

Posted: Wed Nov 02, 2011 9:37 pm
by jsclownfish
I suppose as soon as it happens. I guess I'd need to both have the system alarm and notify me by wifi (web, iPhone, email, etc.) I've had a couple bad experiences with power failures and my reef tank. I'd imagine I'd notice a problem just by seeing the parameters change, but it would be good to know if I needed to get home and put a generator on the tank to keep the system from crashing.

-Jon

Re: Power outage alert

Posted: Wed Nov 02, 2011 9:39 pm
by rimai
Do you have your router and controller operatinal with a power backup unit when the power goes out?

Re: Power outage alert

Posted: Thu Nov 03, 2011 12:16 am
by alexwbush
I wonder if the RA is capable for tracking when the power was out (like length of time and when it was restored).

Re: Power outage alert

Posted: Thu Nov 03, 2011 8:27 am
by rimai
alexwbush wrote:I wonder if the RA is capable for tracking when the power was out (like length of time and when it was restored).
A very complicated way could be done to achieve this, but more research would need to be done.
The theory of this is measure for brownout and save the time to memory right before voltage drops below 4.7V for example. Saving to memory is fast enough to happen before the controller looses it's power completely.

Re: Power outage alert

Posted: Thu Nov 03, 2011 10:16 am
by jsclownfish
Good point, I do have a battery back-up for my phone VOIP phone service and I suppose the router could be plugged into it as well.

Re: Power outage alert

Posted: Thu Nov 03, 2011 12:27 pm
by rimai
One way of doing it would be to have a power backup unit on the RA system and use a modified wall wart to tell RA that there is power or not on the house.
You can use one of of the ATO ports as input for this modified wall wart.

Re: Power outage alert

Posted: Thu Dec 15, 2011 11:50 am
by jsclownfish
Could a simple battery pack be used as a power back-up on the controller along with the a modified wall wart to power the controller long enough to send a notice that the main power has gone out?

-Jon

Re: Power outage alert

Posted: Thu Dec 15, 2011 1:16 pm
by rimai
yeap

Re: Power outage alert

Posted: Thu Dec 15, 2011 5:30 pm
by jsclownfish
So would I have to make a junction between the serial connection or can the master controller feed off the slave if there was a battery set connected to the 5v/gnd lines?

Re: Power outage alert

Posted: Thu Dec 15, 2011 5:48 pm
by rimai
The master could feed off of the slave, but it is really not designed for that.
The best option I see is to use a small UPC. It will maintain RA long enough for your email alert.

Re: Power outage alert

Posted: Thu Dec 15, 2011 6:43 pm
by jsclownfish
Makes sense. I'll just get something like this....http://www.amazon.com/CyberPower-CP425S ... 60&sr=1-17. I was just thinking about the options and a small battery pack is really inexpensive.

-Jon

Re: Power outage alert

Posted: Tue Jan 31, 2012 2:04 pm
by Treamaya
Any suggestions on how to hook up to a APC battery back up system? I currently have one on both my PC, router and another on the tank. There are 4 outlets (out of 8) on the UPS that are battery backed up. Here is what I am thinking...

-use one of the non-battery backed outlets with the suggested wall wart to indicate loss of power.
-use one battery backed outlet for the RA
-use one battery backed outlet to plug the relay box into
-program the ATO port used to indicate the loss of power, to shut down everything except the return and skimmer (for oxygenation).

Re: Power outage alert

Posted: Tue Jan 31, 2012 2:54 pm
by rimai
Yes, that would work great!!
Just make sure not to feed more than 5VDC into the ATO port.

Re: Power outage alert

Posted: Sat Mar 03, 2012 1:34 pm
by chase
What kind of wall wart would you suggest? I tried looking a few up but have no idea which one to get or how I would connect it to the pwm port. I would like to integrate this into my controller as well. Do you think this kind of thing might be useful to provide on your guys' online store?

Re: Power outage alert

Posted: Sat Mar 03, 2012 4:42 pm
by rimai
You can use any regulated 5VDC walwart. The best ones are the ones made for cell phones and have a USB plug in it. USB uses 5VDC as standard.
Get a good quality one or you will end up frying the controller. I've seen them output more than 5VDC.

Re: Power outage alert

Posted: Sun Mar 04, 2012 11:28 pm
by Treamaya
What about a 3vdc supply? You said not more than 5vdc, so what is the LO threshold that indicates loss of power?

You are very right about the 5Vdc wall warts, I checked several and they were all off. Most were in the 7vdc range. One of my 12vdc supplies was actually at 17vdc!

Re: Power outage alert

Posted: Mon Mar 05, 2012 9:05 am
by rimai
3VDC should work too.

Re: Power outage alert

Posted: Tue Mar 06, 2012 7:45 pm
by chase
Found a usb charger like you described for an old blackberry. Says 5V output @ 700mA, I'll verify the 5V with a multimeter but assuming its accurate this should work? If both my ATO ports are in use can I use any of the ports on the relay box?

Re: Power outage alert

Posted: Tue Mar 06, 2012 9:20 pm
by rimai
No :(
It has to be one of the ATO ports.

Re: Power outage alert

Posted: Thu Mar 22, 2012 9:00 am
by chase
Okay, tested out the adapter and it seems to put out around 4.95-5.17 VDC. I'm assuming this will be okay to hookup using my ATO High switch port? That said, could you give an example of code I test if power did fail? For example, I would like it to deactivate port 1 and 2 on the main relay box along with port 3 and 4 on the relay expansion box. Once power is restored I would then like to enable the disabled relays. Thanks in advance!

Re: Power outage alert

Posted: Thu Mar 22, 2012 10:30 am
by rimai
Try this.

On setup():

Code: Select all

digitalWrite(highATOPin,LOW);
Your loop() need to look like this:

Code: Select all

void loop()
{


  // Your code goes above here
  if (!digitalRead(highATOPin))
  {
    ReefAngel.Relay.Off(Port1);
    ReefAngel.Relay.Off(Port2);
    ReefAngel.Relay.Off(Box1_Port3);
    ReefAngel.Relay.Off(Box1_Port4);
  }
  ReefAngel.ShowInterface();
}
ShowInterface() has to be the last line and the check has to be right above it.

Re: Power outage alert

Posted: Fri Mar 23, 2012 2:03 am
by chase
So it looks like I shorted the ATO high port out.

I made sure to connect up the adapter with the correct +/- sides using indications on the existing ATO switch cables. When I hooked up the adapter to the ATO high port my tank lights flashed on and the red status light started blinking. I shut off the adapter (I had it plugged into a surge strip for easy on/off).

Now the ATO high port indicates there's no power going to it, even though the float switch is all the way down. Just to make sure it wasn't the actual float switch, I hooked up the other one and got the same indication. I went ahead and modified my ATO code so that it will at least top the tank off, as I was using the ATO high as a safety in case the pump or something malfunctioned. But I had to take that out, since it registers as open instead of closed keeping the ATO pump from engaging.

Thought I was doing everything right... :(

Re: Power outage alert

Posted: Fri Mar 23, 2012 7:54 am
by rimai
Do you still have this on the setup()?

Code: Select all

digitalWrite(highATOPin,LOW);
If so, you are disabling the port for use as ATO as it is actually using pull-down instead of pull-up.

Re: Power outage alert

Posted: Fri Mar 23, 2012 2:22 pm
by chase
No, I reverted back to my old code to make sure it wasn't something that I had done since. Also the RA Client shows the ATO Hi as red, normally it's green since the switch is all the way down making contact.
Here's my code just in case:

Code: Select all

#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel.h>

#define Daylight            1
#define AutoTopOff          2
#define Heater              3
#define Return              4
#define WavemakerL          5
#define WavemakerR          6
#define LEDs                7
#define Refugium            8
#define AlkDoser            13
#define CaDoser             14
#define AclHeater           17
#define GFO                 18 

void setup()
{
   randomSeed(analogRead(0)); //wm stuff 
    ReefAngel.Init();  //Initialize controller   
    ReefAngel.FeedingModePorts = B00111000;
//    ReefAngel.WaterChangePorts = B00000000;
//    ReefAngel.OverheatShutoffPorts = B00000101;
//    ReefAngel.LightsOnPorts = B00000001;
    // Ports that are always on
    ReefAngel.Relay.On(Return);
    ReefAngel.Relay.On(GFO);
//WaveMaker stuff
    ReefAngel.Timer[1].SetInterval(random(15,35));
    ReefAngel.Timer[1].Start(); 
    ReefAngel.Relay.On(WavemakerL);
}

void loop()
{
    ReefAngel.ShowInterface();
    
//    ReefAngel.StandardFan(Chiller,775,783); Removed for ATO function
//    ReefAngel.StandardHeater(Heater,785,79); 
    ReefAngel.StandardLights(Daylight,10,0,21,00);  //Daylight schedule 10:00am - 9:00pm
    ReefAngel.StandardLights(Refugium,21,0,10,0);  //Refugium schedule 9:00pm - 10:00am
    ReefAngel.StandardLights(LEDs,9,00,22,00);  //LED schedule 9:00am - 10:00pm
    ATOFailSafe(AutoTopOff); //ATO Stuff  
//Heater Temp Settings
// Turn on Heaters when the temp < 78.8 degrees
          if ( ReefAngel.Params.Temp1 < 788 ) ReefAngel.Relay.DelayedOn(Heater, 1);
          // Turn off Heaters when the temp > 78.6 degrees
          if ( ReefAngel.Params.Temp1 >= 791 ) ReefAngel.Relay.Off(Heater);
//Acclimation Heater Temp 2 settings
       // Turn on AclHeater when the temp < 78.8 degrees
          if ( ReefAngel.Params.Temp2 < 788 ) ReefAngel.Relay.DelayedOn(AclHeater, 1);
          // Turn off AclHeater when the temp > 79.1 degrees
          if ( ReefAngel.Params.Temp2 >= 791 ) ReefAngel.Relay.Off(AclHeater);
//Wavemaker
    if ( ReefAngel.Timer[1].IsTriggered() )
      {
        ReefAngel.Timer[1].SetInterval(random(15,30));
        ReefAngel.Timer[1].Start();
        ReefAngel.Relay.Toggle(WavemakerL); //port 5
        ReefAngel.Relay.Toggle(WavemakerR); //port 6
       }
//Dose Ca
                   if ( ReefAngel.DisplayedMenu == DEFAULT_MENU ) //Ca Doser - Only works if Main screen is showing
              {
               /* && = and || = or
               Hours between 12am and 8am
               minute must be 0 (top of the hour)
               seconds less than 2 (up to 2 seconds)
               */
               if ( ((hour() >= 0) && (hour() <= 8)) && (minute() == 0) && //dose time
                   (second() < 2) ) //dose duration
               {
                  ReefAngel.Relay.On(CaDoser);
               }
               else
               {
                  ReefAngel.Relay.Off(CaDoser);
               }
            }
  
//Dose Alk
                   if ( ReefAngel.DisplayedMenu == DEFAULT_MENU ) //Alk Doser - Only works if Main screen is showing
              {
               /* && = and || = or
               Hours between 12:05am and 8:05am
               minute must be 0 (top of the hour)
               seconds less than 2 (up to 2 seconds)
               */ 
               if ( ((hour() >= 0) && (hour() <= 8)) && (minute() == 5) && //dose time
                   (second() < 2) ) //dose duration
               {
                  ReefAngel.Relay.On(AlkDoser);
               }
               else
               {
                  ReefAngel.Relay.Off(AlkDoser);
               }
            }  
}

void ATOFailSafe(byte ATO) //changed port to fATO
{
   // Check for the low switch
   /*
   If the Low switch is active, meaning the float is opposite the end with the two wires,
        we are empty so we should turn on the pump.  Otherwise, we are full, so turn off the port.
   */
   if ( ReefAngel.LowATO.IsActive() )
   {
      ReefAngel.LowATO.StartTopping();
      ReefAngel.Relay.On(ATO);
   }
   else
   {
      ReefAngel.LowATO.StopTopping();
      ReefAngel.Relay.Off(ATO);
   }
}

Re: Power outage alert

Posted: Fri Mar 23, 2012 4:35 pm
by rimai
PM me if you want to replace.
I went back and read what you wrote and I think the confusion was on the part where you followed the markings on the ATO cable.
The ATO float switches use the same pinout as the PWM output ports.
You can find the pinout in the user manual.

Re: Power outage alert

Posted: Sat Mar 24, 2012 2:35 pm
by chase
Okay, yeah that's def it I'll shoot you a PM.

Re: Power outage alert

Posted: Wed Mar 28, 2012 7:47 pm
by tkeracer619
Treamaya wrote:
You are very right about the 5Vdc wall warts, I checked several and they were all off. Most were in the 7vdc range. One of my 12vdc supplies was actually at 17vdc!

How about a 5v supply that outputs 30v...

My poor ReefAngel... she didn't deserve that. She didn't do anything to anyone.

:? wallwarts...


Shout out to the creator of our angels... he takes good care of them. Roberto, this next drink is for you. 8-)

Re: Power outage alert

Posted: Fri Mar 30, 2012 8:46 am
by chase
rimai wrote:PM me if you want to replace.
I went back and read what you wrote and I think the confusion was on the part where you followed the markings on the ATO cable.
The ATO float switches use the same pinout as the PWM output ports.
You can find the pinout in the user manual.
PM Sent