jbrazio / arduheater

:fire: Open source closed-loop dew buster PID controller
GNU General Public License v3.0
26 stars 7 forks source link

(Feature-) Request about heating control - stay above minimum temperature (anti-freezing) #4

Open Fux2 opened 3 years ago

Fux2 commented 3 years ago

Hi João, thanks for this great project. For the rain sensors of my weather station I am looking for a heating control. The arduheater hardware fits perfect, as I need 4 channels. One dew heating channel for the rain sensing sensor and three heating channels for keeping the temperature above freezing. Is there already something build in, to keep the temperature stable above a given adjustable minimum temperature, for example 3°C? If no, do you think this would be a big effort? At which source part would you implement this? Many thanks Markus

Fux2 commented 3 years ago

I had some look into the source and think the easiest solution for anti-freezing is, to set the "dew-point" fix to 0°C. This means, that with the offset dew temperature the target temperature above 0°C can be adjusted.

// ORIGINAL part of callback.h
...
  for(size_t i = 0; i < asizeof(output); i++) {
    if(ambient.is_connected()) {
      // Update the output setpoint as long as it is connected.
      output[i].set_setpoint(ambient.dew_point());
      //if(i == 1 || i == 3) output[i].set_setpoint_offset(10);
      //output[i].set_setpoint(40);
...
// MODIFIED ch1 to ch3 as anti-freezing heater
...
  for(size_t i = 0; i < asizeof(output); i++) {
    if(ambient.is_connected()) {
      // Update the output setpoint as long as it is connected.
    if(i == 0) { // default dew mode
        output[i].set_setpoint(ambient.dew_point());
    }
    else { // anti-freezing mode --> "dew_point" always set to 0°C
        output[i].set_setpoint(0.0f);
    }
      //if(i == 1 || i == 3) output[i].set_setpoint_offset(10);
      //output[i].set_setpoint(40);
...

Not tested yet. Any comments are welcome.