Skip to content
AkerminMeasure. Monitor. Improve. Compare Products
Learning Center

How to Wire a Thermistor to an Arduino

You have a 10k NTC thermistor, an Arduino and a breadboard, and the reading on the serial monitor makes no sense. This shows the correct divider wiring, the arithmetic that turns a raw number into degrees, and how to confirm the result.

Connect the thermistor and a fixed resistor of the same nominal value, usually 10 kilohms for a 10k NTC, in series between the Arduino’s 5 V pin and GND, and run a wire from the junction between them to an analog input such as A0. The Arduino reads a number from 0 to 1023 that depends on the thermistor’s resistance; your sketch converts that number back to resistance with the divider equation and then to temperature with the Beta (or Steinhart-Hart) equation using the thermistor’s datasheet values. Check the result in ice water, which should read close to 0 °C, before trusting it.

Why a thermistor needs a divider

A thermistor is a resistor whose value changes strongly with temperature. An NTC (negative temperature coefficient) type, the common kind for measurement, drops in resistance as it warms. A typical 10k NTC is 10,000 ohms at 25 °C, roughly three times that near freezing, and roughly two thirds of it at body temperature.

The Arduino cannot measure resistance directly. Its analog-to-digital converter (ADC) measures voltage, and on an Uno or Nano it splits the range from 0 V to the reference voltage, 5 V by default, into 1024 steps. A voltage divider turns resistance into voltage: two resistors in series across the supply, with the voltage at the midpoint depending on their ratio. Fix one resistor, let the thermistor be the other, and the midpoint voltage tracks temperature.

If you are still deciding on the sensor, our comparison of thermocouples and thermistors explains why thermistors suit room, water and fridge temperatures with simple electronics, while thermocouples suit high heat.

The wiring, connection by connection

This arrangement puts the thermistor on the ground side, which makes the arithmetic slightly simpler.

From To Notes
Arduino 5V One leg of the 10k fixed resistor Use a 1 percent metal film resistor for accuracy
Other leg of the fixed resistor One leg of the thermistor, and a wire to A0 This junction is the measurement point
Other leg of the thermistor Arduino GND Thermistors are not polarised; either leg works
Optional 0.1 microfarad capacitor Between A0 and GND Smooths noise, especially on long leads
  • Match the fixed resistor to the thermistor’s 25 °C value. That puts the midpoint near half the supply at room temperature, where the reading has the best sensitivity.
  • For a 3.3 V board such as many ESP32 or ARM boards, power the divider from 3.3 V and use that board’s ADC range. Never feed 5 V into a 3.3 V analog pin.
  • For a probe on long wires, twisted pair or shielded cable helps, and the capacitor matters more.

From the analog count to degrees

The sketch does three conversions.

  1. Read the count. analogRead on A0 returns a value from 0 to 1023. Average 10 to 20 readings to reduce noise.
  2. Count to resistance. With the thermistor on the ground side, its resistance is R_fixed times count divided by (1023 minus count). With 10 kilohms fixed and a count of 512, that gives 10,000 times 512 divided by 511, about 10,020 ohms.
  3. Resistance to temperature. The Beta equation says 1/T = 1/T0 + (1/B) times ln(R/R0), with temperatures in kelvin. T0 is 298.15 K (25 °C), R0 is the thermistor’s 25 °C resistance and B is the Beta value from the datasheet, commonly around 3950 for hobby 10k parts, but check yours. Subtract 273.15 from T to get Celsius.

Worked example. The averaged count is 300. Resistance is 10,000 times 300 divided by 723, about 4,149 ohms. R/R0 is 0.4149, and ln(0.4149) is about -0.880. Divided by 3950 that is -0.000223. Add it to 1/298.15, which is 0.003354, giving 0.003131. The inverse is about 319.4 K, or roughly 46 °C. That matches the typical resistance table for a 10k, B 3950 thermistor, which sits a little above 4 kilohms in the mid-40s Celsius.

If you wire the thermistor on the 5 V side instead, the resistance formula flips: R_thermistor = R_fixed times (1023 divided by count, minus 1). A sketch written for one arrangement gives temperatures that go the wrong way on the other, which is the most common reason for readings that fall when you warm the sensor.

The Beta equation is accurate to a fraction of a degree over a moderate range around 25 °C. For wide ranges, the three-coefficient Steinhart-Hart equation, with coefficients from the datasheet or fitted from three known temperatures, is more accurate.

Problems you will probably hit

Symptom Cause Fix
Reading goes down when you heat the sensor Divider orientation does not match the formula Swap the formula or the two components
Count stuck at 0 or 1023 Open or shorted wiring, wrong pin Check continuity; confirm the A pin in code
Readings several degrees off Wrong Beta or R0, 5 percent fixed resistor Use datasheet values and a 1 percent resistor
Jumpy reading Noise on long leads, unstable USB supply Capacitor at A0, averaging, shielded cable
Reads slightly high in still air Self-heating from divider current Higher fixed resistance or power the divider only during reads
Slow to reach final value Thermal mass of the probe Wait, or use a smaller bead

Self-heating is small but real. With 10k plus 10k across 5 V, about 0.25 mA flows and the thermistor dissipates around 0.6 milliwatts at room temperature. A small bare bead in still air can warm by a fraction of a degree from that. Powering the divider from a digital output pin that you switch on only while reading eliminates most of it. Response time is covered in our note on why temperature sensors need time to stabilise.

Checking the build against known temperatures

  1. Ice point. Fill a glass with crushed ice, top up with cold water, stir and wait a couple of minutes. Seal the thermistor in a thin plastic bag or use a waterproof probe, push it into the middle of the slush, and wait for the reading to stop changing. It should be close to 0 °C.
  2. Second point. Compare with a trusted thermometer in a mug of warm water around 40 to 50 °C, stirring both probes together.
  3. Correct the constants. If both points are off by the same amount, add an offset. If the error grows with temperature, adjust the Beta value or fit Steinhart-Hart coefficients using three points.

For anything that protects food, medicine or safety, such as a freezer or incubator alarm, treat the Arduino build as a prototype and confirm it against a calibrated thermometer before relying on it.

Wire one, then test it in ice

Build the divider with a 1 percent 10 kilohm resistor, print the raw count, the calculated resistance and the temperature to the serial monitor, and dip the sealed thermistor in stirred ice water. If it reads within about a degree of zero and rises when you pinch it between your fingers, your wiring and formula agree and you can move on to the rest of the project.

Frequently Asked Questions

What resistor should I use with a 10k thermistor?

A 10 kilohm resistor, ideally 1 percent tolerance. Matching the thermistor's 25 degree value gives the best sensitivity around room temperature. For a range centred elsewhere, choose a fixed resistor close to the thermistor's resistance in the middle of that range.

Where do I find the Beta value for my thermistor?

It is on the datasheet or the seller's listing, often written as B25/50 or B25/85. Hobby 10k parts are often around 3950, but values vary, and using the wrong one gives errors that grow away from 25 degrees.

Can I use the 3.3 V pin on an Uno?

You can, if you also connect 3.3 V to AREF and set the analog reference to external in your sketch. That improves noise performance, but never apply voltage to AREF while the reference is set to the default internal setting.

Do I need a library?

No. The math is a few lines using the log function. Libraries are available and convenient, but they still need the correct resistor value, R0 and Beta for your part.

Is a thermistor accurate enough for a fridge or freezer monitor?

With good constants and a two-point check it can be accurate to within about a degree, which is enough for monitoring. Verify it against a calibrated thermometer before relying on it for food or medicine.