Looking for advice regarding a set up with multiple thermostats and heat pad

Hello, I am working on a project where I need to control ~60 heating pad (such as the 4W 75mm diameter ones available here: LM Silicone Rubber Mat Heater 12v (Thermosense Direct)), which will be used to heat small water microcosms (1 pad underneath each microcosm), with the temperature being monitored and controlled by temperature sensors inside the water microcosms, such as these ones: Aideepen 5 x DS18B20 2m Cable Temperature Digital Thermal Probe Sensor Stainless Steel Probe, Accurate Reading, Measure Temperature -55°C to +125°C : Amazon.co.uk: Business, Industry & Science (by the way, if you know about great waterproof temperature sensors with smaller probes out there, I'd be super interested to hear about them).

I am fairly new to the microcontroller world, and I am therefore looking for advices on the type of arduino board I'd need for such set up, as well as any other critical components (for example I guess a power supply will be necessary given the high number of pad to heat). I have been watching and reading many tutorials recently, but to start getting my hand dirty and buy my first components, your advices and tips will be a great value to me.

Thank you.

Please expand on what your microcosm actually is. IF there is something living in the water, you had best determine how your temperature sensor material will effect the life of whatever you have.
Also, since the sensor you linked to is no longer available you need to find something else and test it.
You can easily use math to size the 12 volt power, if all your devices are close together.
And you can control the power going to the heaters using a MOSFET. One per heater and one Arduino pin per MOSFET.
Paul

I suggest that you start with a prototype with perhaps six heating pads. A Nano would be fine for that purpose and you can figure out how you're going to get power to your pads.

Relays are a possibility, or SSR or MOSFET, the latter two will be better if you need to use PWM to get the temperature finely controlled.

In theory, a Mega has enough pins to run all sixty, although if you need PWM, only 15 pins have the ability out of the box.

Unless you need to send data back to a PC, I would be inclined to use multiple Arduinos and let each of them run perhaps ten pads.

How critical is the timing of the temperature adjustment?
If you have a few fractions of a second that you can wait between adjustments then there is no reason that you cannot do all of this with a single controller utilizing pin expanders of one type or another.
@wildbill is absolutely correct. You need to start simple and then go from there.

The best is when the heating pad can just barely reach the highest temperature. Then it is the easiest to control and the temperature changes are minimal. The control can be a on/off control.

The sketch can be very simple. Check the temperature and turn the heater on or off with a little hysteresis. I have done a project like that, and I thought it was not good enough, but the temperature was stable.

If the heating pad is oversized, and the power supply has a higher voltage, then a PWM control might be required. Try to avoid that situation.

@sporozo, a small warning: all those cheap DS18B20 are probably fake. The cheap "waterproof" versions can be submersed for a day or a week, but they will fail. It is good to start with and to test the setup, but not good enough for the final project.

Thanks for your reply.
Freshwater protists will be in the microcosms, and preliminary experiments do not reveal that stainless steal affect the communities in there.
I see those sensors as available and in stock on amazon uk.
I have not understood what you mean by using math and putting the devices close together.
Thanks for the tips on the MOSFET, I agree this is probably the way to go, as those heating pads can vary one from another, controlling each of them individuallly appears necessary.

Thank you @wildbill . Sending back data to a PC would be great, but then if using multiple arduino I guess all of them could be connected to the same PC right through a multi-usb hub right?

Regarding the power supply for such heating pads, I guess the voltage provided by the PC through USB to the arduino is not enough right?

Thank you for the tips on MOSFET. I guess this may be the solution, especially as such heating pad can vary in temperature from one another. Therefore it appears necessary to me to control each of them with a MOSFET and monitoring each of them with a sensor to ensure that they all heat the microcosms as required.

Thank @er_name_not_found . I think the timing is not critical, but the accuracy of the temperature is. Currently we're using heating pads plugged in directly into wall sockets, but while being the same heating pads, they actually vary in temperature (up to 5°C difference!), so the need to control and monitor each of them with a sensor, through an arduino.

I'm interesting to learn more about the set up you have in mind using a simple controller which controls one by one each of the sensor/pad pairs right?

Nowhere near. 5V at half an Amp is 2.5W, less what the Arduino is consuming, so it couldn't even manage one. That's what Paul was referring to when he said that you will need to calculate your power needs to size the PSU for the project.

Start with what @wildbill said and make a prototype first. When you have that working with code I and others can help you expand it.

Thanks Koepel. Would you mind sharing the sketch of your previous project?
Thanks for the warning regarding those sensors. Are there other ones you would recommend, which can last weeks in freshwater?

Great I'll do that and come back to you. Thanks again @wildbill and @er_name_not_found

1 Like

The sketch is not finished and I don't know why I made certain decisions, so the sketch below is without the unused parts. The way an error from the temperature is handled is not perfect. Replace the 'getDS18B20' function with the DallasTemperature library.

Arduino Uno with mosfet.

const int pinDS18B20 = 8;
const int pinHeater  = 11;   // PWM pin for the heater, but on/off was good enough

unsigned long previousMillisTemp;
const unsigned long intervalTemp = 2000UL;

unsigned long previousMillisHeater;
const unsigned long intervalHeater = 2000UL;       // Every 2 seconds the heater is turned on or off

float temperature = -127.0;         // below -100.0 is used as "not valid"
float setpoint = 29.5;              // The destination temperature

float percentage_heater = 0.0;      // percentage that the heater is on.
const float low_pass_filter = 300.0; // low pass filter for percentage. Higher is slower. 100 is fast, 5000 is slow.

unsigned int error_count = 0;


void setup() 
{
  Serial.begin(9600);

  Serial.println(F( "Heated bucket"));

  pinMode( pinHeater, OUTPUT);


  int error = getDS18B20( &temperature);
  if( error != 0)
  {
    Serial.print(F(" Error "));
    Serial.println( error);
    temperature = -127.0;
  }
  else
  {
    Serial.println( temperature);
  }
}


void loop() 
{
  unsigned long currentMillis = millis();

  // --------------------------------------
  // Get temperature
  // --------------------------------------
  if( currentMillis - previousMillisTemp >= intervalTemp)
  {
    previousMillisTemp = currentMillis;

    int error = getDS18B20( &temperature);
    if( error != 0)
    {
      Serial.print(F(" Error "));
      Serial.println( error);

      if( error_count < 60000U)
      {
        error_count++;
      }
      
      if( error_count > 5)
      {
        // When there are too many consequetive errors, then set it to invalid.
        // Setting it to invalid will stop the heater.
        temperature = -127.0;
      }
    }
    else
    {
      // A valid temperature read ? then the error_count is reset to zero.
      error_count = 0;
      Serial.println( temperature);
    }
  }


  // --------------------------------------
  // Control Heater
  // --------------------------------------
  if( currentMillis - previousMillisHeater >= intervalHeater)
  {
    previousMillisHeater = currentMillis;

    if( temperature < setpoint && temperature > -100.0)     // is temperature valid and below setpoint ?
    {
      digitalWrite( pinHeater, HIGH);
      Serial.println(F( "Heater on"));

      percentage_heater = (1.0 - (1.0/low_pass_filter)) * percentage_heater + ((1.0/low_pass_filter) * 100.0);
    }
    else
    {
      digitalWrite( pinHeater, LOW);
      Serial.println(F( "Heater off"));

      percentage_heater = (1.0 - (1.0/low_pass_filter)) * percentage_heater + ((1.0/low_pass_filter) * 0.0);
    }
    Serial.print(F( "percentage heater = "));
    Serial.println( percentage_heater);
  }
}

Explanation:
Requesting the temperature and controlling the heater is split apart. That makes the sketch easier. Each has their own millis-timer.
Every two seconds the temperature is requested. An error-counter keeps track of errors.
The heater is turned on or off also every two seconds. No hysteresis. Just on or off. The variable percentage_heater tries to calculate the percentage that is heater is on, so I can see how it is doing.

It is possible that the heater is on for two seconds, then off for two seconds, then on for two seconds, and so on. That is fine, no problem.

The most important part is that if something wrong with the temperature sensor, then the heater is off. The heater is weak, I had to isolate the project to get to a high temperature. I have tested my project with the heater always on, and it does not reach dangerous temperatures, so it is inherently safe.

There are hundreds of SS formulas. Nickle and chromium may affect your experiments.
By math, I mean ADD the current needed by each heating pad. Sum plus a bit is what your PSU must supply.

The link you gave originally said the were no longer available.
Paul

It sounds plausible, but I've never tried it. If it does work they'll each show up as a separate com port so you'll need multiple terminal programs on the PC to capture all of it.

Thank you all for all these tips and help.
One question while I set up a trial with only a few mats: after I made the calculation of the necessary energy power to run all the heaters, how do I provide this through the arduino?

You don't :wink:

The Arduino can control the power, but it can't provide it directly. That's what the various suggested mechanisms suggested above (relays etc.) are for. They will let you switch power on and off for each pad but the actual power will come from another supply. Perhaps a PC power supply would be suitable.

Use 5V relays to provide power. The type of relay depends on the power requirements of the heater, be sure they match. The Arduino will switch the relay and let the power go to your heater.
This is the easiest way.
Ask about specific models before ordering if you are unsure.