Fans with second temp probe

Do you have a question on how to do something.
Ask in here.
Post Reply
Armetas
Posts: 82
Joined: Sat Mar 29, 2014 1:55 pm

Fans with second temp probe

Post 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?
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Fans with second temp probe

Post 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.
Armetas
Posts: 82
Joined: Sat Mar 29, 2014 1:55 pm

Re: Fans with second temp probe

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

Re: Fans with second temp probe

Post 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.
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Fans with second temp probe

Post 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 :)
Armetas
Posts: 82
Joined: Sat Mar 29, 2014 1:55 pm

Re: Fans with second temp probe

Post by Armetas »

Thank you all :)
Image
Post Reply