const float BETA = 3950; // should match the Beta Coefficient of the thermistor
void setup() {
Serial.begin(9600);
}
void loop() {
int analogValue = analogRead(A0); /*Reads the value from the specified analog pin.
In this case, the analog pin A0 is connected to the temperature sensor */
float celsius = 1 / (log(1 / (1023. / analogValue - 1)) / BETA + 1.0 / 298.15) - 273.15;
//converts the analog value to a celsius value
Serial.print("Temperature: ");
Serial.print(celsius); //prints the celsius value
Serial.println(" ℃");
delay(1000);
}