/**
ESP32 + NTC analog sensor Example for Wokwi
https://docs.wokwi.com/parts/wokwi-ntc-temperature-sensor
*/
const int NTCPin = 34;
// should match the Beta Coefficient of the thermistor
const float BETA = 3950;
void setup() {
Serial.begin(9600);
}
void loop() {
int analogValue = analogRead(NTCPin);
float celsius = 1 / (log(1 / (4095.0 / analogValue - 1)) / BETA + 1.0 / 298.15) - 273.15;
Serial.print("Temperature: ");
Serial.print(celsius);
Serial.println(" ℃");
delay(1000);
}