temperature controll

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
User avatar
Jordy101091
Posts: 519
Joined: Sat Jan 08, 2011 4:02 pm
Location: The Netherlands
Has thanked: 25 times
Been thanked: 188 times
Contact:

temperature controll

Post by Jordy101091 »

Hi, all

Im still working on my aquarium controller, everything works perfectly but one thing I can't figure out thats why I need your help.
For the temperature controller section of the software I need to make something like hysteresis so that the heater doesn't kick in on every change of temperature.

If I set the upper limit of the temperature to: 22.4
My goal temperature to: 22.0
and my lowest temperature to: 21.8

So that the heater kicks in when the temperature is 22.8 or below and stops when temperature reaches 22.1 or above.
I dont know on howto approach this problem. hope somebody can explain it to my.

Regards Jordy
the will to learn, should not be stopped by any price

Gary Freegard
Posts: 45
Joined: Mon Nov 07, 2011 6:36 pm
Has thanked: 1 time
Been thanked: 30 times
Contact:

Re: temperature controll

Post by Gary Freegard »

Hi

I would try the following, or something similiar
  • if (new_temp-old_temp) > 0 then temp_up = 1
    if (new_temp-old_temp) < 0 then temp_up = 0

    if new_temp <=22.8 AND temp_up = 0 then heater on
    if new_temp >=22.1 AND temp_up = 1 then heater off
Goodluck

Gary

User avatar
Steve
Matrix Staff
Posts: 3422
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: temperature controll

Post by Steve »

I think you just need to do the following every few seconds:

Code: Select all

  read temperature

  if (temperature < MIN_TEMPERATURE)
    turn heater on
  end if

  if (temperature > MAX_TEMPERATURE)
    turn heater off
  end if

User avatar
Jordy101091
Posts: 519
Joined: Sat Jan 08, 2011 4:02 pm
Location: The Netherlands
Has thanked: 25 times
Been thanked: 188 times
Contact:

Re: temperature controll

Post by Jordy101091 »

Thanks steve and gary for your quick reaction,

The solution steve has works best for me and tested this and works perfectly thanks for that.

Regards Jordy
the will to learn, should not be stopped by any price

Post Reply