void setup() {
Serial.begin(115200); Serial.println("Temp Project");
}
void loop() {
float thermistor_voltage = analogRead(34) * 3.3/4095;
float thermistor_resistance = thermistor_voltage / (3.3 - thermistor_voltage);
float temp = 1 / (1/298.15 + 1/3950 * log(thermistor_resistance / 10000)) - 273.15;
Serial.println("Temp: " + String(temp) + " C");
}
/*
Resistance value of thermistor changes with temp.
To utilize, calculate resistance of thermistor using basic voltage divider laws. Ratio of voltages (thermistor’s over ref-resistor) times the resistance of the 10000.
Then plug in resistance into Steinhart-Hart equation to calculate Kelvin.
*/