Turn two heaters on based on temp

Do you have a question on how to do something.
Ask in here.
Post Reply
chase
Posts: 101
Joined: Fri Sep 16, 2011 8:26 am

Turn two heaters on based on temp

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

Re: Turn two heaters on based on temp

Post by rimai »

What is Heater2?
Roberto.
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Turn two heaters on based on temp

Post 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.
User avatar
jsclownfish
Posts: 375
Joined: Mon Oct 24, 2011 7:52 pm
Location: Saint Louis

Re: Turn two heaters on based on temp

Post 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
chase
Posts: 101
Joined: Fri Sep 16, 2011 8:26 am

Re: Turn two heaters on based on temp

Post 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?
Image
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Turn two heaters on based on temp

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

Re: Turn two heaters on based on temp

Post by rimai »

Or just increase the histerisys.
you are using 77.0 and 77.1, increase it to like .5 degrees.
Roberto.
Post Reply