IoTSimulator

NTC Temperature Sensor: How It Works, Wiring, and Example Code

Analog temperature sensor module built around an NTC thermistor for measuring temperature changes.
M
Muhammad Ichsan
NTC Temperature Sensor

This article explains the NTC Temperature Sensor in a practical way: what it measures, how the analog reading works, and how to wire it to Arduino.

NTC sensors are a good fit for room monitors, fan control, and small climate projects because they show a steady temperature trend instead of a jumpy on/off signal.

Before looking at the circuit, it helps to see the module first so the pin side and board shape are easier to recognize.

Description

An NTC sensor uses a thermistor whose resistance goes down when the temperature goes up. That means the module does not give a fixed output. Instead, the voltage at OUT changes as the sensor warms up or cools down.

NTC temperature sensor product view
NTC temperature sensor product view

For beginners, the useful idea is simple: temperature becomes an analog value that the Arduino can read and turn into a decision. That can mean a Celsius estimate, a fan trigger, or a warning when the sensor crosses a set point.

Features

Here are the main things to know about the NTC Temperature Sensor:

FeatureWhat it means
Analog outputThe Arduino reads a smooth voltage change instead of only HIGH or LOW.
NTC thermistorResistance drops as temperature rises, which is the core sensing behavior.
Voltage divider designThe module turns resistance change into a measurable signal.
Simple wiringUsually needs VCC, GND, and OUT.
Calibration friendlyYou can convert the raw reading into Celsius with a formula.
Good for control logicWorks well for fans, alarms, and threshold-based automation.

The main advantage is the continuous reading. The sketch can react early when temperature starts drifting, instead of waiting for a hard threshold to trip.

NTC vs DS18B20 vs DHT

Comparison of NTC, DS18B20, and DHT sensors
Comparison of NTC, DS18B20, and DHT sensors

All three sensors can work in Arduino temperature projects, but they solve different problems.

SensorMeasuresSignalTypical wiringBest for
NTCTemperature onlyAnalog voltage from a resistor dividerVCC, GND, OUTSimple temperature monitoring and fan control
DS18B20Temperature onlyDigital 1-wireVCC, GND, DQ plus pull-up resistorClean digital temperature readings and multi-sensor setups
DHT22Temperature and humidityDigital timed protocolVCC, DATA, NC, GNDWeather stations and room climate projects
  • Pick NTC for the easiest analog temperature reading.
  • Pick DS18B20 for digital temperature and easy multi-sensor wiring.
  • Pick DHT22 for temperature plus humidity in one module.

In short, NTC is the analog choice, DS18B20 is the digital choice, and DHT22 is the one to use when humidity matters too.

How Does It Work?

The sensor uses a thermistor and a resistor as a voltage divider. When temperature changes, the resistance changes, and the voltage on OUT moves with it.

The Arduino reads that voltage with analogRead(). The value is still raw, but it is enough for the sketch to estimate temperature or check a threshold.

How an NTC temperature sensor works
How an NTC temperature sensor works

Voltage Divider Behavior

The divider is the important part. When the thermistor gets warmer, its resistance drops, and the output voltage shifts. That change is what the Arduino measures.

Raw Reading To Temperature

Once the sketch has the raw analog value, it can convert that number into Celsius with the Beta formula or another calibration method. The exact math changes with the thermistor, but the workflow stays the same.

NTC Temperature Sensor Pinout

NTC temperature sensor anatomy and pinout
NTC temperature sensor anatomy and pinout

The module uses a small pin layout: power, ground, and one analog output. That keeps the wiring short and the code easy to follow.

PinMeaningBeginner note
VCCPower supply for the moduleUsually connect to 5V on an Arduino Uno.
GNDGround referenceMust share ground with the Arduino.
OUTAnalog temperature signal to the ArduinoConnect to an analog pin like A0.

The sensor works through a voltage divider. The thermistor and fixed resistor turn temperature into a changing voltage, and the Arduino reads that voltage on OUT. If the divider is wired the wrong way, warmer temperatures can make the reading move backward.

  • VCC powers the module.
  • GND gives the circuit a shared reference.
  • OUT sends the analog value to the Arduino.

Arduino With NTC Temperature Sensor

This circuit preview shows an Arduino Uno connected to the NTC module. The setup only needs one analog input, so it is easy to test right away.

SCL
SDA
AREF
GND.1
D13
D12
D11
D10
D9
D8
D7
D6
D5
D4
D3
D2
D1
D0
IOREF
RESET
3V3
5V
GND.2
GND.3
VIN
A0
A1
A2
A3
A4
A5
GND
VCC
OUT

Pin Connection

The connection table below matches the circuit preview. The Arduino only needs one analog input, so the wiring stays short.

Pin Connection Map
Sensor Pin
VCC
Arduino Pin
5V
Explanation

Provides power to the sensor module.

Sensor Pin
GND
Arduino Pin
GND
Explanation

Shared ground reference for stable readings.

Sensor Pin
OUT
Arduino Pin
A0
Explanation

Feeds the analog temperature signal into Arduino.

Because this is an analog sensor, the reading changes gradually instead of jumping between two states. That makes it useful for smoothing, early fan control, and steady temperature display updates.

Arduino Code

This example reads the raw value from the sensor and converts it into Celsius using the Beta formula. It is a solid starting point for room monitors, fan controllers, and temperature alerts.

C++ Source
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

About analogRead()

The analogRead() function turns the physical voltage into a number the sketch can use. On an Arduino Uno, that number usually ranges from 0 to 1023, so the reading can be compared or converted without extra hardware.

The sketch prints a live temperature estimate every half second. In a real project, that value can switch a fan on, drive an LCD, or feed another part of the system.

How The Code Works, Part By Part

Let's break the sketch into smaller pieces so the flow is easier to understand and easier to change later.

Setup

The setup block starts Serial Monitor and prepares the sketch for temperature reading.

C++ Source
1
2
3
4
5
6
7
8

Read The Sensor

Next, the Arduino reads the analog voltage from OUT. This is the raw value that changes as the thermistor gets warmer or cooler.

C++ Source
1

Convert To Celsius

This part turns the raw analog reading into a temperature estimate. The formula uses the Beta coefficient, which is a common way to approximate an NTC thermistor curve.

C++ Source
1

Output And Repeat

Finally, the sketch prints the result and waits before reading again. That pause keeps the output easy to follow while still giving you a live update.

C++ Source
1
2
3
4
5

Wrapping Up

The NTC Temperature Sensor is a useful way to bring temperature into an Arduino project. Once you understand the voltage divider and the analog reading, it is easy to reuse in different builds.

It is a strong beginner sensor because it shows the full path from physical heat to a usable number in code.

A good next step is to pair it with a fan, a warning LED, or a display so the reading leads to a visible response.

New

Wait! We're building more...

Our laboratory is currently preparing a lot of exciting new projects using NTC Temperature Sensor. Stay tuned for the upcoming massive update!

Muhammad Ichsanul Fadhil
About Writer

Muhammad Ichsanul Fadhil

"I'm a developer and hardware enthusiast with a passion for IoT. I love experimenting with new components and writing down everything I learn to help others build their own projects."

Share this article

Share it with your favorite channel.