~/nodetwelve.com$
34 notes · 6 topics
updated 2026-11-27

Temperature-controlled heater mats with Arduino

· 2 min read

Project overview

I recently put together a temperature-controlled heater mat controller using an ATmega-based UNO R3 board and a relay module. According to the datasheet, each heater mat is rated at 240 V and 250 W, which works out to about 1.04 A of current.

To switch that load safely, I chose a 5 V / 240 V relay shield module rated for up to 10 A. For this prototype I used a 2-channel module, though the same design can be scaled up to more channels easily.

To measure ambient temperature, I used a DHT11 sensor (which also reports humidity). Its datasheet specifies a 2 second sampling interval, which is plenty fast for heating control.

To show the current temperature and relay state, I added a 1602 LCD display along with a potentiometer wired to pin 3 for adjusting contrast.

Total component cost for a 6-relay build comes to roughly £50, excluding an enclosure. For a permanent installation, you would move this prototype onto a custom PCB.

Wiring schematic

Heater mat controller wiring schematic

Connections overview

Heater mat controller connections overview

Arduino code

The control logic is simple: whenever the ambient temperature drops below 10°C, the relay bank activates and supplies 240 V power to the heater mats.

// 2021 Spawn
// UNO R3
// 240V Heatpad control using DHT11 temperature sensor
// Pin 8 = relay signal

#include <dht.h>
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
dht DHT;

#define DHT11_PIN 7
#define HEAT_PIN 8

void setup() {
  lcd.begin(16, 2);
  pinMode(8, OUTPUT);
}

void loop() {
  int chk = DHT.read11(DHT11_PIN);
  lcd.setCursor(0, 0);
  lcd.print("Temp: ");
  lcd.print(DHT.temperature - 2);
  lcd.print((char)223);
  lcd.print("C");

  lcd.setCursor(0, 1);
  digitalWrite(8, HIGH);
  lcd.print("Heat pads: Off ");

  if (DHT.temperature < 10) {
    lcd.setCursor(0, 1);
    digitalWrite(8, LOW);
    lcd.print("Heat pads: On ");
  } else {
    lcd.setCursor(0, 1);
    digitalWrite(8, HIGH);
    lcd.print("Heat pads: Off ");
  }
  delay(5000);
}

Demonstration

For the video demonstration below, I temporarily modified the code to toggle pin 8 every 5 seconds since it is awkward to test sub-10°C temperatures indoors. The code listing above includes the full temperature threshold logic.