Experiment 4 Thermistor
Experiment 4 Thermistor
2
POSITIVE TEMPERATURE COEFFICIENT (PTC)THERMISTOR
3
NEGATIVE TEMPERATURE COEFFICIENT (NTC)THERMISTOR
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
6
Aim
● The main objective of this experiment is
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),
C1, C2, C3 are Steinhart–Hart coefficients, which vary depending on the type and model of thermistor and the
temperature range of interest.
𝐨𝑭 𝐨𝑪
𝟗
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?
16
THANK YOU