Page 1 of 1
Turn two heaters on based on temp
Posted: Thu Jan 19, 2012 8:44 pm
by chase
Trying to use temp 1 for turning on a couple relays with heaters. Was wondering if I just added the && (Heater2, 5) to my existing code, if that would work? I just have the 5 on for a delay to keep the heaters from toggling off and on.
Code: Select all
// Turn on Heaters when the temp < 77.0 degrees
if ( ReefAngel.Params.Temp1 < 770 ) ReefAngel.Relay.DelayedOn(Heater, 5) && (Heater2, 5);
// Turn off Heaters when the temp > 77.1 degrees
if ( ReefAngel.Params.Temp1 >= 771 ) ReefAngel.Relay.Off(Heater) && (Heater2, 5);
Thanks for the help!
Re: Turn two heaters on based on temp
Posted: Thu Jan 19, 2012 9:33 pm
by rimai
What is Heater2?
Re: Turn two heaters on based on temp
Posted: Fri Jan 20, 2012 4:40 am
by binder
Adding the && (Heater2, 5) would not work. That would not be a valid statement. You have to make it an entirely new statement.
Code: Select all
if ( ReefAngel.Params.Temp1 < 770 )
{
ReefAngel.Relay.DelayedOn(Heater, 5);
ReefAngel.Relay.DelayedOn(Heater2, 5);
}
You do realize that DelayedOn delays the turning on of the port by the specified number of minutes only after the controller starts, exits feeding or water change modes. It does not wait the specified number of minutes after each toggle.
Also, I'm assuming that you have Heater2 defined as a port number for the relay box.
Re: Turn two heaters on based on temp
Posted: Fri Jan 20, 2012 7:16 am
by jsclownfish
I use a back-up heater when it gets too cold. Here is the advice I got for that...
http://forum.reefangel.com/viewtopic.php?f=12&t=412
-Jon
Re: Turn two heaters on based on temp
Posted: Sat Jan 21, 2012 10:51 pm
by chase
binder wrote:
You do realize that DelayedOn delays the turning on of the port by the specified number of minutes only after the controller starts, exits feeding or water change modes. It does not wait the specified number of minutes after each toggle.
Oh, okay I thought that's how it worked. Is there an option to put a delay timer on a port to keep it from rapidly toggling?
Re: Turn two heaters on based on temp
Posted: Sun Jan 22, 2012 9:38 am
by binder
if you are talking about that for relays based on the temperature, i would make sure direct temp sensor is not enabled. i do a smoothing out of the temp and prevent rapid temp swings. its not perfect but can help. it requires a controller reboot though if you unplug a sensor though based on the logic. so you may want to look at that.
Re: Turn two heaters on based on temp
Posted: Sun Jan 22, 2012 10:12 am
by rimai
Or just increase the histerisys.
you are using 77.0 and 77.1, increase it to like .5 degrees.