Measure Temperature with Arduino and Thermistor MF52

Introduction

In this Arduino Project, we are going to Measure Temperature with Arduino and Thermistor MF52, Now, you might be wondering, what is a thermistor, and how does it work? Don’t worry; we’ll break it down in easy terms. So, whether you’re a curious hobbyist or someone looking to add some temperature-sensing magic to your projects, let’s embark on this exciting journey and uncover the wonders of measuring temperature with Arduino and the amazing Thermistor MF52.

Hardware Required

You will require the following Hardware Components for interfacing Thermistor MF52 with Arduino.

Components#Buy From Amazon
Arduino UNO1Buy Link
NTC Thermistor (MF52)1Buy Link
Resistor 10KΩ1Buy Link
9v DC Adapter (Optional)1Buy Link
Jumper Wires3Buy Link
Breadboard1Buy Link

What is a Thermistor?

A thermistor is a device whose resistance varies with changing temperature. We can use this resistance variation to make a measurement of the ambient temperature.

A thermistor is made of a semiconductor such as ferric oxide, nickel oxide, or cobalt oxide. As the temperature increases, the concentration of carriers varies, so the resistance of the device varies.

There are two types of thermistors,

  • NTC, have a lower resistance to increasing temperature
  • PTC, have a higher resistance with increasing temperature (also called posistor)

NTC-type thermistors are more common.

Thermistors are cheap, small, durable devices with a relatively wide measurement range, remarkably accurate and fast, and little susceptible to noise. This makes them widely used in temperature measurement in air conditioning, liquid storage, and automotive.

The biggest disadvantage of thermistors is their strong nonlinear behavior. This is not such a problem, since we have well-known mathematical models that allow us to accurately calculate the temperature measurement. However, they force us to necessarily use floating point numbers and logarithmic calculations, which should be avoided on processors as they slow down execution significantly.

How does a thermistor work?

As we have commented, the relationship between temperature and resistance in a thermistor is strongly non-linear. The following graph shows this relationship for a thermistor of the MF52 family and Rnominal 10KΩ.

How-does-NTS-Thermistor-MF52-work

Logically, each thermistor family and model presents a different graph, but the behavior is similar.

There are several mathematical models to approximate the behavior of a thermistor, more or less complex. The Steinhart-Hart model is a third-order approximation, widely used, given by the following equation,

thermistor-work-Formula

If we want to include the correction for self-heating, we can include the following equation to the model.

thermistor-work-Formula-2

With the use of these equations, the error due to the mathematical model is less than 0.005ºC, for the entire range of measurement temperatures (from -30 to 110 ºC). Therefore, it introduces an error that is negligible compared to other factors, such as the tolerance of the resistors, of the thermistor itself, or floating point arithmetic.

Circuit Diagram

The following circuit shows you the connection of How to Measure Temperature with Arduino and Thermistor MF52 Please make the connection carefully

Measure-temperature-with-Arduino-and-thermistor-MF52-Circuit-diagram

Installing Arduino IDE Software

First, you will require to Download the updated version of Arduino IDE Software and Install it on your PC or laptop. if you Learn How to install the Arduino step-by-step guide then click on how to install Arduino Button given Blow

Installing Libraries

Now when you are Ready to upload the code, to the Arduino Board you will need first to add the Following Libraries in Arduino, If you Learn How to add the library in the Arduino step-by-step guide click on how to install the library Button given Blow

Code

//For more Projects: www.arduinocircuit.com
#include <math.h>

const int Rc = 10000; //valor de la resistencia
const int Vcc = 5;
const int SensorPIN = A0;

float A = 1.11492089e-3;
float B = 2.372075385e-4;
float C = 6.954079529e-8;

float K = 2.5; //factor de disipacion en mW/C

void setup()
{
  Serial.begin(9600);
}

void loop() 
{
  float raw = analogRead(SensorPIN);
  float V =  raw / 1024 * Vcc;

  float R = (Rc * V ) / (Vcc - V);
  

  float logR  = log(R);
  float R_th = 1.0 / (A + B * logR + C * logR * logR * logR );

  float kelvin = R_th - V*V/(K * R)*1000;
  float celsius = kelvin - 273.15;

  Serial.print("T = ");
  Serial.print(celsius);
  Serial.print("C\n");
  delay(2500);
}

Applications

  1. Home Automation: Thermistors can be integrated into home automation systems to regulate heating, cooling, and ventilation based on room temperature. Arduino can process the data from the thermistor and trigger HVAC systems to maintain a comfortable environment.
  2. Weather Monitoring: Arduino, along with a thermistor, can be utilized to create a weather monitoring station. By strategically placing thermistors in outdoor locations, you can collect temperature data and track weather patterns with real-time updates.
  3. Industrial Temperature Control: In industrial settings, precise temperature control is crucial for optimizing production processes and ensuring product quality. Using Arduino and thermistors, industrial equipment can be monitored and regulated for optimal performance.

Leave a Comment


error: