Introduction: NTC Temperature Sensor With Arduino

Picture of 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

Picture of 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

Picture of 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, English is not the native language. Any questions leave a message and reply as soon as possible

Comments

Teymur Mehtiyev (author)2017-10-12

hi, i have problem which is that, code work for ptc not ntc, how can i solve this ? by the way i am not using lcd , i want to see in serial monitor. please help me/

CristiS11 (author)2017-06-03

Works perfectly. Thanks for sharing.

earlvanze (author)2017-02-10

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.

earlvanze (author)earlvanze2017-02-10

My only problem is that the code as is makes the output go DOWN in temperature as I increase the temperature on my thermistor. Not sure why.

earlvanze (author)earlvanze2017-02-10

I swapped RT2 and RT1 so the resistance was higher in T2 than in T1. I should calibrate it but I don't have my multimeter on hand at the moment.

seamster (author)2016-04-19

Great info! Thanks for sharing your first instructable :)

About This Instructable

10,011views

27favorites

License:

Bio: I am a computer engineer specializing in electronics and infrastructure, always seek to acquire and share knowledge about things
More by wellinton31:NTC temperature sensor with arduino
Add instructable to: