fixed?
#include <math.h>
int RelayHOT = 4;
double Thermister(int RawADC)
{
double Temp;
Temp = log(((10240000/RawADC) - 10000));
Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );
Temp = Temp - 273.15; // Convert Kelvin to Celcius
return Temp;
}
void setup()
{
Serial.begin(115200);
pinMode(RelayHOT, OUTPUT);
}
void loop()
{
float Temp = Thermister(analogRead(0));
Serial.println(Temp,2); // print Celcius temp with 2 decimals reading in serial monitor
if (Temp < 27.5) digitalWrite(RelayHOT, HIGH); //if the temperature is less than 27.5 C, turn on the relay which will turn on the light and increase temperature
else if (Temp > 28.5) digitalWrite(RelayHOT, LOW); //if the temperature is greater than 28.5 C, turn the bulb off because it is hot enough
delay(5000); // wait 5 seconds before sampling temperature again - WHY?
}