Arduino NTC Temperature Sensor Module: Wiring, Code and Simulator

To build this Arduino NTC Temperature Sensor Module project you need an Arduino Uno and an NTC temperature sensor module. An NTC thermistor on A0 and the Beta equation turn a reading into degrees Celsius. Make the 3 connections in the wiring table, upload the Arduino C++ code, and change the temperature slider and watch the serial monitor follow it.

Open this circuit in the free Arduino Uno simulator

Parts list

QtyPartWhat it does
1Arduino Unothe microcontroller board
1NTC temperature sensor moduleOUT to an analog pin. °C = 1 / (ln(1 / (1023/reading − 1)) / 3950 + 1/298.15) − 273.15.

Wiring

#FromTo
1Arduino Uno 5VNTC temperature sensor module VCC
2Arduino Uno GNDNTC temperature sensor module GND
3Arduino Uno A0NTC temperature sensor module OUT

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 an NTC temperature sensor module from the parts palette.
  3. Wire 1. Connect Arduino Uno 5V to NTC temperature sensor module VCC.
  4. Wire 2. Connect Arduino Uno GND to NTC temperature sensor module GND.
  5. Wire 3. Connect Arduino Uno A0 to NTC temperature sensor module OUT.
  6. Paste the Arduino C++ code. Paste the Arduino C++ code below into the code editor.
  7. Run it. Press Run. Change the temperature slider and watch the serial monitor follow it.

Arduino C++ code

// Thermometer: an NTC thermistor on A0, converted to degrees Celsius.
const float BETA = 3950;

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

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

What to try

Change the temperature slider and watch the serial monitor follow it.

Frequently asked questions

How do I wire the NTC Temperature Sensor Module project on an Arduino Uno?

Make 3 connections: Arduino Uno 5V to NTC temperature sensor module VCC; Arduino Uno GND to NTC temperature sensor module GND; Arduino Uno A0 to NTC temperature sensor module OUT.

What parts do I need for this Arduino project?

An Arduino Uno and an NTC temperature sensor module.

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?

An NTC thermistor on A0 and the Beta equation turn a reading into degrees Celsius.

More Arduino Uno projects