cabinet thermometer monitor - Max temp after Min Temp

Hi. I'm trying to build a refrigeration cabinet thermometer monitor but i stuck in the max temperature value.

In refrigeration, the highest temperature is obtained only after the minimum temperature is reached. Ex: The reading process start in +19ºC into it reaches to -23ºC. At this point the cabinet stop working and the temperature rises into -17ºC, when it starts working again to get colder. The working temperature that i want to show in LCD is -23ºC : -17ºC, and not -23ºC : 19ºC.

Is there a way to get/show this data in Arduino LCD?

Thanks in advance

Just takes software. What have you tried and what does it do?


I have no idea how to get the data i want. There is any variable in the code do give the required information.

This is my code at this time.

#include <math.h>
#include <LiquidCrystal.h>

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

int led = 13;
int ThermistorPin = 0;
int Vo;
float R1 = 10000;
float logR2, R2, T, Tc;
float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07;

float minT = 999;
float maxT = -999;

void setup()
  lcd.begin(16, 2);
  pinMode(led, OUTPUT);

void loop()

 //Temperature Calculation
  Vo = analogRead(ThermistorPin);
  R2 = R1 * (1023.0 / (float)Vo - 1.0);
  logR2 = log(R2);
  T = (1.0 / (c1 + c2*logR2 + c3*logR2*logR2*logR2));
  Tc = T - 273.15;

  // determine min & max
  if (Tc < minT) minT = Tc;
  if (Tc > maxT) maxT = Tc;

//LCD Line 1
  lcd.setCursor(1, 0);
  lcd.print("Temp = ");

//LCD Line 2

lcd.setCursor(0, 1);
  lcd.print("L ");

lcd.setCursor(9, 1);
  lcd.print("H ");

 // Turn on LED
  if (Tc > -25) digitalWrite(led, HIGH);
  if (Tc < -25) digitalWrite(led, LOW);


The reading process start in +19ºC into it reaches to -23ºC.

don’t understand what you mean by the “reading process start”.

looks like your code unconditionally reads the sensor, translates its value to degC and displays it on the LCD. i see no references to 19 or -23 deg C

The working temperature that i want to show in LCD is -23ºC : -17ºC, and not -23ºC : 19ºC.

what do you mean by “-23ºC : -17ºC”?

based on your code, not sure what the problem is. looks like it displays the temperature and attempts to maintain -25 degC

however, it looks like you expect the refrigerator to cycle on and off very frequently and wonder if that cause the compressor to shut down

might be better to add some hystereses.

#define TargetTemp  -23
#define Delta        1

    if (Tc > (TargetTemp + Delta)
        // turn on
    else if (Tc < (TargetTemp - Delta)
        // turn off

Hi. What i need is to register the maxium temperature reached only after reach the minimum temperature.

The maxium temperature is registered only after the lowest one.

Try this:

  // determine min & max
  if (Tc < minT)
    minT = Tc;
    maxT = Tc;
  if (Tc > maxT)
    maxT = Tc;

wildbill... It works like a charm. A simple code solution but my brain was too damaged to achieve. Thanks a lot everyone, specially to wildbill.