Eee-305 Temperature Box Report

Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

Department of Electrical and Electronic Engineering

EEE 305: ASSIGNMENT 1


CONTROL SYSTEM PROJECT: CONTROLLER DESIGN

Report on:
THE TEMPERATURE BOX
An introductory Control System

Submitted by:
Kasshaf Ahmad
ID: 18121082
EEE 305
Section: 02

Submitted to:
Dr. A.K.M Abdul Malek Azad
Professor
Department of Electrical and Electronics
Engineering, BRAC University, Dhaka,
Bangladesh.
Abstract:
In this paper, the “Temperature Box” experiment is presented. This experiment involves the
design and implementation of a feedback temperature control system. At the BRAC University,
the Temperature Box is used to motivate the material in an introductory system engineering
course.

Objective:
The main objective of this experiment is to construct a closed loop control system that regulates
the temperature inside a box. Comparator compress to feedback to the pre-defined temperature
level and gives output accordingly.

Block Diagram:

In this experiment, the temperature within box is controlled by turning the hair dryer on and off
or stays unchanged. The temperature comparison is implemented using op-amps and digital
logic. A relay switch is used to regulate the power supply to the hair dryer based on the outcome
of this comparison.
Scale and shift:

The scale and shift circuit is used to increase the sensitivity as a higher voltage range to work
properly and easily with the comparator circuit. This is because the output voltage of the
temperature sensor is very low and this could lead to a high error as the gaps between the values
are very small.

Comparator Circuit:

A Comparator circuit is being used to compare shift


and scale circuit output voltage, VT, with higher
temperature voltage, VH, and lower temperature
voltage, VL, to make a decision whether A and
B is active or inactive to turn the relay on and off
Sequential Digital Logic Circuit:

the digital logic circuit is used to implement the comparison circuit values A and B and sends
the data to the relay. This digital logic circuit is consists with two NAND gates, one clock
generator and a D Flip-Flop.

ANALOG CONTROLLER
Using AD22100

Analogue temperature controller using AD22100


According to the article provided, we have designed an analogue temperature controller using the
parameters discussed in the paper. However, there is no library in the Proteus Software for the
AD22100 sensor, so we had to shift to Potentiometer in place of the AD22100 sensor for the
circuit to work.
At first, we would need to measure the output voltage of the sensor, ow well in this case the
output voltage of the potentiometer. Therefore a probe has been added to measure the Vs. As it
has been already said, the scale and shift circuit has been used to increase the sensitivity of Vs,
so it compared better in the comparator circuit. All the resistor were kept same as the values
provided in the paper. The output from the scale and shift circuit is considered to be Vt and it has
been measured by attaching a probe. Due to the use of the scale and shift circuit, it can be seen, a
small voltage change in Vs will show a higher value in Vt.
After passing the scale and shift circuit, Vt is sent to the comparator circuit. Two comparator
were used to compare the reference high voltage, Vh and low voltage, Vl. From the comparison
circuit we get A and B. Then a digital logic circuit is used to implement the comparison circuit,
since relay understands only 1s and 0s, which eventually turn the relay on and off. The relay acts
depending on the following conditions:
When VT =< VL < VH, the relay will be ON.
When VT => VH > VL, the relay will be OFF.
When VL<VT < VH , the relay will be UNCHANGED.
If they are put logically,
Rk+1 = 1 if B= 0;
Rk+1 = 0 if A= 0;
Rk+1 = Rk if A= 1 and B=1.
By using K-Map, we get
AB/Rk 0 1
00 X X
01 0 0
11 0 1
10 1 1

An LED was used to indicate whether the hairdryer would turned on or off.
Using LM35

Analogue temperature controller using LM35

Although the schematics for AD22100 and LM 35 are same, there are minor discrepancies. For
example, sensor would be LM35, which is found in the library of proteus. Moreover, the resistor
value in the scale and shift circuit will be different
To calculate the resistors, we had to take sample Vs for different
temperatures and generate a graph of the T V/s Vs graph
The slope of the graph is, m= (0.341925-0.211619)/(93.2-69.8)
= 5.568*10^-3
The Graph gives an Equation
Vs = 0.005568Tf – 0.179298
At 21ºC, Vs= 0.211619 and Vt= 0.270861
At 35ºC, Vs= 0.351948 and Vt=4.27895
Using the equation,
Vt = α+ β Vs
α = -5.53
β = 28.5
Using Equations,
𝑅 𝑅
β = 𝑅1 α =-5𝑅2

Taking, R= 100 kΩ
Therefore,

R1=3.5 kΩ and R2=90.41 kΩ


Recalibrating the circuit using these resistor values
And repeating the above process
New,
α = -6.14
β = 29.52
So,
Final resistor values

R1= 3.38 kΩ and R2= 81.43 kΩ


According to the circuit designed above,

R1 = R3 = 3.38 kΩ

R2 = R4 = 81.43 kΩ
RESULT
AD22100
The reference voltages Vh=3.75V and Vl= 2.2V represent the temperature 35 degree Celsius and
29 degree Celsius.

State when temperature is below 29

State when temperature is below 35 but above 29


State when temperature is above 35

While simulating it was seen that, the relay would turn on, switching the LED on whenever the
temperature is below 29 degree Celsius and would stay on until it crosses 35 degree Celsius. The
light would be off when it crosses 35 and it would stay off until it again goes below 29 degree
Celsius.
LM 35
The adjusted reference voltages Vh=4 V and Vl= 2.2V represent the temperature 35 degree
Celsius and 29 degree Celsius.

State when temperature is below 29

State when temperature is below 35 but above 29


State when temperature is above 35

The LM 35 sensor circuit follows the same modulation as AD22100 sensor.


DIGITAL CONTROLLER
Using AD22100
In the digital controller we are using Arduino as our controlling board. When we designed the
digital controlling circuit it is pretty simple to build compared to the analogue circuit as there is
no complicated connection and we did not need the scaling and shifting in this method because
we can compare the slightest details because the digital method can be very precise because it
will be dealt digitally. Therefore, at any set point a precise value of voltage will found without
any hardware complication.

Digital Controller circuit using AD22100

To operate an Arduino, a code is needed. Thus the Arduino allows the data from the sensor to be
sent to the relay to turn it on or off, giving a simpler and precise way to control the temperature.
Code:
const int input = A1;

int output = 2;

int prev = 0;

float v;

float v1;

float vt;

void setup()

pinMode(input, INPUT);

pinMode(output, OUTPUT);

Serial.begin(9600);

void loop()

v = analogRead (input);

v1= (v*500) / 1024;

vt = v1;

if (vt >=216 )

digitalWrite (output , LOW);

prev = 0 ;

else if (vt >= 204 && vt < 216)

if (prev == 1)

{
digitalWrite(output , HIGH);

prev = 1;

else

digitalWrite (output , LOW);

prev = 0;

else

digitalWrite (output , HIGH);

prev = 1;

delay (1500);

}
Using LM 35
The schematic is similar to the AD22100 sensor circuit except the use of LM 35 sensor instead
of AD22100

Digital Controller circuit using LM35

Code:
const int input = A1;

int output = 2;

int prev = 0;

float celcius;

float farenheit;

float vout;

void setup()

{
pinMode(input, INPUT);

pinMode(output, OUTPUT);

Serial.begin(9600);

void loop()

vs = analogRead(input);

vs = (vs*500) / 1023 ;

c = vs ;

f = (c*1.8)+32 ;

if (f >= 95)

digitalWrite (output , LOW);

prev = 0 ;

else if (f >= 85 && f < 95)

if (prev == 1)

digitalWrite(output , HIGH);

prev = 1;

else

digitalWrite (output , LOW);

prev = 0;

}
else

digitalWrite (output , HIGH);

prev = 1;

delay (1500);

RESULT
AD22100

State when temperature is below 29


State when temperature is below 35 but above 29

State when temperature is above 35


LM 35

State when temperature is below 29

State when temperature is below 35 but above 29


State when temperature is above 35

For both the Digital Controllers, while simulating it was seen that, the relay would turn on,
switching the MOTOR on whenever the temperature is below 29 degree Celsius and would stay
on until it crosses 35 degree Celsius. The motor would be off when it crosses 35 and it would
stay off until it again goes below 29 degree Celsius.
Comparison
Data Deviation

Analog Circuit with AD22100

Analog Circuit with LM35

Looking at the data found, it can be said for AD22100 sensor circuit the practical
data is very close to the theoretical data. On the other hand, for LM 35 sensor
circuit the deviation in the practical data is noticeable, although the result shows
the device works perfectly.

Price Comparison
Analog Circuit with AD22100
COMPONENTS PRICE

OP Amp 4 x 25 = 100TK
Resistors 15TK
NAND Gate 20TK
D Flipflop 30TK
AD22100 Sensor 180TK
Potentiometer 15TK
Relay 25TK
Total 385TK
Analog Circuit with LM35

COMPONENTS PRICE

OP Amp 4 x 25TK = 100TK


LM35 70TK
Resistors 15TK
NAND Gate 20TK
D Flipflop 30TK
Potentiometer 2 X15TK = 30TK
Relay 25TK
Total 290TK

Digital Circuit with LM 35


COMPONENTS PRICE

LM 35 70TK
ARDUINO 450TK
RELAY 85TK
TOTAL 605TK

Digital Circuit with AD22100

COMPONENTS PRICE

AD22100 Sensor 180TK


ARDUINO 450TK
RELAY 85TK
TOTAL 715TK
If we look at the prices, it is seen the digital controllers are far more expensive than
the analog controllers. For AD22100 sensor, the difference between the price of
analog circuit and digital circuit is (715-385)TK = 330TK. For LM 35 sensor, the
difference between the price of analog circuit and digital circuit is (605-290)TK =
315TK.

According to my opinion,
The Analog Circuit with LM35 is the most optimal circuit. Since, LM 35 is readily
available and it costs the least among all the other circuit designs. Moreover, the
values of the circuit is pretty much accurate.

Conclusion:
The ‘Temperature Box’ project gives a closer look on closed loop configuration
and feedback systems. It can be said, that Project Based Learning is better than
traditional subject based learning. The project work has put us in a position of real
life problem solving situation in which we needed to research and come up with
solutions to ease up the constraint. Although, the whole project was simulation
based it has helped a lot in better understanding course related material.

You might also like