issn 2320-6802 international journal for … temperature.pdf · · 2013-09-29control temperature...
TRANSCRIPT
www.ijaret.org Vol. 1, Issue VIII, Sep. 2013 ISSN 2320-6802
INTERNATIONAL JOURNAL FOR ADVANCE RESEARCH IN
ENGINEERING AND TECHNOLOGY WINGS TO YOUR THOUGHTS…..
Page 40
REMOTE TEMPERATURE
MONITORING AND CONTROLLING
S. H. Husin
1, M. Y. N Hassan
2, N. M. Z. Hashim
3, Y. Yusop
4, A. Salleh
5
1, 2, 3, 4, 5 Faculty of Electronics & Computer Engineering, Universiti Teknikal Malaysia Melaka,
Hang Tuah Jaya, 76100 Durian Tunggal, Melaka, Malaysia. [email protected]; [email protected]; [email protected]; [email protected],
Abstract: This project is a stand-alone temperature and monitoring and control unit. It uses the remote control to
adjust temperature in order to regulate the temperature. The system is also highly configurable in the setting up the
features and parameters. The system consists of two units, the main control unit and the Radio Frequency (RF)
remote control, with inputs to thermal sensors, and output to the Liquid Crystal Display (LCD). The RF remote
control controls specific settings of the unit. The remote control is powered off a 9V battery. As the result, the
developed system has been observed both from simulation and real circuit, and the test was considered successful.
After the integration between hardware and software had been made, the circuit worked perfectly according to the
value of temperature is working. For future improvement, there are several suggestions that are another sensor
could be added to the system like alarm system and remote control also can be used e.g. Short Messaging System
(SMS) would be more easier way to control the system in order to implement the capability of receiving the SMS
from the owner.
Keywords: Peripheral Interface Controller (PIC), Radio Frequency (RF), Remote Temperature, Short Messaging
System (SMS), Temperature Sensor,
1. INTRODUCTION Remote temperature controller is a controller that can
control temperature of the oven and read current
temperature value from the oven. The whole system
consists of 2 parts which are remote control and oven
temperature controller [1]. The remote control uses
keypad to key in temperature set point and Liquid
Crystal Display (LCD) is used to display
temperature. The heating part is produced by a bulb,
and temperature sensor is used for the temperature
detection. Both controller in transmitter and receiver
use Peripheral Interface Controller (PIC)
microcontroller [2]. A remote-control temperature
monitoring could be very useful addition to the home
of the future. It will enable the users to have the
convenience of adjusting the desire temperature from
remote location. The user will be equipped with the
remote control and the receiver will be placed in the
oven. A transmitter and receiver are used as to
transmit data, specifically the desired absolute
temperature. The temperature will be displayed by
using LCD display. It will have some internal storage
capacity, so that it will continue to display a number
until the next input. The desired temperature inputted
by the user will be appeared at LCD display as the
output [3]. The original PIC was built to be used with
General Instruments' new 16-bit CPU, the CP1600.
While generally a good CPU, the CP1600 had poor
I/O performance, and the 8-bit PIC was developed in
1975 to improve performance of the overall system
by offloading I/O tasks from the CPU. The PIC used
simple microcode stored in ROM to perform its tasks,
and although the term was not used at early time of
PIC, it shares some common features with RISC
designs [1]. In 1985 General Instruments spun off
their microelectronics division, and the new
ownership canceled almost everything which by this
time was mostly out-of-date. The PIC, however, was
upgraded with internal EPROM to produce a
programmable channel controller, and today a huge
variety of PICs are available with various on-board
peripherals (serial communication modules, UARTs,
motor control kernels, etc.) and program memory
from 256 words to 64k words and more (a "word" is
one assembly language instruction, varying from 12,
14 or 16 bits depending on the specific PIC micro
family). PIC and PIC micro are registered trademarks
of Microchip Technology. It is generally thought that
PIC stands for Peripheral Interface Controller,
although General Instruments' original acronym for
www.ijaret.org Vol. 1, Issue VIII, Sep. 2013 ISSN 2320-6802
INTERNATIONAL JOURNAL FOR ADVANCE RESEARCH IN
ENGINEERING AND TECHNOLOGY WINGS TO YOUR THOUGHTS…..
Page 41
the initial PIC1640 and PIC1650 devices was
"Programmable Interface Controller". The acronym
was quickly replaced with "Programmable Intelligent
Computer".
The objectives of this project are to study and apply
PIC microcontroller with capability temperature
control, to improve the remote temperature
monitoring and controlling technology using RF
signals, to complete the operation of RF module,
relay module, keypad, and LCD module and to have
the convenience of adjusting the temperature from
any location.
2. METHODOLOGY
Project is implemented by several processes as shown
in Figure 1 below.
Figure 1: Flowchart of overall system
Initial construction of circuit is done on a project
board for easier testing and modification. Then, it is
transferred to a board after the circuit is found to be
working [4]. Software development includes the
programming of the PIC16F877A which interfaces
the main unit with all the hardware part [5], [6], [7],
[8]. A set of instruction code is written to indicate the
microcontroller what to be performed and functioned
due to the requirement. In the interfacing stage,
hardware and software are expected to work together
as a complete system [9], [10], [11]. Figure 2 shows
the schematic diagram of the overall project.
2.1. Hardware Development
The complete schematic diagram of the project is
shown in the Figure 2 until Figure 5 where all the
hardware parts such as sensor, PIC16F877A
microcontroller and 5V voltage regulator are
combined together. The hardware part is discussed in
the following section.
Figure 2: Schematic diagram of the project
www.ijaret.org Vol. 1, Issue VIII, Sep. 2013 ISSN 2320-6802
INTERNATIONAL JOURNAL FOR ADVANCE RESEARCH IN
ENGINEERING AND TECHNOLOGY WINGS TO YOUR THOUGHTS…..
Page 42
Figure 3: Schematic diagram of the LCD Display
Figure 4: Schematic diagram of the keypad
Figure 5: Schematic diagram of the PIC16F877A
2.2. Software Development
The control program is written in assembler codes
and converted to hexadecimal codes by the MPLAB
software. Hex codes are later transferred to the PIC
using PIC burner. MPLAB Integrated Development
Environment (IDE) is a free, integrated gcc-based
toolset for the development of embedded applications
employing Microchip's PIC and dsPIC
microcontrollers. The MPLAB IDE runs as a 32-bit
application on Microsoft Windows, and includes
several free software components for application
development, hardware simulation and debugging.
MPLAB IDE also serves as a single, unified
graphical user interface for additional Microchip and
third-party software and hardware development tools
[12]. Both Assembly and C programming languages
can be used with MPLAB IDE [13].
Before creating a programming, other programming
is created to ensure that the integration between
software and hardware is successful, and the
components on the circuit can works according to the
behavior that has been programmed [14]. This
programming is created for the circuit to detect the
temperature in the oven, and display the value to the
LCD display. By using the if-else function, the
remote can be controlled with the value of
temperature received from sensor. After determine
that the programming can be integrated with
hardware, the programming was created. Figure 6
and Figure 7 show the flow chart for the transmitter
and receiver.
Figure 6: Flow Chart (Transmitter)
www.ijaret.org Vol. 1, Issue VIII, Sep. 2013 ISSN 2320-6802
INTERNATIONAL JOURNAL FOR ADVANCE RESEARCH IN
ENGINEERING AND TECHNOLOGY WINGS TO YOUR THOUGHTS…..
Page 43
Figure 7: Flow chart (Receiver)
2.3. Hardware-Software Integration
For the final method, both hardware and software is
being combined together by using PIC burner
WinPic800 software. The developed coding are
downloaded into WinPic800 and transferred to
PIC16F877A that are located on the hardware [15],
[16], [17]. This is a vital part which will determine
whether the project is working or not. If the project
fails to work, troubleshoot will take place for the both
software and hardware. Hardware problem can be
avoided by using prefabricated PIC microcontroller
boards as there are very little chance of having
hardware problems due to the hardware is well
construct by the factory.
3. RESULTS AND DISCUSSION This project consists of several phase of
development, the first phase is the circuit design
testing. For the second phase, it is about the
construction of hardware. The last phase is designing
a programming which is the ability to integrate the
software with hardware. For the software design, the
programming in software part showed it can make all
the components on the circuit function as temperature
control, and still need improvement on the designing
the full set of device. For remote control system,
designing rule base is completed. The programming
code is design using MPLAB software.
3.1. Temperature Sensor Microcontroller Circuit
Testing
Before testing the circuit, firstly the components is
determined whether it is connected correctly, and
identified which port that will be used on PIC
16F877A for every components on the circuit.
Proteus software is used to design and test the
temperature sensor microcontroller circuit.
For the PIC port, the whole Port C is used for LCD
display. Sensor A and Sensor B used Port RA0 and
RA1 respectively. Since LED and buzzer is not the
main component on the circuit, both LED and buzzer
are acting as a marker to certain situation. For
example if the temperature is greater than 40oC, LED
A will switch on. If temperature is less than 40oC,
LED B will switch on. For LED A and B, it used Port
RB2 and RB1 respectively. For buzzer, it used Port
RB5.
During the testing mode, the basic programming is
used first to determine whether the input-output
component can interact with PIC and function
according to the programming code that has been
design before proceed to hardware construction or
not. The circuit is successfully integrated with the
coding, and the circuit runs accordingly.
From the testing mode, the results showed that the
value of temperature sense by LM35 temperature
sensor is wrongly displayed. The value been
displayed on the LCD is seems to be the value has
been divided into 10. For example, if the sensor
senses the temperature value 27oC, the LCD will
display the value 2.7oC. After several observation
related to this problem is done, it is determine that
this problem is caused by the programming and the
circuit design. From the programming code, it has
been set by LCD that the value of temperature
detected by sensor will be divided by 10. This is due
to the value of sensor which has been set to have an
extra 0 on the LSB. For example if the actual
temperature is 27oC, the sensor will send the value
270 instead of 27 to PIC. This is because sensor
cannot give the decimal point. Therefore by setting
an extra 0 on the LSB of the sensor value, the
decimal point can be created due to the division
created when displaying on LCD. Figure 8 and
Figure 9 show the part of coding that cause this
problem.
www.ijaret.org Vol. 1, Issue VIII, Sep. 2013 ISSN 2320-6802
INTERNATIONAL JOURNAL FOR ADVANCE RESEARCH IN
ENGINEERING AND TECHNOLOGY WINGS TO YOUR THOUGHTS…..
Page 44
Figure 8: Coding for LCD
Figure 9: Coding for sensor
Other problem for this result is the design is the
usage of Proteus itself. In normal case, the simulation
design will always give an accurate and precise value
because the tolerance on every components that used
to design a circuit is been neglected. The sensor that
been used in the design phase is designed to get the
exact value that user set. For example if user set the
sensor on the circuit to give the temperature value of
27oC, the sensor will send the value to PIC exactly as
the value has been set. Thus when the PIC send the
value to be displayed on LCD, it will divide by 10 as
in coding. That is why the value displayed on LCD
was differing with sensor. Figure 10 and Figure 11
show the different value between sensor and LCD.
Figure 10: Value on sensor
Figure 11: Value on LCD
As different value between sensor and LCD,
another testing needs to be conducted. For this time,
the testing is done by using the real component. The
circuit is construct using protoboard. Figure 12 shows
the circuit that has been constructed using
protoboard.
Figure 12: Circuit construction using protoboard for
testing mode
Heat on solder rod is used as the heat source. This
heat source is put near to the sensor. For precaution,
the heat source should not be touched the sensor as
the sensor will burn out due to high temperature of
solder rod. The value of temperature sense by the
sensor is determined by reading the output voltage
the sensor as the output voltage at pin 2 changes
www.ijaret.org Vol. 1, Issue VIII, Sep. 2013 ISSN 2320-6802
INTERNATIONAL JOURNAL FOR ADVANCE RESEARCH IN
ENGINEERING AND TECHNOLOGY WINGS TO YOUR THOUGHTS…..
Page 45
linearly with temperature from 0V (0oC) to 1000mV
(100oC). From the reading on multi meter, the output
voltage is 303mV. This value is linearly with 30.3oC.
Figure 13 shows the testing of the sensor.
Figure 13: Testing the functionality of LM35
temperature sensor
After the coding is burn on PIC, the testing is begun.
From this testing, it is determine that the value on
LCD shows the same value with sensor. From the
second testing, it is determine that the coding is not
the main problem which causes the different value of
temperature from simulation. Figure 14 shows the
simulation circuit while Figure 15 shows the value of
temperature displayed on LCD.
Figure 14: Circuit during testing mode
Figure 15: Value of temperature displayed on LCD
3.2. Temperature Sensor Microcontroller
Software Development
For the software development, there are divided into
two categories; basic programming coding for testing
purpose and device programming. Between these two
parts, only basic programming is complete and has
been tested. For device programming, it is still under
development.
Before creating a device programming, other
programming is created to ensure that the integration
between software and hardware is successful, and the
components on the circuit can works according to the
behavior that has been programmed. This
programming is created for the circuit to detect the
temperature in the container, and display the value at
the LCD display. By using the if-else function, the
remote can be controlled with the value of
temperature received from sensor. After determine
that the programming can be integrated with
hardware, device programming was created.
For the first programming coding, High-Tech C
language is used. This is due to simple port
declaration. Although the coding is quite easy to
understand, it is difficult to compile. Only Hi Tech
compiler can compile this programming. MPLAB
HI-TECH C compiler is used to compile this
programming. Since HI-TECH C compilers know
exactly which registers will be used for any interrupt,
they can determine the context size dynamically,
based on the state of the program at the time of
compilation. Code generated by OCG compilers may
not need to save any registers during an interrupt
routine, thereby saving cycles that are wasted by non-
OCG compilers. Fewer instruction cycles means the
MCU can spend more time in sleep mode. Most
embedded C compilers require special linker scripts
and numerous command line options to be used to
cater for differing device architectures. With full
knowledge of the device and the ability to determine
where all objects will be linked, much of this work is
reduced or eliminated with HI-TECH C compilers.
www.ijaret.org Vol. 1, Issue VIII, Sep. 2013 ISSN 2320-6802
INTERNATIONAL JOURNAL FOR ADVANCE RESEARCH IN
ENGINEERING AND TECHNOLOGY WINGS TO YOUR THOUGHTS…..
Page 46
Because the compiler knows how frequently each
variable is used and which variables are dependent, it
can optimize pointers and position objects in the most
efficient memory spaces, eliminating the need for the
programmer to do this manually with non-standard C
language extensions.
The first programming coding consist of three
functions which is main function, subroutine LCD
setting, and subroutine ADC setting. For main
function, it consists of configuring input-output port.
Port A is configured as input-output direction where
the sensor are located at Port A, and sensor will
detect the temperature which is input, and send the
data to PIC which is output. Port B and Port C is
configured as output where these two ports is being
used by remote and LCD which both of the
component will react with the data sent by PIC which
is output. Figure 16 shows the coding of configuring
input-output port.
Figure 16: Configuration of input-output port
It is also consist of configuring LCD display. In this
function, the configuration is about placing a fix
character such as „TEMP.A=‟ on the LCD. It is also
configured PIC to send the value of temperature
detect by sensor to LCD. In this process, the value
send by PIC is divided by 10 due to seek decimal
value for precision measurement. Apart from
configuration of port and LCD, it is also consist of if-
else statement. If-else statement is the choosing
process which we used to create several situations to
get several results. For this coding, value of
temperature is taken as the situation for the output
component to react. It is set to have four if-else
statements which will get four different results. The
first statement state that if the Sensor A detects
temperature more than 40oC and Sensor B detect
temperature less than 35oC, Relay1 will turn on while
Relay 2 is turned off. Second statement state that that
if the Sensor A detect temperature less than 40oC, and
Sensor B detect temperature more than 35oC, Relay2
will turn on while Relay1 is turned off. The third
statement state that that if the Sensor A detect
temperature more than 40oC, and Sensor B detect
temperature more than 35oC, Relay1 and Relay2 will
turn on. Final statement state that that if the Sensor A
detect temperature less than 40oC, and Sensor B
detect temperature less than 35oC, Relay 1 and Relay
2 is turned off.
For subroutine LCD setting function, it is consist of
LCD display setting to make the LCD working. In
this function, delay time for LCD to display the value
is configured. Because of this function is mostly the
same, it can be gained from the previous section.
Overall this function is the setting for the LCD to run
on the circuit.
For subroutine Analog to Digital Converter (ADC)
setting, it is the configuration of analog to digital
converter port that has been used by sensor. It is also
configured to make the sensor detect the value of
temperature for 2000 times to get the average value
of temperature that has been processed by PIC before
sending the value to LCD display.
This programming is created for a testing purpose
and guide to develop device programming later on.
This coding has been tested on both simulation and
hardware, and was successfully working. It is
determine after testing it to the real circuit, it was
function well without any value problems that
occurred during circuit design testing.
4. CONCLUSIONS AND FUTURE
WORK From the result that has been observed both from
simulation and real circuit, the test was considered
successful. After the integration between hardware
and software is made, the circuit works perfectly
according to the value of temperature is working.. As
the overall conclusion, the circuit is function and can
be integrated with software, but is not completely
done because the device coding is still in
development process.
Although the circuit in hardware part is not
constructed yet, but the overall operation of the
project has been clearly understood .The project can
be improved to target more advance and better
application for the next research. For future
improvement, there are several suggestions as stated
below another sensor could be added to the system
like alarm system. Instead of using remote control,
SMS would be more easier way to control the system
in order to implement the capability of receiving the
SMS from the owner.
REFERENCES [1] H. D. Serhat YILMAZ, Burak
TOMBALOGLU, Kursat KARABULUTLU,
Yener GUMUS, “TEMPERATURE
www.ijaret.org Vol. 1, Issue VIII, Sep. 2013 ISSN 2320-6802
INTERNATIONAL JOURNAL FOR ADVANCE RESEARCH IN
ENGINEERING AND TECHNOLOGY WINGS TO YOUR THOUGHTS…..
Page 47
CONTROL APPLICATIONS BY MEANS
OF A PIC16F877 MICROCONTROLLER.”
[2] K. D. Stephan, J. a. Pearce, and E. Ryza,
“Prospects for industrial remote temperature
sensing using microwave radiometry,” 2004
IEEE MTT-S International Microwave
Symposium Digest (IEEE Cat.
No.04CH37535), vol. 2, pp. 651–654, 2004.
[3] S. K. Subramaniam, S. H. Husin, S. A. Anas,
and A. H. Hamidon, “Multiple Method
Switching System for Electrical Appliances
using Programmable Logic Controller,” vol.
4, no. 6, pp. 243–252, 2009.
[4] S. Alexander, Fundamentals of Electronic
Circuits. Mc Graw Hill, 2007.
[5] N. M. Z. Hashim, N. A. Ali, A. S. Jaafar, N. R.
Mohamad, L. Salahuddin, and N. A. Ishak,
“Smart Ordering System via Bluetooth,”
International Journal of Computer Trends and
Technology (IJCTT), vol. 4, no. 7, pp. 2253–
2256, 2013.
[6] N. M. Z. Hashim, N. A. Ali, A. Salleh, A. S. Ja,
and N. A. Z. Abidin, “Development of
Optimal Photosensors Based Heart Pulse
Detector,” International Journal of
Engineering and Technology (IJET), vol. 5, no.
4, pp. 3601–3607, 2013.
[7] N. M. Z. Hashim, N. B. Hamdan, Z. Zakaria,
R. A. Hamzah, and A. Salleh, “Flood Detector
Emergency Warning System,” International
Journal Of Engineering And Computer Science
(IJECS), vol. 2, no. 8, pp. 2332–2336, 2013.
[8] N. M. Z. Hashim, S. H. Husin, A. S. Ja, and N.
A. A. Hamid, “Smart Wiper Control System,”
International Journal of Application or
Innovation in Engineering & Management
(IJAIEM), vol. 2, no. 7, pp. 409–415, 2013.
[9] N. M. Z. Hashim and N. A. M. M. Arifin,
“Laboratory Inventory System,” International
Journal of Science and Research (IJSR), vol. 2,
no. 8, pp. 261–264, 2013.
[10] N. M. Z. Hashim, N. M. T. N. Ibrahim, Z.
Zakaria, F. Syahrial, and H. Bakri,
“Development New Press Machine using
Programmable Logic Controller,”
International Journal Of Engineering And
Computer Science (IJECS), vol. 2, no. 8, pp.
2310–2314, 2013.
[11] N. M. Z. Hashim and S. N. K. S. Mohamed,
“Development of Student Information
System,” International Journal of Science and
Research (IJSR), vol. 2, no. 8, pp. 256–260,
2013.
[12] N. M. Z. Hashim, N. H. Mohamad, Z.
Zakaria, H. Bakri, and F. Sakaguchi,
“Development of Tomato Inspection and
Grading System using Image Processing,”
International Journal Of Engineering And
Computer Science (IJECS), vol. 2, no. 8, pp.
2319–2326, 2013.
[13] Chris H. Pappas, C# For Web Programming,
Prentice Hall. Prentice Hall, 2002.
[14] S. A. R. James W. Nilson, Electric Circuits,
Fifth. Addison-Wesley Publishing Company.,
1996.
[15] N. M. Z. Hashim, A. F. Jaafar, Z. Zakaria, A.
Salleh, and R. A. Hamzah, “Smart Casing for
Desktop Personal Computer,” International
Journal Of Engineering And Computer Science
(IJECS), vol. 2, no. 8, pp. 2337–2342, 2013.
[16] N. M. Z. Hashim, A. S. Jaafar, N. A. Ali, L.
Salahuddin, N. R. Mohamad, and M. A.
Ibrahim, “Traffic Light Control System for
Emergency Vehicles Using Radio Frequency,”
IOSR Journal of Engineering (IOSRJEN), vol.
3, no. 7, pp. 43–52, 2013.
[17] N. M. Z. Hashim and M. S. Sizali, “Wireless
Patient Monitoring System,” International
Journal of Science and Research (IJSR), vol. 2,
no. 8, pp. 250–255, 2013.