0% found this document useful (0 votes)
13 views17 pages

Experiment 4 Thermistor

exp4

Uploaded by

23eg104d61
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views17 pages

Experiment 4 Thermistor

exp4

Uploaded by

23eg104d61
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Experiment 4 :

Thermistor Interface with Arduino


Thermistor
▪ The word “Thermistor” is a combination of the words “Thermal” and “resistor“. A
thermistor is a type of resistor whose resistance changes with the change in
temperature.
▪ It is a passive component that does not require an extra power source to operate.
▪ They are inexpensive and easy accessible.

There are two types of thermistors:

1. PTC (Positive Temperature Coefficient) Thermistor

2. NTC (Negative Temperature Coefficient) Thermistor

2
POSITIVE TEMPERATURE COEFFICIENT (PTC)THERMISTOR

▪ PTC or Positive Temperature Coefficient thermistor resistance is directly proportional


to the surrounding temperature.

▪ Its resistance increases with an increase


in the temperature and decreases with a
decrease in the temperature.

3
NEGATIVE TEMPERATURE COEFFICIENT (NTC)THERMISTOR

▪ NTC or Negative temperature coefficient


thermistor has a negative coefficient k.
therefore, its resistance varies inversely
with the temperature.

▪ The resistance decreases with an


increase in temperature and vice versa

4
Thermistor

5
● In experiment 1, 2 & 3, we have learned
1. How to use pinMode command
2. How to use digitalWrite command
3. How to declare variables using int, define
4. How to use digitalRead command
5. How to do serial communication
6. How to use analogWrite command
7. How to use analogRead command

● In experiment 4, we are going to learn


1. How to use mathematical formulae
2. How to use If, elseif, for loop statements.
3. How to declare variables using float

6
Aim
● The main objective of this experiment is

1. To interface thermistor with Arduino UNO, to read


thermistor data and print on the Serial Monitor.

2. To turn on LED if temperature is more than 30 oC.

3. To turn off both LED1, LED2 if temperature is less


than 85 oF, to turn on LED1 if temperature is between
85 oF to 95 oF, and to turn on both LED1, LED2 if
temperature is more than 95 oF.

7
Circuit Connections: Objective 4(a)

8
Value Convertions

9
Value Convertions
𝟏
Steinhart–Hart Equation = C1 + C2 𝐥𝐧 𝐑𝟐 + C3 (𝐥𝐧 𝐑𝟐)𝟑
𝐓
where
T is the temperature (in kelvins),

R2 is the resistance at T (in Ω),

C1, C2, C3 are Steinhart–Hart coefficients, which vary depending on the type and model of thermistor and the
temperature range of interest.

Kelvin to Celsius Temperature Convertion 𝐓 𝐨𝑪 =𝑻 𝐨𝑲 − 273.15

𝐨𝑭 𝐨𝑪
𝟗
Celsius to Fahrenheit Temperature Convertion 𝐓 = 𝑻 ∗ + 32
𝟓
10
Program: Objective 4(a)
Serial.print("Resistance: ");
float Vo = 0;
Serial.print(R2);
float R1 = 10000;
Serial.println(" Ohms");
float R2, T_Kelvin, T_Celsius, T_Fahrenheit;
float c1 = 1.009249522e-03; Serial.print("Temperature: ");
Serial.print(T_Kelvin);
float c2 = 2.378405444e-04;
Serial.println(" Kelvin");
float c3 = 2.019202697e-07;
Serial.print("Temperature: ");
void setup()
Serial.print(T_Celsius);
{
Serial.println(" Celsius");
Serial.begin(9600);
Serial.print("Temperature: ");
}
Serial.print(T_Fahrenheit);
void loop()
Serial.println(" Fahrenheit");
{
delay(2000);
Vo = analogRead(A1);
}
R2 = R1 * ((1023.0 / Vo) - 1.0);
T_Kelvin=(1.0/(c1+c2*log(R2)+c3*log(R2)*log(R2)*log(R2)));
T_Celsius = T_Kelvin - 273.15;
T_Fahrenheit = (T_Celsius * 9.0)/ 5.0 + 32.0;

11
Circuit Connections: Objective 4(b)

12
Objective 2 Serial.print("Resistance: ");
float Vo = 0; Serial.print(R2);
float R1 = 10000; Serial.println(" Ohms");
float R2, T_Kelvin, T_Celsius, T_Fahrenheit; Serial.print("Temperature: ");
float c1 = 1.009249522e-03;
Serial.print(T_Kelvin);
Serial.println(" Kelvin");
float c2 = 2.378405444e-04;
Serial.print("Temperature: ");
float c3 = 2.019202697e-07; Serial.print(T_Celsius);
void setup() Serial.println(" Celsius");
{ Serial.print("Temperature: ");
Serial.begin(9600); Serial.print(T_Fahrenheit);
pinMode(13,OUTPUT); Serial.println(" Fahrenheit");
} if (T_Celsius>=30)
void loop()
{
digitalWrite(13,HIGH);
{
delay(1000);
Vo = analogRead(A1); }
R2 = R1 * ((1023.0 / Vo) - 1.0); delay(1000);
T_Kelvin = (1.0/(c1+c2*log(R2)+c3*log(R2)*log(R2)*log(R2))); }
T_Celsius = T_Kelvin - 273.15;
T_Fahrenheit = (T_Celsius * 9.0)/ 5.0 + 32.0;
Circuit Connections: Objective 4(c)

14
V0=analogRead(A0);
float V0=0; RT = R1*((1023.0/V0) -1.0);
float R1 = 10000; T_Kelvin = (1.0/(c1+c2*log(RT)+c3*log(RT)*log(RT)*log(RT)));
T_Celsius=T_Kelvin-273.15;
float RT; T_Fahrenheit=(T_Celsius*9.0)/5.0+32.0;
float T_Kelvin, T_Celsius;
Serial.print(" Thermal Resistance:");
float T_Fahrenheit; if(T_Fahrenheit<=95) Serial.print(RT);
float c1=1.009249522e-03; { digitalWrite(13,LOW); Serial.println(" Ohms");
digitalWrite(7,LOW);
float c2=2.378405444e-04; Serial.println(" Temparature:");
delay(1000);
float c3=2.019202697e-07; Serial.print(T_Kelvin);
} Serial.println(" kelvin");
void setup() else if(T_Fahrenheit>=95 && T_Fahrenheit<=99)
Serial.print(" Temparature:");
{ { Serial.print(T_Celsius);
digitalWrite(13,HIGH);
Serial.begin(9600); Serial.println(" celsius");
digitalWrite(7,LOW);
pinMode(13,OUTPUT); Serial.print("Temparature:");
delay(1000); Serial.print(T_Fahrenheit);
pinMode(7,OUTPUT); } Serial.println(" Fahrenheit");
} else delay(1000);
{
void loop() }
digitalWrite(13,HIGH);
{ digitalWrite(7,HIGH);
delay(1000);
}
Self Assessment Questions
1. What is a thermistor?

2. How can we convert the analog reading from the thermistor


into temperature values?

3. What is the purpose of the resistor connected in the circuit


with the thermistor?

4. What are some applications of temperature measurement


using a thermistor and Arduino UNO?

16
THANK YOU

Team – Fundamentals of IoT & Sensors

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy