// Analog temperature sensor: NTC (negative temperature coefficient) thermistor.
const float BETA = 3950; // should match the Beta Coefficient of the thermistor
int analogPin = A5;
void setup() {
// Для вывода значений в консоль
Serial.begin(9600);
pinMode(analogPin, INPUT);
}
void loop() {
// Читаем аналоговое значение термостата
int analogValue = analogRead(analogPin);
// Перевод в градусы по Цельсию (из документации)
float celsius = 1 / (log(1 / (1023. / analogValue - 1)) / BETA + 1.0 / 298.15) - 273.15;
Serial.print("Temperature: ");
Serial.print(celsius);
Serial.println(" ℃");
delay(2000);
}