1.ourside - Vip.automatic Temperature Control and Alert System Simulation and design.2207ELX019

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

APTIKOM Journal on Computer Science and Information Technologies

Vol. 2, No. 2, 2017, pp. 77~85


ISSN: 2528-2417
DOI: 10.11591/APTIKOM.J.CSIT.49  77

Design and Simulation of Automatic Temperature Control


and Alert System Based PIC16F887

Jabbar Shaati Jahlool


Computer Techniques Engineering Department, Dijlah University College, Baghdad, Iraq
e-mail: [email protected]

Abstract
In this research, the design and simulation of an automatic system for temperature control using embedded
system in order to automatically control of multi appliances depend on the temperature value. The appliances will be
controlled are ventilation, cooling, heating and alert. This is an order to avoid or reduce to human intervention and
increase system reliability. An important feature of this automation process is to reduce or eliminate the possibility of
relying on the human factor operator for industries, warehouses and laboratories, and to improve working and
performance environments. The system in this paper used the microcontroller PIC16F887 as the central control unit,
LM35 temperature sensor as a temperature source,16x2 liquid crystal display (LCD) as indicator to display the
different system working status an addition to some of drivers, relay and light emitting diodes (LED) as indicators to
display the corresponding working appliance driver. The implementation and simulation of the system work has been
achieved by using Proteus professional software v8.0 and mikroc pro for pic v.6.6.1 software to write the equivalent
program and generate. Hex file for system working.

Keywords: ATC, PIC16F887, LM35, PROTEUS, MIKROC

Copyright © 2017 APTIKOM - All rights reserved.

1. Introduction
Nowadays rely on automated systems became commonly used things in life and, of course, one
of these systems has automatic temperature control. The use of automatic temperature control systems
become now commonly used in a wide field like industrial plants, laboratories, medical and food stores,
warehouses and other. Modern applications using temperature control systems based on microcontrollers
(MCU) to control the ventilation, heat, cold and alarm devices for the one of above fields. The use of
micro-controllers achieves great reliability as well as high efficiency [1]. Depending of using of MCU in
embedded design has not only been increased but it achieved a revolutionary change. An important
element for achieving competitiveness in manufacturers is to provide differentiation while maintaining or
reducing cost and to expand their product functionality [2]. Save power and reduce the costs for
optimization of smart home system this is study about internal temperature controlling system based on
microcontroller [3]. Automatic smart kitchen system is used to discharge heat and smoke in the kitchen
by using PWM (Pulse Width Modulation) waves generated by a PIC16F877A MCU based on
temperature sensor to controlling the speed of kitchen air blower [4]. Using temperature control and
peripheral interface controller (PIC) 16F876A but it focus on the use of external signal conditioning
circuit for proper processing of the signal before it was given to MCU, but this method increase the
system hardware components then consequently lead to increase the cost and probability of fault by
adding others hardware components, while the internal ADC (analogue to digital converter) circuit inside
the MCUs take signal conditioning of all types of inputs analogue signals returned from different types of
sensor in other consideration therefore this additional external circuit has not needed [5].
Temperature control in a ventilation system using PIC18F4620 was designed and developed by using heat
resistor as the heating source to emits a heat quantity in the environment and direct current (DC) motor as
the cooling source and then generate pulse width modulation (PWM) signal as a control speed dependent
signal to control of the cooling depend on the heating difference [6]. An automatic control solution is
suggested to control the fan speed by using the PIC 16F877A and LM35DZ temperature sensor the
automatic design circuit control of fan speed depend on the change of temperature i.e. when the
temperature is high, the fan operates at high speed and vice versa. This process occurs automatically [7].
Monitoring server room temperature has been implementation of a microcontroller based system by using

Received March 21, 2017; Revised May 30, 2017; Accepted June 18, 2017
78  ISSN: 2528-2417

kind of microcontroller (Atmel AVR ATmega8535 microcontroller and LM35 temperature sensor), other
attached devices are used to display the room temperature as well as an alarm device is also used.
The system is equipped with a GSM modem to send a text message when the room temperature rises to a
certain extent to enter the danger zone to alert the room server supervisor for the purpose of controlling
other electronic devices within the server room [8]. Designing and implementing a modern fan speed
control system based on the changes that occur in the room temperature. This design is based on the use
of PWM technology so that changing the duty cycle depends on the room temperature and as a result
leads to the control of the fan speed movement automatically [9]. In this work, the designs of ATC system
based a PIC microcontroller (PIC16F887) and temperature sensor (LM35) for automatically control of
multi appliance depend on selected temperature values these will be lead to automatically change to
appropriate appliance (ventilation, cooling, heating and alert). The proposed system implemented and
simulated by using proteus professional software v 8.0 and mikroc PRO FOR PIC v.6.6.1. The object of
this system to avoiding human intervention in such applications which then leads to eliminate or reduce
dependency on humans workers for industries, warehouse, laboratories and as a result leads to
improvement the working environments and performance.

2. Description strategy of the proposed system


The proposed design system are shown in the block diagram of Figure 1. The design using a
MCU type PIC16F887 as a heart control unit of the system has built in analog to digital (ADC) convertor
which receive the temperature from temperature sensor integrated circuit (IC) LM35, where it will control
the three appliance and one alert device according to the environmental temperature changes which is
calculated according to the setting values in the programming. The LM35 sensor connect to pin RA2 of
PORTA of the (MCU) this pin must be setting as analogue input by TRISA and ANSEL register by the
program setting. The LCD display connected as 4 bit mode, the 4 bit mode means connects data pins,
D4 to D7 of LCD to MCU, in this design connect to PORTD of MCU. RC0 to RC2 from PORTC of
MCU selected as a control pins connected to driver as a current source and then to relay in order to work
the selected appliance required according to program statements. RC3 connect to alert driver to generate
alert signal when the temperature degree exceed to 35 centigrade.

Figure 1. Block Diagram of the Proposed System

For purpose to supply electric power to operating the hardware electronics design circuit, five volts power
supply is needed. Figure 2 schematic diagram showing the circuit that performs that purpose for the
proposed system.

Figure 2. Power supply schematic

APTIKOM J. CSIT Vol. 2, No. 2, 2017 : 77 – 85


APTIKOM J. CSIT ISSN: 2528-2417  79

2.1. LM35 and PIC interfacing


Many of the commonly used sensors available these days include remote sensing, infrared,
accelerometer, humidity sensors, temperature sensors and many others (motion sensors, alcohol sensors,
gas sensors and touch screens). Most of these sensors are analogue in their natural work. This means that
it gives direct and linear changes in the output voltage proportional to amount of sensor and according to
there environment working conditions. In case of LM35 temperature sensor the output voltage varies
according to the temperature change so that if the output voltage is 10mv per one degree centigrade, that
means if output is 100mv then the temperature is 10 degrees. Therefore it is very important to know how
to interface LM35 sensor with PIC16F887 MCU in order to exit with a right decision. The interfacing is
needed because most of MCUs are digital device. This means if the input level greater than 2.5v therefore
the device work as the input with high state logic one and if it is below this level (2.5v) the device read as
logic low (zero volt). Based on the clarifications above it is impossible to measure voltage directly from
MCUs. Therefore, to find solutions to this problem, the manufacturers and designers of MCUs put the
mechanism of conversion analog to digital (ADC) within most currently MCUs available in the markets.
In this case the analog voltage is converted to a corresponding number so that it can be handled and
processed in MCUs without any problem. These facilitate easy interaction approximately to all types of
analog devices with MCUs. The resolution represent a very another important element for ADCs.
Because it determines the accuracy of the "ADC" measurement of input analog signals. Commonly ADCs
used are eight bit, ten bit and twelve bit. If the reference voltage of ADC is logic zero (0 volt) to logic
high (5 volt) then a 10 bit ADC will stop it in 1024 division so the accurately that can measure up to
5/1024 = 4.8mv approx. Another important factor for working with ADC is the reference voltage
(ADCRV). Determining the minimum and maximum limits for voltages of analog inputs has specified by
ADCRV. The PIC16F887 contains two reference voltage, the first called the positive reference voltage
(+Vref), which represents the upper or maximum limit of the incoming analog input signal voltage and
the second represents the negative reference voltage (–Vref), which represents the minimum input analog
signal voltages. Therefore, in most simple applications, this –Vref is linked to the GND and the + Vref
connected to VCC. To activate PIC16F887 to work as 10 bit ADC, the ADC unit must gives us the value
between (0 to 1023) for input voltage range of zero to five volt. So if the reading is zero then the input is
zero volt, if the reading is 1023 then the input is 5 volt.

2.2. Suggested flow chart


The logical representation of the proposed system software code has been presented in the
flowchart as illustrated in Figure 3.

Figure 3. Flowchart of the system

Design and Simulation of Automatic Temperature Control and… (Jabbar Shaati Jahlool)
80  ISSN: 2528-2417

In the suggested flowchart clearly shows how the temperature control system working for control of three
appliance (heating, ventilation and cooling) and one alert system depend on the temperature input value.
The work of those functions can be illustrated as follows:
1. IF the temperature degree less than 18 centigrade, the case one will work that enable the heating
system.
2. IF the temperature degree range between 18 and 28 centigrade the system in second case will work
that enable the ventilation system.
3. IF the temperature degree between the range 28 and 35 centigrade the there'd system will work that
enable cooling system.
An addition to three cases above a security factor will added to generate signal to enable alert device this
is done when the temperature increase to grater than 35 centigrade.

3. System Implementation
The suggested system is implemented using PIC16F887 the hardware proposed design
requirements as shows in Figure 4.

Figure 4. Hardware circuit diagram

4. Circuit Implementation Simulation, Testing and Results


The suggested system has been implemented and simulation by using proteus professional
software v8.0 and mikroC PRO FOR PIC program. 16X2 LCD display which is used to display the
system working status. The conditions that are checked and then for the purpose of choosing the type of
work mode are done by relying on the temperature values that are read from the temperature sensor.
The result will output and clear notes by LCD reading and corresponding LED light. This is will carefully
explain in the following working modes of the system:

APTIKOM J. CSIT Vol. 2, No. 2, 2017 : 77 – 85


APTIKOM J. CSIT ISSN: 2528-2417  81

4.1. Start Mode


The circuit diagram in the Figure 4. Above shows the initialize state. This is represent the start
system work that must first initialize all the system cases before the working cases take please, this done
by the initial setting of the program code. At this mode all the relays must be inactivated, all LEDs turn
off and all control signal from PORTC must be at logic zero (disable) and addition of all the above,
the LCD will display the message (System Ready and Start Temp Read ).

4.2. Case 1
The process of this mode are start when the temperature less than 18 centigrade (heating case has
activate) then the heating system will enable. This is clear by the Figure 5 below with enable RCO pin of
PORTC (indicated by a red color) and lighting the LED to indicate the operation of relay to allow
working of heating system and LCD to display the case status that display the word (Case 1 heat and
Temp LT (less than) 18).

Figure 5. Heating System Circuit Diagram

4.3. Case 2
This working mode of the system start when the temperature equal to 18 centigrade and less than
28 centigrade (case 2 will activated i.e. ventilation system will work).
This is clear shown by the Figure 6 below with enable RC1 pin of PORTC (indicated by a red color) and
lighting the LED to indicate the operation of relay to working ventilation system and LCD to display the
case status that display the word (Case 2 Vent and Temp 18 TO 28).

Design and Simulation of Automatic Temperature Control and… (Jabbar Shaati Jahlool)
82  ISSN: 2528-2417

Figure 6. Ventilation System Circuit Diagram.

4.4. Case 3
When the temperature range from 28 to 35 centigrade (case 3 will activated i.e. cooling system
will work). This is clear shown by the Figure 7 below with enable RC2 pin of PORTC (indicated by a red
color) and lighting the LED to indicate the operation of relay to working heating system and LCD to
display the case status that display the word (Case 3 Cool and Temp 28 TO 35).

APTIKOM J. CSIT Vol. 2, No. 2, 2017 : 77 – 85


APTIKOM J. CSIT ISSN: 2528-2417  83

Figure 7. Cooling System Circuit Diagram.

4.5. Alert System


This is another working mode represent a safety feature of the system. It is accomplished when
the temperature will increase to reach the value grater than 35 centigrade, alert signal will generated at the
pin RC3 from PORTC of the MCU to enable the relay driver and lighting attendant LED and so by using
a buzzer to produce the alert tools to work fire system, also display the word (Alert and Fire Fire) will
write at the LCD display. All process of this mode are shown in the Figure 8 below.

Design and Simulation of Automatic Temperature Control and… (Jabbar Shaati Jahlool)
84  ISSN: 2528-2417

Figure 8. Fire system circuit

All system working cases resulting may be summarized at Table 1 below:

Table 1. System working cases

APTIKOM J. CSIT Vol. 2, No. 2, 2017 : 77 – 85


APTIKOM J. CSIT ISSN: 2528-2417  85

5. Conclusion and Idea for Future


In this paper a proposed ATC simple and low cost for general applications temperature control
system using PIC16F887 was design and simulation. The use of this system helps to maintain the
temperature within certain limits, depending on the automatic control of the operation of the appropriate
system with each temperature change and thus possible to invest in important places such as food
warehouses, medical materials, laboratories, central switches, electronic servers and others that require
maintaining a certain temperature limit without interference or presence of the human factor as well as
guidance and send an alarm when the temperature rise and reach the dangerous stages. Think this system
is very appropriate because of its simplicity and reliability in addition to small size, low cost, low power
consumption in addition to all above facilities can be used for different places. In the future, there are
several possible improvements can be made in order to upgrade the features such as using a GSM I/O
devices to send the alert message for wide word instead of using local alert devices and may be using a
wireless technologies to interface sensor, monitor relays and microcontroller.

References
[1] A. Goswami, T. Bezboruah,T. and K.C.Sarma, “Design of an embedded and implementation of an Embedded
system for monitoring and controlling the intensity of light”, proceeding of the 2008 international conference on
embedded systems and application during july 14-17,2008 at Las Vegas Nevada, USA, Vol.-ESA 2008,
pp.117-123.
[2] A.Goswami, T. Bezboruah, K.C. Sarma., “An Embedded Design for Automatic Temperature Controller”,
International Journal of advanced engineering and application, Jan 2011.
[3] June Tharaphe Lwin1, Aung Ze Ya '' Development of Microcontroller Based Temperature and Lighting
Control System in Smart Home'' International Journal of scientific engineering and technology research July-
2014 pages: 3322-3327.
[4] N. A. A. Hadi, M. H. C. Hasan, N. M. Z. Hashim, A. Salleh, A. A. Salam, Z. Hasan '' Automatic Smart Kitchen
System Using Microcontroller'' International Journal for Advance Research In Engineering And Technology
Volume 3, Issue VI, June 2015 ISSN 2320-6802
[5] S.R.Sharma1, P.B.Dahikar "embedded design of temperature controller using PIC 16F876A for industries and
laboratories" International Journal of Innovative Research in Computer and Communication Engineering Vol.
1, Issue 10, December 2013.
[6] Bogdan Levărdă and Cristina Budaciu, “The Design Of Temperature Control Systemusing Pic18f4620"
Buletinul Institutului Politehnic Din Iasi Publicat de Universitatea Tehnică „Gheorghe Asachi” din Iasi Tomul
LVI (LX), Fasc. 4, 2010 SecŃia Automatică si Calculatoare.
[7] Mustafa Saad, Hossam Abdoalgader, and Muammer Mohamed ''Automatic Fan Speed Control System Using
Microcontroller'' 6th Int'l Conference on Electrical, Electronics & Civil Engineering (ICEECE'2014)
Nov. 27-28, 2014 Cape Town (South Africa).
[8] Theophilus Wellem and Bhudi Setiawan '' A Microcontroller- based Room Temperature Monitoring System''
International Journal of Computer Applications (0975 – 8887) Volume 53– No.1, September 2012.
[9] Vaibhav Bhatia and Gavish Bhatia “Room Temperature based Fan Speed Control System using Pulse Width
Modulation Technique" International Journal of Computer Applications (0975 – 8887) Volume 81 – No5,
November 2013.

Design and Simulation of Automatic Temperature Control and… (Jabbar Shaati Jahlool)

You might also like