Page 1 of 1

Using return pump with UPS

Posted: Mon Jan 20, 2014 3:11 pm
by wtitb
Hi,

I currently power my return pump with an UPS. To be able to switch the return off, e.g. in feeding or waterchange mode, I have a DIY adapter between UPS and return pump, that is connected with relay port 8 of the RA. Whenever this port is powered on it toggles a relay in the adapter, that turns off power for the return. So in standard mode the relay port is off and the pump is running.
I have configured the port to be toggled in feeding/waterchange mode, but it's not really toggled (as one could think because of the code comments) but turned off instead, so the pump is still running :(
How can this be solved? I currently have this:

// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port6Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port6Bit;

and in the loop:

if (ReefAngel.DisplayedMenu==FEEDING_MODE)
{
ReefAngel.Relay.On(Port8);
}
else
{
ReefAngel.Relay.Off(Port8);
}

if (ReefAngel.DisplayedMenu==WATERCHANGE_MODE)
{
ReefAngel.Relay.On(Port8);
}
else
{
ReefAngel.Relay.Off(Port8);
}


works, but is there also a "standard" way for this?

cheers,
Christian

Re: Using return pump with UPS

Posted: Mon Jan 20, 2014 3:20 pm
by rimai
Your code for wc will override any code you made for feeding.
Try this:

Code: Select all

if (ReefAngel.DisplayedMenu==FEEDING_MODE || ReefAngel.DisplayedMenu==WATERCHANGE_MODE)
 {
 ReefAngel.Relay.On(Port8);
 }
 else
 {
 ReefAngel.Relay.Off(Port8);
 }

Re: Using return pump with UPS

Posted: Mon Jan 20, 2014 3:38 pm
by wtitb
Hi Roberto,

I thought there could only be one menu at a time. So how does the wc code override the feeding code?

Just another idea for this: Could I configure a non existent second relay box, assign the return pump to one of its ports and use the adapters port 8 as opposite of the virtual port? Would this work?

Thanks,
Christian

Re: Using return pump with UPS

Posted: Mon Jan 20, 2014 3:47 pm
by rimai
One mode at a time, but the code runs like this in your code:
Checks for feeding and turns on/off port8.
Then it checks for wc and turns on/off port8, which would force it to be on or off depending on which mode you are, disregarding the previous check.
Yes, you can use virtual relays :)
I've seen a few people doing this.

Re: Using return pump with UPS

Posted: Mon Jan 20, 2014 3:56 pm
by wtitb
oh, thanks for this obvious explanation, seems to be a little late for me this evening ;)

cheers,
Christian