// the value of the 'other' resistor #define SERIESRESISTOR 10000 // What pin to connect the sensor to #define THERMISTORPIN A5 void setup(void) { Serial.begin(9600); pinMode(3,OUTPUT); } void loop(void) { float reading; float temperature; reading = analogRead(THERMISTORPIN); // convert the value to resistance temperature = -0.225*reading+231.65; // formula to convert analogue reading to temperature (Deg C) Serial.print("The temperature is "); Serial.print(temperature); Serial.println(" Degrees C"); Serial.println(" "); delay(1000); if(temperature>23) { Serial.println("HIGH TEMP, HEATER IS OFF"); digitalWrite(3,LOW); digitalWrite(LED_BUILTIN, LOW); // turn the LED on (LOW is the voltage level) delay(1000); } else{ Serial.println("LOW TEMP, HEATER IS ON"); digitalWrite(3,HIGH); digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) } }