Development of fuzzy logic temperature microcontroller, MFA Latip

Tags: LM35 temperature sensor, acrylic container, Personal Computer Integrated Circuit Programmable Integrated Circuit, fuzzy control, temperature data, Acrylic plate, temperature, control system, circuit board, Fan control circuit, probability theory, set membership, function block, empirical knowledge, microcontroller, fuzzy logic, electronic engineering, programming, manufacturing process, Degree of Truth, mathematical model, hardware construction, fuzzy set theory
Content: DEVELOPMENT OF fuzzy logic TEMPERATURE MICROCONTROLLER MUHAMMAD FARHAN BIN ABDUL LATIP This report is submitted in partial fulfillment of the requirement for the award of Bachelor of Electronic Engineering (Computer Engineering) With Honours Faculty of Electronic and Computer Engineering Universiti Teknikal Malaysia Melaka April 2010
UNIVERSTI TEKNIKAL MALAYSIA MELAKA FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER BORANG PENGESAHAN STATUS LAPORAN PROJEK SARJANA MUDA II
Tajuk Projek Sesi Pengajian
: Development of Fuzzy Logic Temperature Microcontroller : 2009/2010
Saya MUHAMMAD FARHAN BIN ABDUL LATIP mengaku membenarkan Laporan Projek Sarjana Muda ini disimpan di Perpustakaan dengan syarat-syarat kegunaan seperti berikut: 1. Laporan adalah hakmilik Universiti Teknikal Malaysia Melaka. 2. Perpustakaan dibenarkan membuat salinan untuk tujuan pengajian sahaja. 3. Perpustakaan dibenarkan membuat salinan laporan ini sebagai bahan pertukaran antara institusi pengajian tinggi. 4. Sila tandakan ( ) :
SULIT* TERHAD**
*(Mengandungi maklumat yang berdarjah keselamatan atau kepentingan Malaysia seperti yang termaktub di dalam AKTA RAHSIA RASMI 1972) **(Mengandungi maklumat terhad yang telah ditentukan oleh organisasi/badan di mana penyelidikan dijalankan)
TIDAK TERHAD
Disahkan oleh:
__________________________ (TANDATANGAN PENULIS)
___________________________________ (COP DAN TANDATANGAN PENYELIA)
Tarikh: .............................
Tarikh: .............................
iii
"I hereby declare that this report is the result of my own work except for quotes as cited in the references."
Signature Author Date
: ...................................................... : ...................................................... : ......................................................
iv
"I hereby declare that I have read this report and in my opinion this report is sufficient in terms of the scope and quality for the award of Bachelor of Electronic Engineering (Computer Engineering) With Honours."
Signature
: ......................................................
Supervisors Name : ......................................................
Date
: ......................................................
v ACKNOWLEDGEMENT Firstly, I would like to praise to Allah S.W.T. for making my job run smooth and success. Next I wish to credit to Mrs. Sharatul Izah Binti Samsudin as my supervisor. My thanks is expended to my beloved family especially to my father, Mr. Abdul Latip Bin Ismail and my mother, Mrs. Hindun Bte Ali for their support. Besides, very grateful to all staff at Universiti Teknikal Malaysia Melaka for guidance and commitment. I really appreciate all efforts and ideas.
vi ABSTRACT In this study, temperature of a closed environment is kept constant by a PIC16F877A. An acrylic container, dimension of 20*20*30 cm is aimed to be cooled by fuzzy logic methods. The microcontroller holds the fuzzy control process. The temperature data is acquired from LM35DZ temperature sensor and the control output determines speed of a 12V fan by means of Pulse Width Modulator (PWM). The heat control system will be used to cool a highly sensitive measurement device. The container is heated by a resistance and heat of the inner environment is increased depending on the outer environment. The microcontroller acquires the temperature data and its control output adjusts the cooling rate of the fan decreasing heat of the inner environment down to the outer conditions. The control system will be used to eliminate the self heating effect of resistors of a measurement device which increases uncertainties in the measurement.
vii ABSTRAK Dalam kajian ini, suhu persekitaran tertutup dikawal oleh PIC16F877A. Sebuah bekas akrilik berdimensi 20*20*30 cm bertujuan untuk disejukkan menggunakan kaedah logik fuzzy. Mikropengawal ini mempunyai proses kawalan fuzzy. Data suhu diperolehi daripada pengesan suhu LM35DZ dan keluaran kawalan menentukan kelajuan kipas 12V dengan menggunakan pemodulat lebar denyut (PWM). Sistem kawalan kepanasan akan digunakan untuk menyejukkan peranti pengukur yang sangat sensitif. Bekas dipanaskan oleh kerintangan dan suhu pada persekiran di dalam bekas meningkat bergantung pada persekitaran di luar bekas. Mikropengawal memerlukan data suhu, dan keluaran kawalannya akan mengubah kadar penyejukan daripada kipas untuk menurunkan suhu persekitaran di dalam bekas sama seperti suhu persekitaran di luar bekas. Sistem kawalan ini akan digunakan untuk menghilangkan kesan pemanasan diri daripada perintang pada peranti pengukur dimana ianya akan meningkatkan ketidak pastian dalam pengukuran.
viii
TABLE OF CONTENT
CHAPTER TOPIC
DECLARATION CONFIRMATION ACKNOWLEDGEMENT ABSTRACT TABLE OF CONTENT LIST OF TABLES LIST OF FIGURES List of Abbreviations
1
INTRODUCTION
1.1 Objectives of Project 1.2 Projects Scope of Works
PAGE iii iv v vi viii xii xiii xvi 2 3
1.3 Organization
ix 4
2
literature review
2.1 Fuzzy Logic Essentials
6
2.2.1 Benefits of fuzzy Logic
6
2.2.2 degree of truth
7
2.2.3 Fuzzy Sets
8
2.2.4 Fuzzy Logic
9
2.2.5 Fuzzy Connective
10
2.2.6 Fuzzy AND Operator
10
2.2.7 Fuzzy OR Operator
10
2.2.8 Fuzzy NOT Operator
11
2.2.9 Fuzzy Rules
11
2.2.10 Takagi-Sugeno Fuzzy Systems
12
2.2 Fuzzy Control
13
2.2.1 Direct Fuzzy Control
14
2.2.2 Supervised Fuzzy Controller
15
2.2.3 Smart Switching Control
16
2.3 LM35DZ Temperature Sensor
17
2.4 Microcontroller 2.5 C programming language 2.5.1 Design 2.5.2 Characteristics 2.6 PIC16F877A Microcontroller
x 18 19 19 20 21
3
METHODOLOGY
3.1 Research and Survey Results
26
3.2 Hardware Design
27
3.3 software development
30
3.4 Integration between Hardware and Software
31
4
RESULTS
4.1 Temperature Sensor Microcontroller Circuit Testing33
4.2 Construction Hardware of Temperature Sensor
Microcontroller
38
4.3 Development Software of Temperature Sensor
Microcontroller
xi 43
5
CONCLUSION AND RECOMMENDATION
49
REFERENCES
51
APPENDIX Basic C Language Programming for Testing Purpose Fuzzy Control C Language for Real Purpose
xii LIST OF TABLES
NUMBER TOPIC
2.1
Comparison of characteristics between PIC16F87XA
families
2.2
Comparison of device features between 16F87XA
families
4.1
Circuits operation based on input temperature
PAGE 23 23 45
xiii LIST OF FIGURES
NUMBER TOPIC
PAGE
2.1
Classic sets
8
2.2
Fuzzy sets
8
2.3
Type of membership functions
9
2.4
Feedback control system with direct fuzzy controller
14
2.5
Nonlinear, fuzzy-rule-based supervisor of a PID controller 15
2.6
Smart switching between conventional controllers,
Takagi-Sugeno controller
16
2.7
LM35DZ temperature sensor
17
2.8
PIC16F877A diagram
22
3.1
Flowchart or work methodology
25
3.2
Direct Fuzzy Control
26
xiv
3.3
Circuit diagram using Proteus software
28
3.4
Circuit during testing mode
29
4.1
Coding for LCD
34
4.2
Coding for sensor
34
4.3
Value on sensor
35
4.4
Value on LCD
35
4.5
Circuit construction using protoboard for testing mode 35
4.6
Testing the functionality of LM35 temperature sensor 36
4.7
Value of temperature displayed on LCD
36
4.8
Circuit during testing mode
37
4.9
Prefabricated PIC circuit board
38
4.10
Prefabricated LCD circuit board
38
4.11
Main Circuit
39
4.12
Fan mounts at container
39
4.13
LED circuit
40
4.14
Sensor circuit
40
4.15
Fan control circuit
40
4.16
Chloroform as joining material
42
4.17
Acrylic plate
42
4.18
Acrylic plate
42
4.19
Acrylic container
42
4.20
Configuration of input-output port
4.21
KnowledgeBase function
4.22
Predicates function
4.23
RuleBase function
xv 44 46 47 48
xvi LIST OF ABBREVIATIONS
OTP ROM -
ALGOL
-
PC
-
IC
-
PIC
-
PWM
-
PID
-
FLC
-
DOF
-
A/D
-
LCD
-
IDE
-
DC
-
One-time Programmable Read Only Memory Algorithmic Language Personal Computer integrated circuit Programmable Integrated Circuit Pulse Width Modulator Proportional Integral Derivative Fuzzy Logic Control Degree of Fulfillment Analog to Digital Liquid Crystal Display integrated development Environment Direct Current
xvii
RISC
-
RAM
-
EEPROM -
BOR
-
CMOS
-
OCG
-
PPM
-
Reduce Instruction Set Computer Random Access Memory Electrically Erasable Programmable Read-Only Memory Brown-Out Reset Complementary Metal Oxide Semiconductor Omniscient Code Generation Parts Per Million
1 CHAPTER 1 INTRODUCTION Nowadays, a technology becomes an essential in our life. Without technology, humans tasks are functionless especially in communication and learning process. human activities are mostly including PC, hand phone, internet, television and others. Some of it will produce heat when used it. The heat capable to damage the inner components of the product that is sensitive to heat such as IC, transistor and capacitor. Sometimes when the heat is too high, it will reduce the work effectiveness of the device used. As a result, this project is proposed. This temperature microcontroller can be implemented to the room or gadget in reducing surroundings temperature thus prevent the heat sensitive components from damage indirectly.
2 In this project, temperature of a closed environment is kept constant by a PIC16F877A. The microcontroller holds the fuzzy control process. The temperature data is acquired from LM35 temperature sensor and the control output determines speed of 220V AC fan by means of PWM and a triac triggering circuits. The heat control system will be used to cool a highly sensitive measurement devise. This project consists of four parts which is the heat control system, output layer, control method, and control program [1]. An acrylic container is aimed to be cooled by a Fuzzy control method. The container is heated by a resistance and heat of the inner environment is increased depending on the outer environment. The microcontroller acquires the temperature data and its control output adjusts the cooling rate of the fan in order to decrease heat of the inner environment down to the outer condition. The control system will be used to eliminate the self-heating effect of the resistors of the measurement device which increases uncertainties in the measurement. 1.1 Objectives of Project 1. To develop programming code of fuzzy logic temperature control system. 2. To design the hardware that have been required for fuzzy logic temperature microcontroller using PIC 16F877A. 3. To implement the programming to the output device. 4. To integrate software and hardware and make it well function.
3 1.2 Project's Scope of Work This project will focus primarily on the several concepts of programming and electronic engineering such as calibration and function of the sensor, programming and microcontroller for the operation of the system besides in setting the quantity of measurement which will be corresponding to the temperature. For programming, it is totally focuings in coding a PIC 16F877A. In addition, hardware and software will be integrated and will be tested the functionality. 1.3 Organization The organization of this report is as follow: Chapter 1 Introduction ­ It is about an introduction of the project, objectives, and scope of works. Chapter 2 Literature review ­ It is mainly explain the concept of the project in details. It is also include the review of several projects that have been made by researchers from other university. With this, we are able to compare and differentiate our project with others especially related to the control approach in developing the temperature microcontroller. Chapter 3 Methodology ­ It is included with block diagram and the system overview.
4 Chapter 4 Results ­ It will cover all the result of testing, hardware construction and software development for this project. Chapter 5 Conclusions and recommendations ­ It concludes the overall project that has been done for this semester and recommend for future upgrade.
5 CHAPTER 2 LITERATURE REVIEW Lots of research by reading the journal, article from the internet and also books in order to give some illustration on how the fuzzy logic application works with the microprocessor. Fuzzy logic is a form of multi-valued logic derived from fuzzy set theory to deal with reasoning that is approximate rather than precise [2]. In contrast with binary sets having binary logic, also known as crisp logic, the fuzzy logic variables may have a membership value of not only 0 or 1. Just as in fuzzy set theory with fuzzy logic the set membership values can range between 0 and 1, in fuzzy logic the degree of truth of a statement can range between 0 and 1 and is not constrained to the two truth values, true (1) and false (0), as in classic propositional logic.
6 2.1 Fuzzy Logic Essentials 2.1.1 Benefits of Fuzzy Logic Fuzzy logic is a technique that attempts to systematically and mathematically emulate human reasoning and decision-making. Fuzzy logic allows engineers to exploit their empirical knowledge and heuristics represented in the "if/then" rules and transfer it to a function block. Fuzzy logic thus provides engineers with a clear and intuitive way to implement control systems, decision-making and diagnostic systems in various branches of industry [3]. Fuzzy logic algorithms can be used for advanced applications in industrial automation such as: Intelligent control system Fuzzy control solutions are especially useful for complex systems where standard means such as PID control fails. Fuzzy logic can be an advantage in cases where an explicit analytical-process model is not available or is too complex. Another advantage of fuzzy logic is that it can be easily combined with conventional controllers and substantially enhance their functionality. For example, fuzzy rules interpolate between a series of locally linear controllers and schedule gains of a PID controller based on changing operating conditions. So fuzzy rules do not have to necessarily replace conventional control methods, but rather extend their capabilities. Process diagnostics, fault detection If an analytical process model is not available or is too complex to be run in realtime, empirical knowledge can be used to classify process conditions and early detect faults.
7 Decision-making and Expert Systems Fuzzy rules can emulate an experienced human operator in real time, for example select appropriate ingredients, components or machines according to specific situations in the manufacturing process. 2.1.2 Degree of Truth Both degrees of truth and probabilities range between 0 and 1 and hence may seem similar at first. However, they are distinct conceptually; truth represents membership in vaguely defined sets, not likelihood of some event or condition as in Probability Theory. For example, let a 100 ml glass contain 30 ml of water. Then we may consider two concepts: Empty and Full. The meaning of each of them can be represented by a certain fuzzy set. Then one might define the glass as being 0.7 empty and 0.3 full. Note that the concept of emptiness would be subjective and thus would depend on the observer or designer. Another designer might equally well design a set membership function where the glass would be considered full for all values down to 50 ml. It is essential to realize that fuzzy logic uses truth degrees as a mathematical model of the vagueness phenomenon while probability is a mathematical model of randomness. A probabilistic setting would first define a scalar variable for the fullness of the glass, and second, Conditional distributions describing the probability that someone would call the glass full given a specific fullness level. This model, however, has no sense without accepting occurrence of some event, for example that after a few minutes, the glass will be half empty. Note that the conditioning can be achieved by having a specific observer that randomly selects the label for the glass, a distribution over deterministic observers, or both. Consequently, probability has nothing in common with fuzziness, these are simply different concepts which superficially seem similar because of using the same interval of real numbers [0, 1].

MFA Latip

File: development-of-fuzzy-logic-temperature-microcontroller.pdf
Author: MFA Latip
Author: Farhan
Published: Thu Apr 26 14:53:01 2012
Pages: 24
File size: 0.33 Mb


ABOUT THE PRODUCTION, 27 pages, 0.53 Mb

, pages, 0 Mb

Avian influenza, 8 pages, 0.33 Mb

Master class, 3 pages, 1.07 Mb
Copyright © 2018 doc.uments.com