Arduino Nano - NTC Thermistor Temperature Sensor
This tutorial instructs you how to use Arduino Nano to measure temperature with a 10K NTC thermistor sealed inside a waterproof stainless-steel probe. There is no chip in the probe and no library to install. The thermistor is a resistor whose value follows the temperature, so the Nano needs only one analog pin, the small 10K resistor that comes in the kit, and a little math. In detail, we will learn:
- How an NTC thermistor works, and why it needs a 10K resistor next to it
- How to connect the two probe wires and the resistor to the 5V, A7 and GND pins of Arduino Nano
- How to program Arduino Nano to turn the analog reading into ohms, then into degrees Celsius and Fahrenheit with the B (beta) formula
- How the sketch notices an unplugged or shorted probe

We suggest:
- Utilizing a waterproof DS18B20 temperature sensor if you would rather get a finished digital value in °C, with no resistor math in the code.
- Utilizing a MAX6675 thermocouple module if you are looking to measure above 105°C, for example inside an oven or a smoker.
Hardware Preparation
Or you can buy the following kits:
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Overview of NTC Thermistor Temperature Sensor

What you hold in your hand is a small stainless-steel tube, 5mm wide and 25mm long, with a round tip. The 10K NTC thermistor is sealed inside it. A black two-wire cable, half a meter long, comes out of the tube and ends in a white JST XH2.54 plug with two holes. There is no circuit board at all. The DIYables kit has five of these probes, plus one matching 10K resistor for each probe.
The steel tube can go into water, a fish tank or a pot of soil. The plug and the far end of the cable cannot, so keep them dry.
| 10K NTC Thermistor Probe | |
|---|---|
| Sensing element | NTC thermistor, 10kΩ at 25°C, ±1% |
| B value (beta) | 3950 |
| Measuring range | -20°C to 105°C |
| Probe tube | waterproof stainless steel, round tip, 5mm x 25mm |
| Cable | 0.5m, two black wires |
| Connector | white JST XH2.54 plug, 2 pins |
| Polarity | none, the two wires can be swapped |
| Output | resistance, read through a voltage divider and an analog pin |
| Heat dissipation constant | typically 5mW/°C |
The plug has two openings. Push a male jumper wire into each one, then:
- Wire 1 (either wire): must be connected to the 5V pin of Arduino Nano
- Wire 2 (the other wire): must be connected to analog pin A7 of Arduino Nano
- 10K resistor from the kit: must be connected between A7 and GND (0V). One leg shares the A7 wire, the other leg goes to GND
※ NOTE THAT:
The two wires carry no labels, and they do not need any. A thermistor is just a resistor, so it has no polarity: swap the wires and the readings stay the same. What does matter is the place of the 10K resistor. It must sit between A7 and GND, because the sketch is written for that order.
How the Probe Senses Heat
Inside the steel tip there is a thermistor: a tiny resistor that is very sensitive to heat. NTC stands for Negative Temperature Coefficient: the warmer the tip, the lower the resistance. At 25°C this probe measures 10,000 ohms. In ice water it climbs above 30,000 ohms, and in hot water it falls to a few thousand.
The Nano cannot measure ohms, only voltage. That is why the 10K resistor is there. The thermistor and the resistor sit in series between 5V and GND, and they share the 5V between them like a seesaw. When the probe warms up, its resistance drops, so the voltage at their meeting point, A7, goes up. The sketch reads that voltage, works out the resistance of the thermistor, and then turns the resistance into degrees.
A few points along the curve, with the wiring of this tutorial:
| Temperature | Thermistor resistance | Voltage on A7 | analogRead() value |
|---|---|---|---|
| 0°C | about 33.6kΩ | 1.15V | about 235 |
| 15°C | about 15.8kΩ | 1.94V | about 396 |
| 25°C | 10kΩ | 2.50V | about 512 |
| 40°C | about 5.3kΩ | 3.27V | about 669 |
| 70°C | about 1.76kΩ | 4.25V | about 870 |
The Beta Formula
The curve is not a straight line, so a simple "divide by 10" does not work here. The usual formula for an NTC thermistor is the B-parameter (beta) equation:
1/T = 1/T0 + (1/B) × ln(R/R0)
- T is the temperature you want, in kelvin
- T0 = 298.15 K, which is 25°C, the temperature at which the probe has its rated value
- R is the resistance just measured, and R0 = 10000Ω is the rated value
- B = 3950, from the specs table
- Ln is the natural logarithm. In Arduino code it is called log()
Take away 273.15 from T and you have degrees Celsius. The Steinhart-Hart equation is a more exact version with three coefficients, but for this probe the B formula is good enough. Near room temperature, expect readings within about 1°C. How close you get depends on the 10K resistor and on the Nano's ADC.
Wiring Diagram
Wire 1 of the probe goes to 5V, wire 2 goes to A7, and the 10K resistor links A7 to GND. We use A7 because it is close to GND on the Nano. Only 5V and RST sit between them, so the resistor fits straight across on a breadboard:
- Plug the Nano across the middle gap of the breadboard, with its USB socket to the left. The row with A0 to A7, 5V and GND is now the lower row.
- Push the 10K resistor into row H. One leg goes in the A7 column. The other leg goes in the GND column, three columns to the right. The resistor jumps over the 5V and RST columns and does not touch them.
- Run a yellow jumper wire from row J of the A7 column to one hole of the white probe plug.
- Run a red jumper wire from row J of the 5V column, right next to A7, to the other hole of the plug.
Every hole holds only one wire or one leg. No GND wire is needed, because the resistor leg sits in the GND column itself.

This image is created using Fritzing. Click to enlarge image
Here is the same wiring without a breadboard, with the 10K resistor joined between the A7 wire and a GND wire:

This image is created using Fritzing. Click to enlarge image
| NTC Thermistor Probe | Arduino Nano Pin |
|---|---|
| Probe wire 1 (either one) | 5V |
| Probe wire 2 | A7 |
| 10K resistor, first leg | A7 (together with probe wire 2) |
| 10K resistor, second leg | GND |
Loose wires are a common cause of strange bugs. In this case, use a Screw Terminal Expansion Board for Arduino Nano. The Arduino Nano plugs into it, and each pin gets a screw terminal. The diagram below shows the same wiring with the screw terminal board.

This image is created using Fritzing. Click to enlarge image
See The best way to supply power to the Arduino Nano and other components.
On the terminal board, the 10K resistor needs no wire of its own: one leg goes into a GND terminal, the other shares the A7 terminal with the probe wire. The probe's 5V wire uses the 5V terminal between them, so tighten that wire first, then lay the resistor over it.
※ NOTE THAT:
Why 5V and not 3V3? The analog pins of the Nano compare every reading against 5V. When the probe runs from that same 5V, the code only needs the ratio between the reading and 1023, so a USB port that gives 4.8V or 5.1V makes no difference. Power the probe from the 3V3 pin instead, and every temperature the sketch prints will be wrong.
How To Program For NTC Thermistor
No library is needed. The math lives in the sketch, and log() is built into Arduino.
- The first step is to specify the Arduino Nano pin that is connected to the thermistor and the 10K resistor:
- Write down the numbers from the specs table as constants:
- Read A7 ten times with analogRead() and take the average. The 10-bit converter of the Nano returns a number from 0 to 1023:
- Turn the reading into the resistance of the thermistor. The probe is fed from 5V, so the voltage itself is not needed, only the ratio:
- Put the resistance into the B formula, then convert kelvin to Celsius and Fahrenheit:
Arduino Nano Code for NTC Thermistor Temperature Sensor
The full sketch below runs all of these steps about once per second. Before the math, it also checks the averaged reading. A value close to 0 means the probe is not plugged in, because the 10K resistor then pulls A7 down to GND. A value close to 1023 means a short or a missing resistor. In both cases the sketch prints a hint instead of a strange temperature.
Detailed Instructions
- If this is the first time you use Arduino Nano, see how to set up the environment for Arduino Nano in Arduino IDE.
- Wire the components as shown in the diagram.
- Connect the Arduino Nano board to your computer using a USB cable.
- Open Arduino IDE on your computer.
- Pick Arduino Nano as the board, then the COM port it shows up on.
- Copy the sketch above and paste it into Arduino IDE.
- Press Upload and wait until the IDE says the upload is done.
- Open the Serial Monitor and set the speed to 9600 baud.
- Let the probe lie on the desk for a few lines. Then fill a mug with warm tap water and drop the steel tip into it. Keep the plug and the resistor out of the water.
- The temperature starts at room level and climbs for several seconds, until the steel tip matches the water:
The reading does not jump to the water temperature at once. The steel tube needs a few seconds to warm through, so wait until two or three lines in a row agree before you trust the number. For a quick test of your build, stir the probe in a glass of ice water: after about half a minute it should show close to 0°C.
If the Serial Monitor prints "Probe not found", one of the jumper wires has slipped out of the white plug. If it prints "Reading too high", look at the 10K resistor between A7 and GND.
Additional Knowledge
NTC Thermistor vs DS18B20 vs LM35
| 10K NTC Thermistor Probe | DS18B20 Waterproof Probe | LM35 | |
|---|---|---|---|
| Kind of signal | analog, a changing resistance | digital, 1-Wire bus | analog, 10mV per °C |
| Extra part needed | 10K resistor (in the kit) | 4.7K pull-up resistor | none |
| Library | none, only log() math | OneWire and DallasTemperature | none |
| Range | -20°C to 105°C | -55°C to 125°C | 2°C to 150°C (basic wiring) |
| Waterproof | yes, steel probe | yes, steel probe | no, bare TO-92 part |
| Time for one reading | a few milliseconds | up to 750ms at 12-bit | a few milliseconds |
| Many sensors on one pin | no, one analog pin each | yes, each one has its own address | no, one analog pin each |
It is evident that the NTC thermistor is the simplest way to put a waterproof probe on a Nano: two wires, one resistor and no library. The DS18B20 is the better pick when you want a factory-calibrated digital value or many probes on one wire. The LM35 suits a sensor mounted on the board itself, where nothing has to go into water.
Using More Than One Probe
The kit holds five probes and five resistors, and the Nano has eight analog inputs, A0 to A7. The first probe already uses A7. Each extra probe gets its own resistor and its own free pin: wire 1 to 5V, wire 2 to A0 (or A1, A2 and so on, up to A6), and a 10K resistor from that pin to GND. In the sketch, repeat the reading and the math for each pin. A4 and A5 are also the I2C pins of the Nano, so leave them free if you plan to add an LCD or OLED later.
Project Ideas
- A freezer alarm that sounds a buzzer when the inside climbs above -12°C
- An aquarium monitor that shows the water temperature on an LCD
- A fermentation helper for home brewing that switches a heating pad with a relay to keep the brew between 18°C and 22°C
- A two-probe logger that compares the water going into and coming out of a solar water heater