Problem with thermometer ds18b20

Hello sorry for my english I'm from argentina I have a problem with a code.
I'm doing a temperature control for a machine that heats water at a temperature for a while.
The sensor I use is this "ds18b29"

The truth is I do not think it's a sensor problem but my code.

The code follows these steps: enter a temperature-> enter duration-> accept-> start to heat and maintain temperature -> runs the time.

The problem is when, for example, the selected temperature is 90 degrees.
When it reaches the 90, the heater stops acting, but it rises above 100 degrees due to the delay of the sensor (this does not matter to me) BUT if the temperature exceeds 100 the heater output is activated again and not why.

I hope the explanation is clear, I leave the portion of code affected. Greetings thank you very much

while (es == 3){
sensors.requestTemperatures();
tempa = sensors.getTempCByIndex(0);
lcd.setCursor(0,1);
lcd.print(tempa);
lcd.setCursor(5,1);
lcd.print("C");
if (tempa > temp){
    digitalWrite(calentando, LOW);
    digitalWrite(salida, LOW);
    digitalWrite(listo, HIGH);
    lcd.setCursor(0,0);
    lcd.print("Listo!       ");
    ps = keypad.getKey();
    if (ps == 'A'){
      lcd.clear();
      es = 4;
    }
} else {
    lcd.setCursor(0,0);
    lcd.println("Calentando...       ");
    digitalWrite(calentando, HIGH);
    digitalWrite(salida, HIGH);
    digitalWrite(listo, LOW);
}
}

Where "temp" is the selected temperature and "temp" is the temperature of the sensor
Both are declared as String

You have not posted your entire sketch, only a snippet.

Please read this post:

Useful links - check here for reference posts / tutorials

...especially the first part, How to Ask a Good Question.

What does it mean for one String to be greater than another? I doubt that it has anything to do with the numerical value.

KeithRB:
What does it mean for one String to be greater than another? I doubt that it has anything to do with the numerical value.

IIRC, it is the string length.

tomymansilla:
Hello sorry for my english I'm from argentina I have a problem with a code.
I'm doing a temperature control for a machine that heats water at a temperature for a while.
The sensor I use is this "ds18b29"
Https://drive.google.com/drive/folders/0B8i5PxQ5XywyUnRGUHBKVkZlV3M

The truth is I do not think it's a sensor problem but my code.

The code follows these steps: enter a temperature-> enter duration-> accept-> start to heat and maintain temperature -> runs the time.

The problem is when, for example, the selected temperature is 90 degrees.
When it reaches the 90, the heater stops acting, but it rises above 100 degrees due to the delay of the sensor (this does not matter to me) BUT if the temperature exceeds 100 the heater output is activated again and not why.

I hope the explanation is clear, I leave the portion of code affected. Greetings thank you very much

while (es == 3){

sensors.requestTemperatures();
tempa = sensors.getTempCByIndex(0);
lcd.setCursor(0,1);
lcd.print(tempa);
lcd.setCursor(5,1);
lcd.print("C");
if (tempa > temp){
    digitalWrite(calentando, LOW);
    digitalWrite(salida, LOW);
    digitalWrite(listo, HIGH);
    lcd.setCursor(0,0);
    lcd.print("Listo!      ");
    ps = keypad.getKey();
    if (ps == 'A'){
      lcd.clear();
      es = 4;
    }
} else {
    lcd.setCursor(0,0);
    lcd.println("Calentando...      ");
    digitalWrite(calentando, HIGH);
    digitalWrite(salida, HIGH);
    digitalWrite(listo, LOW);
}
}




Where "temp" is the selected temperature and "temp" is the temperature of the sensor
Both are declared as String

Ya code missing , I am using the same sensor , do you have Dallas Tempurature and One Wire going ????