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
temperature controll
Moderator: Benj
- Jordy101091
- Posts: 519
- Joined: Sat Jan 08, 2011 4:02 pm
- Location: The Netherlands
- Has thanked: 25 times
- Been thanked: 188 times
- Contact:
-
- Posts: 45
- Joined: Mon Nov 07, 2011 6:36 pm
- Has thanked: 1 time
- Been thanked: 30 times
Re: temperature controll
Hi
I would try the following, or something similiar
Gary
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
Gary
- Steve
- Matrix Staff
- Posts: 3431
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: temperature controll
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
- 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
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 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