Page 1 of 1

Fans with second temp probe

Posted: Wed Aug 20, 2014 7:48 am
by Armetas
Hi All,

I have two tanks and having one temp probe for 1st tank and second temp probe for 2nd tank. For 1st tank for chilling I use: ReefAngel.StandardFan( Box1_Port3,245,250 ); - it works great

I want to make same effect as I'm getting with first one. I've tried such code:

if (ReefAngel.Params.Temp[T2_PROBE] >= 245)
ReefAngel.Relay.On(Box2_Port4);
else
ReefAngel.Relay.Off(Box2_Port4);

Seems that it works, but when temp reaches almost 24,5 Celsius it begins to on/off my port, it happens due to temperature (which is not stable). Temperature varies from 24,4 Celsius to 24,5 Celsius.

Maybe there is another possible solution for this one?

Re: Fans with second temp probe

Posted: Wed Aug 20, 2014 8:28 am
by lnevo
You have to have it in a range. If you look in the libraries at ReefAngel/ReefAngel.cpp you can copy the StandardFan function

Basically you don't want to use the else. If the heat gets over 245 then turn on BUT put another if statement for when the temp gets lower than X then you can turn off the port. This will give you a range just like we do with the heater to make sure that it's not on/off/on/off all day.

Re: Fans with second temp probe

Posted: Wed Aug 20, 2014 8:35 am
by Armetas
Maybe you can describe how to get library and how to check code in it? Yes it is a bit a shame :(

And actually didn't understood what you meant with ranges

Re: Fans with second temp probe

Posted: Wed Aug 20, 2014 9:10 am
by rimai
He meant that you need some sort of hysteresis or you will get what you are experiencing. If you make a range where it needs to travel lower than a single point, it will work as expected.

Code: Select all

if (ReefAngel.Params.Temp[T2_PROBE] >= 250) ReefAngel.Relay.On(Box2_Port4); 
if (ReefAngel.Params.Temp[T2_PROBE] <= 245) ReefAngel.Relay.Off(Box2_Port4); 
Just like the function you are using: ReefAngel.StandardFan( Box1_Port3,245,250 );
The 245 is the lower end of the range and the 250 is the upper end of the range.

Re: Fans with second temp probe

Posted: Wed Aug 20, 2014 9:29 am
by lnevo
In your computer, under Documents\Arduino\Libraries is the folder ReefAngel and inside that is the file ReefAngel.cpp which has the functions StandardFan, StandardHeater, etc. :)

And roberto took care of the rest :)

Re: Fans with second temp probe

Posted: Wed Aug 20, 2014 9:36 am
by Armetas
Thank you all :)