Using return pump with UPS

Do you have a question on how to do something.
Ask in here.
Post Reply
wtitb
Posts: 32
Joined: Sun Nov 17, 2013 3:32 pm

Using return pump with UPS

Post 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
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Using return pump with UPS

Post 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);
 }
Roberto.
wtitb
Posts: 32
Joined: Sun Nov 17, 2013 3:32 pm

Re: Using return pump with UPS

Post 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
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Using return pump with UPS

Post 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.
Roberto.
wtitb
Posts: 32
Joined: Sun Nov 17, 2013 3:32 pm

Re: Using return pump with UPS

Post by wtitb »

oh, thanks for this obvious explanation, seems to be a little late for me this evening ;)

cheers,
Christian
Post Reply