Power outage detection?
-
- Posts: 52
- Joined: Wed Sep 16, 2015 8:12 am
Power outage detection?
Is there a power outage solution for RA? (at least some way to detect the power has gone out if everything were on a ups)
Re: Power outage detection?
Yep.
You need an expansion relay box.
Plug your RA into a UPS. Plug the expansion relay box into the wall. This works by detecting when the expansion relay looses power and isn't seen anymore.
Here's how I do the code. I have it as a separate function. You'll need to edit to fit your particular setup.
Put this up in globals somewhere:
Put this near the end of your loop. It needs to be after anything it might affect or it won't work right.
Now, put this at the very end of your code, past the final }, outside of loop, outside of everything.
Let me know if you need more assistance with this.
You need an expansion relay box.
Plug your RA into a UPS. Plug the expansion relay box into the wall. This works by detecting when the expansion relay looses power and isn't seen anymore.
Here's how I do the code. I have it as a separate function. You'll need to edit to fit your particular setup.
Put this up in globals somewhere:
Code: Select all
boolean powerOutage=false; // For power outage code
Code: Select all
CheckPower(); // Check for power outage and take appropriate measures. Needs to be near the end to override everything else.
Code: Select all
void CheckPower() {
// Power Outage - turn off everything
if (!ReefAngel.Relay.IsRelayPresent(0)) // Expansion Relay NOT present because it's not hooked up to UPS and power is out.
{
powerOutage=true; // Set a flag
// Replace all this stuff with what you want to do when the power is off
ReefAngel.Relay.Off(Heater); // Turn all this stuff OFF
ReefAngel.Relay.Off(Skimmer);
ReefAngel.Relay.Off(Return);
ReefAngel.Relay.Off(Fuge);
ReefAngel.Relay.Off(Swabbie);
ReefAngel.Relay.Off(CanopyFans);
ReefAngel.Relay.Off(Fan);
ReefAngel.PWM.SetChannelRaw(Blues,0); // Turn off Blues on PWM Expansion.
ReefAngel.PWM.SetChannelRaw(Whites,16); // Set Whites to minimal as a visual indicator. Uses minimal power.
ReefAngel.DCPump.UseMemory = false; // Turn off memory/portal control of powerheads
ReefAngel.DCPump.SetMode(Constant,30,0); // and set them to a constant 30 for emergency circulation.
}
// Power Restored - Turn things back on
if (powerOutage && ReefAngel.Relay.IsRelayPresent(0)) // Has there been an outage, and is the expansion relay there again?
{
powerOutage=false; // Clear the flag
// Replace this stuff with what you need to turn back on when the power returns.
ReefAngel.Relay.On(Skimmer); // Turn always on things back on
ReefAngel.Relay.On(Return); // Everything else will return to automatic control
}
// If there has been no power outage, nothing happens at all.
}
-
- Posts: 52
- Joined: Wed Sep 16, 2015 8:12 am
Re: Power outage detection?
Does the RA work ok with modified sine or does it require a pure since wave ups?
Still determining which route to go..
Still determining which route to go..
Re: Power outage detection?
I have a cheap APC UPS (certainly not sine wave) with Jebao pumps and LED's and it seems to work fine.
--Colin
--Colin
Re: Power outage detection?
Modified sine works fine for the RA but not for my return pump, so I swapped out the UPC