#define BETA 3950 // Adjust this value to match your thermistor's BETA constant
void setup() {
Serial.begin(9600); // Start serial communication
}
void loop() {
int analogValue = analogRead(A0);
// Calculate temperature in Celsius using BETA formula
float celsius = 1.0 / (log(1.0 / (1023.0 / analogValue - 1.0)) / BETA + 1.0 / 298.15) - 273.15;
// Convert Celsius to Fahrenheit
float fahrenheit = (celsius * 9.0 / 5.0) + 32.0;
// Display both
Serial.print("Temperature: ");
Serial.print(celsius);
Serial.print(" ℃ | ");
Serial.print(fahrenheit);
Serial.println(" ℉");
delay(1000); // Wait 1 second
}