ArduinoArduino UnoExact chip

Thermometer (NTC)

An NTC thermistor on A0, turned into °C. Watch it in the Plotter.

Thermometer (NTC) in Argynix Lab

The code

sketch.inoC++
// An NTC thermistor module (10 kΩ, β 3950) on A0, turned into degrees Celsius.
// Select the sensor to change the temperature; open the Plotter to watch it.

const float BETA = 3950;

void setup() {
  Serial.begin(9600);
}

void loop() {
  int a = analogRead(A0);
  float celsius = 1 / (log(1 / (1023.0 / a - 1)) / BETA + 1.0 / 298.15) - 273.15;
  Serial.print("celsius:");
  Serial.println(celsius, 1);
  delay(500);
}