Arduino NTC Thermistor Thermometer: Wiring, Code and Simulator

To build this Arduino NTC Thermistor Thermometer project you need an Arduino Uno and a 10 kΩ resistor and a 10k NTC thermistor. A 10 kΩ NTC thermistor under a 10 kΩ resistor; the sketch turns the A1 reading back into °C with the beta equation. Make the 4 connections in the wiring table, upload the Arduino C++ code, and move the Temperature slider on the thermistor and compare with the printed value: the maths recovers it.

Open this circuit in the free Arduino Uno simulator

Parts list

QtyPartWhat it does
1Arduino Unothe microcontroller board
110 kΩ resistorLimits current. 220 Ω in series with an LED; 10 kΩ as a pull-up or pull-down.
110k NTC thermistorA 10 kΩ (at 25 °C) NTC thermistor, β = 3950: warmer means lower resistance. In a divider with a 10 kΩ resistor, the Steinhart–Hart / β equation turns the reading back into °C.

Wiring

#FromTo
1Arduino Uno 5V10 kΩ resistor leg 1
210 kΩ resistor leg 210k NTC thermistor 1
3Arduino Uno GND10k NTC thermistor 2
4Arduino Uno A110 kΩ resistor leg 2

Step by step

  1. Open the simulator. Open the BitForBytes Embedded Lab in your browser and start from the Arduino Uno. No install or account is needed.
  2. Add the parts. Add a 10 kΩ resistor and a 10k NTC thermistor from the parts palette.
  3. Wire 1. Connect Arduino Uno 5V to 10 kΩ resistor leg 1.
  4. Wire 2. Connect 10 kΩ resistor leg 2 to 10k NTC thermistor 1.
  5. Wire 3. Connect Arduino Uno GND to 10k NTC thermistor 2.
  6. Wire 4. Connect Arduino Uno A1 to 10 kΩ resistor leg 2.
  7. Paste the Arduino C++ code. Paste the Arduino C++ code below into the code editor.
  8. Run it. Press Run. Move the Temperature slider on the thermistor and compare with the printed value: the maths recovers it.

Arduino C++ code

// Thermometer: a 10 kOhm NTC thermistor in a voltage divider, turned back
// into degrees with the beta equation.
//   5V -- 10 kOhm --+-- NTC -- GND
//                   '-- A1
const float R_FIXED = 10000.0;   // the divider's top resistor
const float R0 = 10000.0;        // thermistor resistance at 25 C
const float BETA = 3950.0;

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

void loop() {
  int raw = analogRead(A1);
  float rNtc = R_FIXED * raw / (1023.0 - raw);          // from the divider
  float kelvin = 1.0 / (1.0 / 298.15 + log(rNtc / R0) / BETA);
  float celsius = kelvin - 273.15;
  Serial.print("R = ");
  Serial.print(rNtc, 0);
  Serial.print(" ohm  T = ");
  Serial.print(celsius, 1);
  Serial.println(" C");
  delay(500);
}

What to try

Move the Temperature slider on the thermistor and compare with the printed value: the maths recovers it.

Frequently asked questions

How do I wire the NTC Thermistor Thermometer project on an Arduino Uno?

Make 4 connections: Arduino Uno 5V to 10 kΩ resistor leg 1; 10 kΩ resistor leg 2 to 10k NTC thermistor 1; Arduino Uno GND to 10k NTC thermistor 2; Arduino Uno A1 to 10 kΩ resistor leg 2.

What parts do I need for this Arduino project?

An Arduino Uno and a 10 kΩ resistor and a 10k NTC thermistor.

Can I simulate this Arduino project online for free?

Yes. The BitForBytes Embedded Lab runs this exact circuit and Arduino C++ code in your browser for free, with no install and no hardware. The sketch is compiled with the real Arduino toolchain and runs on an emulated ATmega328P.

What does the code do?

A 10 kΩ NTC thermistor under a 10 kΩ resistor; the sketch turns the A1 reading back into °C with the beta equation.

More Arduino Uno projects