You are on page 1of 6

An Embedded Design for Automatic Temperature

Controller
1
A. Goswami, T. 2Bezboruah, 3K.C. Sarma
1,3
Department of Instrumentation Science and USIC, Gauhati University, Guwahati-781014 Assam, India
2
Department of Electronics Science, Gauhati University, Guwahati-781014, Assam, India

Abstract- Each and every part of human life is somehow linked with the embedded products. Embedded systems are
product of hardware and software co design; it’s about adding intelligence to a system. It is becoming an integral part of
engineering design process for efficient analysis of data acquisition. Data acquisition implies the gathering of information
about a system or process. It is the process of collecting data in an automated way from analogue and digital sources of
measurement, such as sensors and devices under test. The present paper describes the design of an embedded system for
the control of temperature in a single system using sensors, microcontroller and Liquid Crystal Display (LCD). It describes
the controlling action incorporated in the hardware to control any device connected when specific conditions are met.

I. INTRODUCTION
It is very much essential in industrial as well as
experimental setup to monitor and control temperature
continuously. The efficient solution for this problem is
to develop a data logger. Earlier development of data
logger had been done through manual measurements
from analog instruments, such as thermometers and
manometers. Unfortunately this type of data logger can’t
fulfill the current requirements in terms of timing and
accuracy. Since 1990, further development in data
logging took place as people begin to create PC-based
data logging systems [1, 2]. In later stages of
development it has been found that microcontrollers Fig.1: Block Diagram of the experimental setup
(integration of microprocessors and certain peripherals
including memory) are more reliable as well as efficient The figure above shows the basic block diagram of
[3]. Use of microcontrollers in embedded design has not the temperature indicator system using microcontroller
only been increased but brought a revolutionary change. AT89C52. The power supply for the circuit is regulated
At the same time competitive pressures require by the IC7805 and supplied to different parts of the unit.
manufacturers to expand their product functionality and DS1621 is the temperature sensor chip. The
provide differentiation while maintaining or reducing the microcontroller unit (MCU) reads the temperature from
cost. the sensor. The temperature data is compared with
As a parameter, nature of temperature is ever- certain user-define temperature values and processed
changing. It is exposed to huge array of stimuli from its inside the MCU as per the program and then sent to the
environment. Though temperature can be monitored LC display. The system is also equipped with necessary
through variety of sensors, one should adhere maximum hardware to initiate control action. The system
cares in selecting sensors due to different levels of developed enables it’s user to set the value of
complexity associated with the calibration process. If temperature as required and set transfer rate of data
calibration is not implemented properly output of the through RS232. Necessary Keypad in the form of push-
embedded system may vary from actual temperature buttons is provided for setting desired temperature and
measured through standard instruments. transfer time. For the purpose of storing and some
intelligent analysis of data, the system can be connected
II. MOTIVATION to PC through RS-232. This setup can be effectively
The purpose of the proposed work is its low cost used in industries for single control end. The functions
and industrial demand. Such a design can effectively of each section of the circuit are explained in the
decrease the number of computers used in an industry, following sections.
such as food processing, green house or a packing
industry & thus in turn can save power which is the main 3.1 Hardware Description
feature of this work. The whole circuit of the experiment can be divided into
following sections:
III. EXPERIMENTAL SETUP a. Power supply section: The regulated power supply
The block diagram of the experiment is shown in section is designed and fabricated with full wave
fig.1. The hardware and software description of the rectifier using voltage regulator MC7805 which provides
embedded system for monitoring and controlling a constant voltage of 5V to the circuit.
temperature are described below: b. DS1621 (Digital Thermometer and Thermostat):

Published in International Journal of Advanced Engineering & Application, Jan 2011 Issue 88
• Temperature measurements require no external needed to compensate for the parabolic behavior of the
components oscillators over temperature. The counter is then clocked
• Measures temperatures from –55°C to +125°C in 0.5°C again until it reaches zero. If the gate period is still not
increment. finished, then this process repeats. The slope
• Wide power supply range (2.7V to 5.5V) accumulator is used to compensate for the nonlinear
• Converts temperature to digital word in 1 second behavior of the oscillators over temperature, yielding a
high resolution temperature measurement. This is done
by changing the number of counts necessary for the
counter to go through for each incremental degree in
temperature. To obtain the desired resolution, therefore,
both the value of the counter and the number of counts
per °C (the value of the slope accumulator) at a given
temperature must be known. This calculation is done
inside the DS1621 to provide 0.5°C resolution. The
temperature reading is provided in a 9–bit, two’s
complement reading by issuing the READ
Work Function: TEMPERATURE command. The data is transmitted
The DS1621 digital thermometer and thermostat through the 2–wire serial interface, MSB first. The
provides 9–bit temperature readings which indicate the DS1621 can measure temperature over the range of –
temperature of the device. The thermal alarm output, 55°C to +125°C in 0.5°C increments. For Fahrenheit
TOUT, is active when the temperature of the device usage, a lookup table or conversion factor must be used.
exceeds a user–defined temperature TH. The output
remains active until the temperature drops below user
defined temperature TL, allowing for any hysteresis
necessary. User defined temperature settings are stored
in non– volatile memory, so parts may be programmed
prior to insertion in a system. Temperature settings and
temperature readings are all communicated to/from the
DS1621 over a simple 2–wire serial interface.

c Controller section: The analog value is converted to


digital value by ADC and is picked up by the
microcontroller AT89S52 which is a low-power, high-
Fig.2: DS 1621 Functional Block Diagram performance Complementary Metal Oxide Silicon
(CMOS) 8-bit microcomputer with 8 KB of Flash
Operation of Device DS1621:
programmable and erasable read only memory (EPROM)
The DS1621 measures temperatures through the use [7].
of an on–board proprietary temperature measurement d. Display section: Since it is essential to display the
technique. The DS1621 measures temperature by data received from the microcontroller, a liquid crystal
counting the number of clock cycles that an oscillator display 44780 LCD is used which is a 2 x 16 line display
with a low temperature coefficient goes through during a
[8, 9].
gate period determined by a high temperature coefficient
e. Thermostat Control: In its operating mode, the
oscillator. The counter is preset with a base count that DS1621 functions as a thermostat with programmable
corresponds to –55°C. If the counter reaches zero before hysteresis. The thermostat output updates as soon as a
the gate period is over, the temperature register, which is temperature conversion is complete. When the DS1621’s
also preset to the –55°C value, is incremented, indicating temperature meets or exceeds the value stored in the
that the temperature is higher than –55°C. At the same
high temperature trip register (TH), the output becomes
time, the counter is then preset with a value determined active, and will stay active until the temperature falls
by the slope accumulator circuitry. This circuitry is

Published in International Journal of Advanced Engineering & Application, Jan 2011 Issue 89
below the temperature stored in the low temperature
trigger register (TL). In this way, any amount of
hysteresis may be obtained. The active state for the
output is programmable by the user, so that an active
state may either be a logic 1 (VDD) or a logic 0 (0V).
This section consists of a relay to control hardware to
start cooling for maintaining temperature as set by the
user and a buzzer to notify the change [10, 11]. Simple
push buttons are used to set temperature and give the
time of data transfer to the PC. A 12V relay is used to
control an LED at the set temperature.
f. Data Transfer: The DS1621 supports a bi–directional
two–wire bus and data transmission protocol. A device
that sends data onto the bus is defined as a transmitter,
and a device receiving data as a receiver. The device that
controls the message is called a “master”. The devices
that are controlled by the master are “slaves”. The bus Shcematic Diagram:
must be controlled by a master device which generates
the serial clock (SCL), controls the bus access, and
generates the START an d STOP conditions. The
DS1621 operates as a slave on the two–wire bus.
Connections to the bus are made via the open–drain I/O
lines SDA and SCL. The following bus protocol has
been defined.
• Data transfer may be initiated only when the bus is not
busy.
• During data transfer, the data line must remain stable
whenever the clock line is HIGH. Changes in the data
line while the clock line is high will be interpreted as
control signals. Accordingly, the following bus
conditions have been defined:

Bus not busy: Both data and clock lines remain HIGH.
Start data transfer: A change in the state of the data
line, from HIGH to LOW, while the clock is HIGH,
defines a START condition.
Stop data transfer: A change in the state of the data
line, from LOW to HIGH, while the clock line is HIGH,
defines the STOP condition.
Data valid: The state of the data line represents valid
data when, after a START condition, the data line is
stable for the duration of the HIGH period of the clock Fig.3: Schematic Diagram
signal. The data on the line must be changed during the
LOW period of the clock signal. There is one clock
pulse per bit of data. Each data transfer is initiated with a
START condition and terminated with a STOP condition
The number of data bytes transferred between START
and STOP conditions is not limited, and is determined
by the master device. The information is transferred
byte–wise and each receiver acknowledges with a ninth–
bit. Within the bus specifications a regular mode (100
KHz clock rate) and a fast mode (400 KHz clock rate)
are defined. The DS1621 works in both modes.

Acknowledge: Each receiving device, when addressed,


is obliged to generate an acknowledgement after the
reception of each byte. Fig.4.1: PCB Layout for Component side

Data Transmission in DS1621 is shown below:

Published in International Journal of Advanced Engineering & Application, Jan 2011 Issue 90
Fig.4.1: PCB Layout for Solder Side

3.2. Software Description


Software development for the present work consists
of two main modules. One being the online monitoring
and controlling, and the other being offline analysis
based on data stored in computer. Present article limits
its work on first module keeping second module for
future development. Software is developed in both C and
Assembly language.
Algorithm for online monitoring and controlling of
temperature is given below:
i. First step is to initialize keys, Interrupt vectors panel
and LCD
ii. Define port P3 of microcontroller ATMEL 89S52 as
output port
iii. Get temperature value from DS1621
iv. Display the appropriate values of Temperature in
LCD panel in Round Robin pattern
v. Start hardware devices to act if sense temperature is
higher than set temperature
vi. New value of Temperature can be set using four keys
as follows
a. Press first key for once to display existing high value
of set temperature (TH) and press the key twice to
display existing low value of set temperature (TL) and
blink cursor at unit position
b. Second key for increment in unit position
c. Third key for shifting one position left at a time
d. Fourth key for setting new temperature value
replacing previous one
vii. New value of transfer rate of data to RS232 is set
using keypad as follows
a. Press first key thrice for displaying existing value of
transfer rate set and blink cursor at unit position
b. Second key for increment in unit position
c. Third key for shifting one position left at a time
d. Fourth key for setting new transfer rate of data to
RS232
viii. Return to step 3

The Flowchart for monitoring and controlling


temperature is given in fig.5

Published in International Journal of Advanced Engineering & Application, Jan 2011 Issue 91
START

Initialized Keys, Interrupt vectors, LCD


Panel

Assign P3 as output port

Get data from ADC 0809

Want to set No Want to If Data If Data


change No from No from
new Transfer Temp LDR
temperature time to Channel Channel
Value RS232
Yes Yes Yes
Yes Yes Yes Yes
Yes
# Press 1stkey three times Convert into Convert into
Appropriate form Appropriate
# Press 1stkey one time for for display of Existing
of Data form of
display of existing high set transfer time and blink Data
temperature (TH) and two Courser at unit position.
times to display existing low
set temperature (TL) and # Press 2nd key increment Display on LCD
Display
blink Courser at unit the value at unit position On LCD
position.
# Press 2nd key for increment # Press3rd key shifting the
the value at unit position. value to left position.
rd If Sense No
# Press 3 key shifting the
value to left position. # Press4th key setting new Temp>
th
transferring value Temp
# Press 4 key setting new
Set
temperature value replacing replacing existing one. Yes
existing one.
Start Hardware Device on for
Cooling

No
If Sense
temp<=
Temp set

Yes

Switch off hardware


device for cooling

Fig.5: Flow chart

Published in International Journal of Advanced Engineering & Application, Jan 2011 Issue 92
IV. TESTING The system can be further enhanced by developing
Visualization Test: necessary software for offline anlysis.The data stored on
When the fabrication process is completed & all the PC will enable the system to make historical and
components have been mounted perfectly the intelligent analysis to make efficient decision.
visualization testing is performed. In this testing the
circuit is scanned simply by the eyes & not by the help REFERENCES
1. Goswami, A., Bezboruah, T. and Sarma, K. C.,"Design Of An
of any instrument. It to ensure that the soldering is
Embedded System For Monitoring And Controlling Temperature And
perfect and there is no loose connection between the Light", International Journal of Electronics Engineering Research
components. (IJEER), VOL-1, 2009
2. Goswami, A., Bezboruah, T. and Sarma, K. C., Design of an
embedded system for monitoring and controlling temperature, Porc. Of
Pre-heating Test:
International conference on emerging technologies and applications in
This test is performed to check the heat tolerance of engineering, technology and science during 13th -14th January, 2008,
the components. In this the circuit is provided power Rajkot, Gujarat, India, Vol.1, pp.105-110.
supply and left for some time. After a interval of time it 3. Goswami, A., Bezboruah, T. and Sarma, K. C., Design and
implementation of an embedded system for monitoring and controlling
is checked that if there is any component get faulty
the intensity of light, Porc. Of The 2008 International conference on
component specially for IC’s. embedded systems and application during July 14-17, 2008 at Las
Vegas Neveda, USA, Vol-ESA 2008, pp.117-123.
Applications: 4. www.ni.com/dataloggers - A Review of PC -Based Data Logging
and Recording Techniques
1. This system can be placed near computer
5. Muhammad Ali Mazidi and Janice Gillispe Mazidi, “The 8051
processors for heat sensing. microcontroller and embedded systems”, Pearson education ltd., India,
2. Placed near heat sensitive devices to indicate 2007.
the temperature. 6. National semiconductor corporation, ADC 0809 data sheet, 8-bit
Microprocessor compatible A/D converters with 8-channel multiplexer,
3. This system can interfaced with computers and
national Semiconductor data book, October 2002 updates.
temperature can be controlled. 7. ST Microelectronics data book, March, 2002 publication.
8. http://www.st.com
The rate of data transfer through RS232 is 9. National Semiconductor Corporation, LM35 datasheet, precision
centigrade temperature sensors, Atmel data book, November 2000
controlled through the keypad, and whatever be the time
update.
that declared as the gap, at which the data should be 10. Atmel corporation, AT89S52 data sheet, 8-bit microcontroller with
transferred to PC is accurately achieved. For example, if 8k bytes flash, Atmel Data book, 2000 update
we have set the time for data transfer as 2hr, i.e at a gap 11. http://en.wikipedia.org/wiki/Liquid_crystal_display .
12. Introduction to LCD programming tutorial by Craig Steiner
of 2hr, the temperature value at that instant will be
Copyright 1997 -2005 by Vault information services LLC
transferred to PC. With different values of set value for (http://8052.com/tutlcd.phtml)
transfer time, we have performed the experiment and it 13. H S kalsi, “Electronic instrumentation”, Tata McGraw-Hill Ltd.,
works properly. New Delhi, 1999
14. http://en.wikipedia.org/wiki/temperature-measurement

Published in International Journal of Advanced Engineering & Application, Jan 2011 Issue 93

You might also like