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.