Arduino Overheat protection circuit using NTC thermistor

An overheat protection is used to prevent the self-destruction of devices due to excess heating resulting from prolonged use, overloading, cooling mechanism failure, other equipment issues, etc. This circuit shows a simple method of overheating protection by temperature measuring using an NTC thermistor along with visual indications.

Refer: Arduino temperature reading using an NTC thermistor; the article has a brief description about measuring ambient temperature using an NTC thermistor module and also with a standalone NTC thermistor sensor. The standalone thermistors are more convenient than the module type for practical applications like placing or mounting the thermistor over the body of devices, coil windings, transformers, etc.

In the circuit, the output at pin 3 is given to a relay module, so any source AC or DC of any rating can be used to supply the load, it just needs to select the relay of the required rating. Refer: Relay module interface with Arduino.

The circuit has 3 LEDs for indication purposes, each LED indicates the status of the device temperature.

Green LED – Temperature is normal.

Orange LED – Indicates temperature crossed the warning point.

Red LED – Indicates temperature exceeded the limit and the output is turned OFF.

Along with the LED, sirens or other indications methods can be also used for alerting.


const int Green_nml_LED = 6, Orange_warn_LED = 5, Red_max_LED = 4;
const int output = 3, on_switch = 2;
int Ro = 50, B =  3950, Rseries = 10;
float To = 298.15;
int warning_temperature = 34, maximum_temperature = 38;
String overheat_ind = "reset";

void setup() {
  pinMode(output, OUTPUT);
  pinMode(Green_nml_LED, OUTPUT);
  pinMode(Orange_warn_LED, OUTPUT);
  pinMode(Red_max_LED, OUTPUT);
  pinMode(on_switch, INPUT);

void loop() {
  float Vi = analogRead(A0) * (5.0 / 1023.0);
  float R = (Vi * Rseries) / (5 - Vi);
  float T =  1 / ((1 / To) + ((log(R / Ro)) / B));
  float Tc = T - 273.15; // Temperature in celsius
  if (digitalRead(on_switch) == HIGH) {
    digitalWrite(output, HIGH);
    overheat_ind = "reset";
  if (Tc >= maximum_temperature) {
    digitalWrite(Red_max_LED, HIGH);     //Red LED ON
    digitalWrite(Orange_warn_LED, LOW);  //Orange LED OFF
    digitalWrite(output, LOW);           //Output OFF
    overheat_ind = "set";
  } else if (Tc >= warning_temperature && overheat_ind == "reset") {
    digitalWrite(Orange_warn_LED, HIGH); //Orange LED ON
    digitalWrite(Green_nml_LED, LOW);    //Green LED OFF
  } else if (Tc < warning_temperature) {
    digitalWrite(Green_nml_LED, HIGH);   //Green LED ON
    digitalWrite(Orange_warn_LED, LOW);  //Orange LED OFF
    digitalWrite(Red_max_LED, LOW);      //Red LED OFF


If the Green LED is ON it indicates that the temperature is in a normal state. The output has to be turned ON manually by pressing the push switch connected to pin 2.

The Green LED will turn OFF when the temperature reaches the warning temperature and the orange LED will turn ON. The output will remain ON and even now the output can be turned ON if it is in the OFF position. Any possible actions can be done at this time to bring down or stop the further rising of the temperature. If the temperature again rises and reaches the maximum limit, then the RED LED turns ON indicating over-temperature, and simultaneously the Output will be turned OFF forcefully.

These indications and operation patterns are as per the above code, any setting as per the requirement can be easily done by simple modifications in the code.

For Example – 1:-

In the code, once the output is turned OFF, an attempt to turn ON again( by pressing the push switch at pin 2) can be done at any time. If the temperature is above or equal to maximum then it will turn OFF instantly or remain ON even in the warning range.

If the load has to be turned ON again only when the temperature reaches the normal temperature range, where the green LED indicator will turn ON, replace the “if condition” to “switch ON” with the below lines.

if (digitalRead(on_switch) == HIGH && Tc < warning_temperature) {

digitalWrite(output, HIGH);

overheat_ind = "reset";  }

Example – 2:-

The code has a String called “overheat_ind” which has value by default as “reset”, and it will be changed to “set” once the temperature exceeds the limit. This is to prevent the warning indication from turning ON while the temperature is decreasing from high to normal, so the orange warning LED will be turned ON only when the temperature rises from the normal or low level.

Remove the String from the “if condition” if the warning LED needs to be turned ON always when the temperature is in that limit, including when the temperature is decreasing after reaching the maximum limit.

Leave a Reply

Your email address will not be published. Required fields are marked *