Arduino Example Snippet
#define THERM_PIN 4 //adjust as needed
#define SERIES_R 10000.0
#define NOMINAL_R 10000.0
#define NOMINAL_T 25.0
#define B_COEFF 3950.0
void setup() {
Serial.begin(115200);
}
void loop() {
int raw = analogRead(THERM_PIN);
float voltage = raw / 4095.0;
float resistance = SERIES_R * (voltage / (1.0 - voltage));
float tempK = 1.0 / ((1.0 / (NOMINAL_T + 273.15)) +
(1.0 / B_COEFF) * log(resistance / NOMINAL_R));
float tempC = tempK - 273.15;
Serial.printf("Temp: %.1f C\n", tempC);
delay(1000);
}