# NTC Temperature Sensor With Arduino

71,258

38

14

## Introduction: NTC Temperature Sensor With Arduino

A thermistor is a type of resistor whose resistance is dependent on temperature end have a electric resistance value for each absolute temperature.

Widely used to control temperature in electronics devices such as alarms, thermometers, "clocks", electronic circuit temperature compensation, heat sinks, air conditioning. There are two basic types of thermistors: a PTC thermistor (Positive Temperature coeficient) which substantially increases its electrical resistance with increased temperature, and the thermistor NTC (Negative Temperature coeficient), which substantially lowers its electrical resistance with increased temperature. The thermistor is not electrically polarized. The most common thermistor in electronics store is the NTC type, so I will be using this for the application.

The major problem NTC thermistor is the calibration, that is, to establish a function between electrical resistance and temperature. The variation in its electrical resistance with temperature is non-linear it may be seen as an exponential function according to equation Steinhart-Hart (wiki).

## Step 1: Explaining the Equation

As the thermistor brings me some information on the data sheet can use the Beta parametter of the Steinhart-Hart equation to get the temperature reading on the sensor.

This can be solved for the temperature:

R (Rout) = read resistance in the sensor
β = defines the temperature differential to calibrate the sensor using the initial temperature and final temperature T1, T2 and their resistances. R∞ = models the exponential function. It seems a little hard, but all the values we need are tabulated only fitting the micro controller to do the calculations and deliver the read temperature. Defining values (temperatures in Celsius C) To calibrate the sensor is used at the temperatures T1 (initial) = 0 ° C, T2 (end) = 100 °, T0 = 25 ° C this and ambient operating temperature, such T1 and T2 temperatures have been set to the environment to be used, since T0 is the thermistor resistance value by default 10Kohm, the RT1 and RT2 of valore are in Datasheat sensor.

## Step 2: Assembly, Test and Arduino Code

The code this commented, but follows some observations

The code shows the value of the temperature in Celsius (C) and Fahrenheit (F) put all the calculations are made with the temperature in Kelvin (K). not being recommended to calculate the value in C or F, so in the beginning of the code I insert the K values

TempK the variable returns the value of the temperature in K shortly after calculating. TempC converts K to C

((* TempC 9) / 5 + 32); this code converts C to F

The LCD panel will not be explained because it was just to show the operation of the sensor, if used the common wiring scheme and code.

I hope you can help those in need, these sensors are extremely cheap and simple connection can be used in various applications, accuracy and estimated at 0.2 °.
This and my first instructables excuse some mistakes. Participated in the
First Time Author Contest 2016

## Recommendations

The thermistor who i bought came it a reference code and your manufactur so i can find your data sheet and get the temperature variables. Whoever if you don't need much precision in your temperatures reading, is possible use the same parameters i use if you have a a 10kohm ntc

Many thanks for your answer, I was able to calibrate the termistor that I used, in my case I used the SB59 NTC.
You explain was great and the equation that you shared, but I have the big doubt about how were you able to get "Beta (β)" equation.
T equation is clear, also Rinf equation but, β nop I can't got it
Wiki shows this:

Thank you so much for sharing! I was having major problems with my thermistor because I didn't have the proper Arduino code that uses the Steinhart-Hart function. Now it shows a much more reasonable temperature! Still needs calibration, but at least it wasn't 400 degrees F in my apartment.

I was trying to replicate this project but i can't seem to find the similar fileds mentioned in the datasheet here (https://www.digikey.com/product-detail/en/murata-electronics-north-america/NXRT15XH103FA5B030/490-16930-ND/7595837)

float T1=273.15; // [K] in datasheet 0º C
float T2=373.15; // [K] in datasheet 100° C
float RT1=35563; // [ohms] resistence in T1
float RT2=549; // [ohms] resistence in T2
float beta=0.0; // initial parameters [K]
float Rinf=0.0; // initial parameters [ohm]
float TempK=0.0; // variable output
float TempC=0.0; // variable output

if the datashit does not come with the calibration table, you have to calibrate manually, on the link I checked that at 25 ° C it has 10k ohm, you need to lower the temperature to 0 ° C and measure the resistance and then rise up to 100 ° 80 °) and measure the resistance, you will have the same basic information in the table, but a little more difficult.