Sei sulla pagina 1di 24

THE AUTOMATED PIC MICROCONTROLLER BASED TEMPERATURE CONTROL OF FAN SPEED DESIGN Nur Khairunnisa Binti Muhammad Alwy

BEKC 2009

I hereby declared that I have read through this report and found that it has comply the partial fulfillment for awarding the degree of Bachelor of Electrical Engineering (Control, Instrumentation and Automation)

Signature Supervisors Name Date

: : . : .

THE AUTOMATED PIC MICROCONTROLLER BASED TEMPERATURE CONTROL OF FAN SPEED DESIGN

NUR KHAIRUNNISA BINTI MUHAMMAD ALWY

A report submitted in partial fulfillment of requirements for the degree of Bachelor in Electrical Engineering (Control, Instrumentation And Automation)

Faculty Of Electrical Engineering UNIVERSITI TEKNIKAL MALAYSIA MELAKA

2009

I hereby declared that this report entitle The Automated PIC Microcontroller Based Temperature Control Of Fan Speed Design is the result of my own research except as cited in the reference. The report has not been accepted for any degree and is not concurrently submitted in candidature of any other degree.

Signature Name Date

: : . : .

To dear mum and dad, Zuraidah Bt Abu and Muhammad Alwy B Mohammad Amin

ACKNOWLEDGEMENT

Alhamdulilah, praise be to Allah, for enabling me to complete this PIC Microcontroller control for home automation system project and report for my Projek Sarjana Muda. I would like to express my profound gratitude to my Final Year Project (FYP) supervisor, Mr. Hyreil Anuar Bin Hj Kasdirin for his invaluable support, guidance, supervision and useful suggestions throughout this report. His contribution, moral support and continuous encouragement enabled me to complete my report successfully. I am indebted to my friends for their aid, ideas and advice and others who helped me in completing this project directly or indirectly. Last, but not least, special thanks extended to my beloved parents, Mr. Muhammad Alwy Bin Mohammad Amin and Ms, Zuraidah Bt Abu, for their love, patience and understanding provided during these years, and also for their great support in difficult moments.

ABSTRACT

This project is to design and develop a The automated PIC microcontroller based temperature control of fan speed design. This project will present the design, construction, development, control and analysis that can be implemented for home automation system. The home automation system is PIC microcontroller based project which focused on a system to automatically control the speed of a ceiling fan according to the surrounding temperature. This ceiling fan system contains combination of sensor, controller, driver and motor with integration of embedded controlled programming which means in this case using PIC16F876A as the main controller. This project also presents the expected performance of the automatic fan system, construction of hardware and software development to gather the performance data. Finally, this system performance will be analysed by comparing performance data to the theoretical. End of this project will produce an advance technology with programmable features and control where the speed of the fan is depending on the changes in room temperature.

ABSTRAK

Project ini adalah bertujuan untuk mereka bentuk dan membangunkan satu Mikrokawalan PIC yang automatik untuk mengawal kelajuan sebuah kipas bergantung kepada suhu sekeliling. Projek ini akan mempersembahkan reka bentuk, pembinaan, pembangunan, kawalan dan analisis yang telah dapat dilaksanakan untuk sistem automasi di rumah. Sistem automasi ini adalah berdasarkan mikropengawal PIC di mana ia menumpukan kepada sebuah system yang secara automatik mengawal kelajuan satu kipas siling berpandukan suhu sekeliling. Sistem ini juga mengandungi gabungan elektronik seperti penderia, pengawalan, pemandu dan motor (iaitu kipas) dengan integrasi pengaturcaraan yang terkawal yang mana dalam projek ini menggunakan PIC16F876A sebagai pengawal utama. Projek ini juga membentangkan tentang prestasi dijangka untuk sistem kipas automatik, pembinaan bagi perkakasan dan pembangunan perisian untuk mengumpul prestasi data. Akhirnya, prestasi sistem ini akan dianalisis dengan membandingkan prestasi data secara teori. Akhir sekali, projek ini akan menghasilkan satu teknologi maju kepada kipas dengan ciri-ciri boleh diprogram dan dikawalan di mana kelajuan kipas adalah terserah perubahan dalam suhu bilik.

TABLE OF CONTENTS

CHAPTER

TITLE DECLARATION DEDICATION ACKNOWLEDGEMENT ABSTRACT TABLE OF CONTENTS LIST OF TABLE LIST OF FIGURE LIST OF ABBREVIATIONS LIST OF APPENDICES

PAGE iii iv v vi viii xi xii xv xvii

INTRODUCTION 1.1 1.2 1.3 1.4 1.5 Background Problem Statement Objectives Scope Of Project Organization 1 2 3 3 4 5 5 5

LITERATURE REVIEW 2.1 2.2 Preface Temperature-Rated Electric Fan

2.3

Types of Speed Variable 2.3.1 Wall-Mounted Control 2.3.2 Pulled-Chain 2.3.3 Remote Controlled 2.3.4 Hand-clapped Control

6 6 8 8 10 12 12 14 16 18 20 21 21 22 23 25 26 30 33 33 35 36 36 37 38 40 45 53

2.4

Type of Controller 2.4.1 Microprocessor 2.4.2 Microcontroller 2.4.3 Microchip PIC16F876A

2.5 2.6 3

LM35DZ Temperature Sensor Subsumtion

METHODOLOGY 3.1 3.2 3.3 3.4 Preface Project Flowchart Practice of Project System Development 3.4.1 Hardware Development 3.4.2 Software Development 3.4.3 Firmware Development 3.5 3.6 Project Operation Subsumtion

RESULT AND ANALYSIS 4.1 4.1 4.2 Preface Project Analysis Hardware Analysis 4.2.1 12V and 5V Power Supply Circuit 4.2.2 PIC16F876A Basic Circuit 4.2.3 Temperature Sensor Circuit 4.2.4 External Equipment Drive

Circuit 4.2.5 Motor (Fan) Drive Circuit 4.2.6 Interface PIC16F876A With LCD (2 16 Characters) 4.3 Software Analysis 4.3.1 PIC Basic Programming 4.3.2 ADC Programming 4.3.3 Threshold for ADC Input 4.3.4 Multiple ADC Input 4.3.5 LCD Output Display 4.4 4.5 Firmware Analysis 4.4.1 Serial Interface Subsumtion Thresholds for

58 62 69 74 75 76 80 82 86 87 87 88

CONCLUSION AND RECOMMENDATION 5.1 5.2 Conclusion Recommendation 88 88 88 93 95

REFERENCE APPENDICES

LIST OF TABLE

NO 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9

TITLE The output waveforms for power supply circuit. The capacitor selection for crystal operation. The RC oscillator component selection The VOUT result from the experiment. The measured value of output voltage of LM35DZ. The voltage supply to motor. The motor operation. The operation of H-Bridge. LCD driver Pin out

PAGE

40 47 50 55

57 65 66 68 71

LIST OF FIGURE

NO 2.1 2.2 2.3 2.4

TITLE Wall-mounted control of ceiling fan Pulled-chain of ceiling fan Remote control of ceiling fan The schematic diagram of (a) Transmitter and (b) Receiver for Infra-red remote control [27].

PAGE 7 8 9 10 11 13 15 16 18

2.5 2.6 2.7 2.8 2.9 3.1

Hand-clapped control of ceiling fan Microcomputer Architecture [2]. Components of a typical full-featured microcontroller The pin diagram of PIC16F873 microcontroller (a) Appearance and (b) Symbol of LM35DZ. The Automated PIC based Temperature Control of Fan Speed Design and Construction

22

3.2 3.3 3.4 3.5 3.6

The block diagram for PIC microcontroller based fan. The flow chart for hardware work process. Illustration of automatic PIC based temperature control of speed for ceiling fan. The flowchart for the software development. The process of the automatic ceiling fan 29 31 34 25 26

process. 4.1 The schematic diagram of the microcontroller based fan temperature control system. 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10 4.11 4.12 4.13 4.14 4.15 4.16 4.17 4.18 4.19 4.20 Block diagram of the microcontroller based fan temperature control system. The 5V and 12V power supply circuit. Output voltage from 5V power supply circuit. Output voltage from 12V power supply circuit. The power supply block diagram. The basic circuitry for Microchip PIC16F876A microcontroller. Crystal operation as clock oscillator. The RC mode circuitry. The reset circuit with external reset button. The simple Reset circuit by using the Power on Reset. The temperature sensor (LM35) interface with PIC16F876A. Full-Range Centigrade Temperature Sensor. The Temperature vs. Output Voltage Graph. The schematic diagram of temperature sensor (LM35) circuit. The VOUT reading at room temperature. The oscillating temperature sensor display. The basic external drive circuit. The operation of external equipment drives circuit. The transistor switch (a) cut-off open switch (b) saturation-closed switch. 60 59 56 56 57 58 53 54 55 52 45 47 49 51 43 43 39 40 42 38

4.21 4.22

The external drive circuit using optocoupler. The motor drive circuit used in the microcontroller based fan temperature control system.

61

62 63 64 64 65 66 67 68 69 72 73

4.23 4.24 4.25 4.26 4.27 4.28 4.29 4.30 4.31 4.32 4.33

The simplified motor drive circuit. Fan is operating at lower speed in Speed 1. Fan is operating in Speed 2. Fan is operating in Speed 3. The connection of motor and relay. The basic structure of an H-bridge. The pin connection of L293B H-Bridge Motor Driver. The circuit diagram of LCD display. LED as speed output display. The 7 segment as output display for speed and room temperature reading. The flow chart of the overall software for the microcontroller based fan temperature control system.

74 77 77 80 81 82 83

4.34 4.35 4.36 4.37 4.38 4.39 4.40

The simulation to test the ADC programming. The flow chart for ADC programming. The threshold for ADC input circuit construct in PROTEUS 7. The flowchart of combination of ADC with LED output indicator. The multiple thresholds for ADC input. The flow chart for multiple output indicators. The actual requirement for the microcontroller based fan temperature control system.

85 87

4.41

The circuit diagram of RS232 with

PIC16F876A. 5.1 5.2 The microcontroller based fan temperature control system. The more sophisticated microcontroller based fan temperature control system. 91 90

LIST OF ABBREVIATIONS

UTeM FYP PIC PWM CCP AC DC IR VLSI CPU I/O IC RAM ROM A/D D/A EPROM EEPROM MCU SFR PWM LED PC LCD ADC

- Universiti Teknikal Malaysia Melaka - Final Year Project - Peripheral Interface Controller - Pulse Width Modulation - Capture/ Compare/ PWM - Alternate Current - Direct Current - Infra-Red - Very-Large-Scale-Integration - Central Processor Unit - Input/Output - Integrated Circuit - Random Access Memory - Read Only Memory - Analog-To-Digital - Digital-To Analog - Erasable Programmable Read-Only Memory - Electrically Erasable Programmable Read Only Memory - Microcontroller - Special Function Register - Pulse Width Modulation - Light Emitting Diode - Personal Computer - Liquid Crystal Display - Analog to Digital Converter

EMF NC NO VB TX RX RC XT HS LP POR RS EN R/W DDRAM

- Electromagnetic Field - Normally Close - Normally Open - Visual Basic - Transmit Data - Received Data - Resistor/capacitor - ceramic resonator - High speed crystal or ceramic resonator - Low power crystal - Power On Reset - Register Selection - Enable - Read write - Display Data Ram

LIST OF APPENDICES

NO A B C D E F

TITLE PIC16F876A Configuration Project Gantt Chart ADC Programming Threshold for ADC Input Programming Multiple Threshold for ADC Input Programming The CCS C language programming Automated PIC Microcontroller Based Temperature Control Of Fan Speed Design

PAGE 95 97 99 100 101

102

The Hardware for the Automated PIC Microcontroller Based Temperature Control of Fan Speed Design 104

CHAPTER 1

INTRODUCTION

1.1

Background Electric fan is defined as a device used to produce airflow for the

purpose of creature comfort, ventilation, exhaust, or any other gaseous transport. Meanwhile, a ceiling fan is a device suspended from the ceiling of a room, which employs hub-mounted rotating paddles to circulate air in order to produce a cooling or destratification effect. The first ceiling fans appeared in the 1860s and 1870s, in the United States. At that juncture, they were not powered by any form of electric motor. Instead, a stream of running water was used, in conjunction with a turbine, to drive a system of belts which would turn the blades of two-blade fan units. Afterwards, the electrically-powered ceiling fan was invented in 1882 by Philip Diehl. Electric fans are designed to create a breeze and circulate air in a room. A good fan can make a room feel 10-15 degrees cooler when used properly [26]. Electric fans are pretty simple in their design and function. An electric motor spins the blades, which are shaped to move air from the back of the fan out through the front of the fan. The important parts of a ceiling fan are the electric motor, paddles or blades, down rod and switches.

Since a fan creates its cooling effect by speeding, thus, the most important part of a fan is its speed controller. Electric fan come in a different ways of operating method, that is depend on the manufactures and style. The conventional fans are operated by pull-chain control or capacitor-stepped wall control. In contemporary day nowadays, a luxurious feature offered on many modern ceiling fans that speed is controlled by the hand-held wireless remote control. These types of fan are typically has three or five of speed control. Most ceiling fans sold in recent years have switch for turned the fan on and off operation together with adjust the speed at which the blades rotate. This invention relates to the field of devices for moving air in enclosed spaces. More particularly it relates to an automatic PIC controlled fan. The PIC microcontroller based ceiling fan is automatically switching the speed of fan rotating according to the environment temperature changes. This project is as further step for developing a smart home technology by fulfilling the requirement of technologies tomorrow will be more advanced than today.

1.2

Problem Statement Modern electronics has provided the consumer with the ability to

remotely control a variety of household appliances. However, there has not yet been exploited with automatic control of ventilation devices, or more particularly to the control of fans speed. In operation to control speed a fan, it is often necessary to physically adjust the fan in order to increase the degree of ventilation provided, or substantially change the direction of air flow. The ability to automatically change the speed of fan via changes of surroundings temperature would allow the user to feel comfort without physically to change the speed of fan. The automatic control of this operation would further aid in the use of such a fan by those who are sick, handicapped or elderly. Moreover, this

device is very suitable to be used in extensive area, hospital and childrens room. PIC microcontroller based ceiling fan is as further step to improve the technology of a fan. This new invention will satisfy a person needs to make life easier and better. All the mundane household chores are done without having to think about those works.

1.3

Objectives The aim of this project is to design a home automation system that is

ceiling fan based on the advanced technology without only using choke. The main objectives are: To design and develop a hardware and software of PIC microcontroller based ceiling fan To determine how PIC microcontroller based ceiling fan is useful to all user To identify the problem during use a PIC microcontroller based ceiling fan To analyse the output of the PIC microcontroller based ceiling fan

1.4

Scope Of Project This FYP project entitled The Automated PIC Microcontroller Based

Temperature Control of Fan Speed Design is divided into two parts: FYP 1 and 2. This project will be conducted throughout the final year of the undergraduate program with FYP 1 and 2 conducted throughout the first and second semester respectively.

The emphasis is on the design, construction, development and analysis for one of automation system that can be implemented at our home. Besides that, the PIC microcontroller is also introduced in this report. The other aspect such as maintenance and marketing will not be covered in this report.

1.5

Organization This report is a progress report as the project The Automated PIC

Microcontroller Based Temperature Control of Fan Speed Design is a one year project. Hence, this report basically reports and documents the process and tasks accomplished through out FYP 1 and 2. The organisation of this report is as follows: First, Chapter 1 describes the background, problem statement objective and scope of the project. Second, Chapter 2 presents the literature review for this project, analyse the information about the article that related to the project design and discusses the advantages and disadvantages of automatic PIC based temperature control of speed for a ceiling fan. Next, Chapter 3 explains about methodology of the project; it includes of material, project block diagram, flowchart and procedure of automatic PIC based temperature control of speed for a ceiling fan. Subsequently, Chapter 4 will be explains the result gets from doing this project and analysis about hardware, software and firmware development that adapted into this project. Conclusion about the project and recommendation for future research for the project are stated in Chapter 5.

CHAPTER 2

LITERATURE REVIEW

2.1

Preface This chapter suppose explain the studies on paper or journal which

made by persons or those similar projects that has been undertaken by one company. In this case there are no related journals and papers, thus, the literature review that has been is based on the operation that related on the speed variable for the conventional ceiling fan. Apart from that, this chapter also contains study and information on involved main components theory in implementing this project. This study is conducted would be to ensure this project can be implemented smoothly and orderly.

2.2

Temperature-Rated Electric Fan Most of the common temperature-rated electric fans that exist in the

marketplace have largely been fitted with integrated circuit components as the temperature control circuit. Some of the widely used temperature-control components are pulse-rated fabrication technique that not only do not offer a dependable temperature control effect but can produce excessive electromagnetic noise at low cycles.

Potrebbero piacerti anche