BST SENSOR APPLICATION: PROGRAMMABLE NIGHT LAMP WITH MORNING ALARM KHAIRUNNEESA HANIE BINTI OTHMAN SCHOOL OF MICROELECTRONIC ENGINEERING UNIVERSITI MALAYSIA PERLIS 2007
BST SENSOR APPLICATION: PROGRAMMABLE NIGHT LAMP WITH MORNING ALARM by KHAIRUNNEESA HANIE BINTI OTHMAN Report submitted in partial fulfillment of the requirements for the degree of Bachelor of Engineering (Honours) (Electronic Engineering) MARCH 2007
ACKNOWLEDGEMENT Firstly, praised to Allah the Almighty for His blessing. Without His consent I probably would not able to finish this final year project including this report right on time. I have successfully accomplished what I ve set according to the plan. Here, I would like to take this opportunity to express my appreciation for the continuous support that I have received from various people that are willing to help me throughout the year in order to finish this project succesfully. Next, I am deeply thankful to Dr. Johari Bin Adnan, Associate Dean for The School of Microelectronic that acts as my project supervisor while carrying out this project. He has guided, supported and encouraged me to complete this project. Furthermore, he also give me comment and good suggestion to improve my project performance so that I can produce an outstanding product with high quality and resonable price. Thirdly, I would like to extend my appreciation to all lecturers and teaching engineers who are willing to teach and help me to solve problems for the project part that I m not sure with. Special thanks also goes to Miss Nor Hayati for spending her time to produce the BST Sensor for the use in this project. Without their help hand, this project will become harder. Finally, thanks also to all my friends, laboratory technicians and all people that has contributed to the accomplishment of this project. I am particularly indebted for those who are very concerned with my project progress and achievement. I really appreciate all your kindness and your time. For the name I ve not mentioned here, also thank you very much and all the best. Thank you. i
APPROVAL AND DECLARATION SHEET With the authority given to me, I Dr.Johari Bin Adnan approved that all statement written in this report are true and legal. This project report entitled Automatic Night Lamp With Morning was fully prepared and submitted by Khairunneesa Hanie Othman (Matrix Number: 031030154). All knowledge, data and engineering practices that stated in this report are gained throughout the project period. This project including the report is a satisfactory in terms of scope, the end product, quality and presentation as partial fulfillment of the requirement for Bachelor of Engineering (Honours)(Electronic Engineering) in Universiti Malaysia Perlis. Checked and Approved by (DR. JOHARI BIN ADNAN) Project Supervisor School of Microelectronic Engineering Kolej Universiti Kejuruteraan Utara Malaysia March 2007 ii
APLIKASI PENGESAN BST: LAMPU MALAM DENGAN PENGGERA BOLEH ATURCARA ABSTRAK Pengesan BST berpotensi yang dihasilkan di Makmal Fabrikasi UniMAP terbiar daripada sebarang usaha pemajuan walaupun mempunyai percirian yang baik. Dengan itu, matlamat utama projek ini adalah untuk menghasilkan model sistem aplikasi bertajuk Lampu Malam Dengan Penggera Boleh Aturcara yang meggunakan pengesan BST tersebut bagi meninjau prestasi serta potensi komersial selain daripada mengkaji ciri-ciri utama pengesan dan perunsurannya. Secara umum, projek ini melibatkan pembangunan litar dan perkakasan berserta perisian berkonsepkan penggabungan lampu malam dan penggera. Sistem ini boleh diaturcara dan bersaiz kecil dengan kos yang berpatutan. PIC16F876 sejenis alat pengawal-mikro digunakan untuk tujuan kawalan sistem operasi mempunyai persisian antara muka dan mempunyai banyak kelebihan selain penggunaan tenaga yang rendah. Pengesan berkenaan telah diuji bagi mendapatkan data dan maklumat berkaitan sifat dan cirinya. Data masukan bagi sistem ini adalah keamatan cahaya yang akan diproses dan dikawalselia oleh alat pengawal-mikro. Kekangan utama dalam menghasilkan projek ini adalah masalah kepekaan pengesan, julat optimum yang kecil dan kebolehulangan yang tidak tetap. Oleh itu, kajian lanjut berkenaan pengesan dan tindakan pembaikpulihan perlu dijalankan dan diteliti semula sebelum model sistem aplikasi boleh dilakukan dengan baik untuk tujuan pembangunan. iii
BST SENSOR APPLICATION: PROGRAMMABLE NIGHT LAMP WITH MORNING ALARM ABSTRACT A high potential BST Sensor fabricated at UniMAP s Clean Room was left unused from any further development even though it has good characteristics. The main aim for this project is to develop an application system prototype entitled Programmable Night Lamp with Morning Alarm utilizing this sensor to observe its performance and commercialization potential. Further aim is to investigate BST sensor parameters and its properties. Basically, this project involved development of software and hardware with a concept when combining night lamp and alarm to make a complete system. The system is programmable, small in size and low cost. To build the system, early research and bottomto-up design approaches are taken. PIC16F876, a microcontroller from Microchip is used in this project because it has the processor, peripherals interface and other features in single chip with low power consumption. The sensor itself was tested to gain as many data and characteristics as possible. The input of the system will be the light intensity that determines the output derived by the controller. Sensitivity, optimum range and repeatability have been the major constraint during this project implementation. Therefore, further research and improvement of the sensor are crucial to further develop this system. iv
TABLE OF CONTENTS ACKNOWLEDGMENT APPROVAL AND DECLARATION SHEET ABSTRAK ABSTRACT TABLE OF CONTENTS LIST OF TABLES LIST OF FIGURES LIST OF ABBREVIATIONS Page i ii iii iv v viii ix x CHAPTER 1 INTRODUCTION 1.1 Problem Statement 1 1.2 Project Aim 2 1.3 System Overview 2 1.3.1 Functionality 3 1.3.2 Operation 3 1.3.3 Features 4 1.4 System Elements 5 1.4.1 Power 5 1.4.2 Processor 5 1.4.3 Software 6 1.4.4 Serial Port 7 1.4.5 Differential Amplifier 7 1.4.6 Analog-To-Digital Converter 8 1.5 Project Management 9 v
Page 1.6 Report Organization 9 CHAPTER 2 LITERATURE REVIEW 2.1 Transducer 10 2.2 Light Sensitive Devices 11 2.2.1 Light Dependant Resistors (LDR) 11 2.2.2 Photodiode 12 2.3 Ferroelectric 13 2.4 PIC Microcontroller 15 2.4.1 Background 15 2.4.2 Assembly Language 17 2.4.3 MPASM Assembler 17 2.4.4 Why Choose PIC? 18 CHAPTER 3 METHODOLOGY 3.1 System Development 20 3.1.1 Hardware 21 3.1.2 Software 22 3.2 Process Flow 23 3.2.1 Literature Review/Requirement Analysis 25 3.2.2 Sensor Characteristic Test 25 3.2.3 Designing Signal Conditioning Circuit 29 3.2.4 Circuit Analysis/Testing 29 3.2.5 Assemble of Microcontroller Board 30 3.2.6 Circuit Analysis/Testing 31 3.2.7 Software Development 32 3.2.8 Circuit Integration System Analysis 33 3.2.9 Result/Discussion 33 vi
Page CHAPTER 4 RESULTS AND DISCUSSION 4.1 Sensor Characteristic Test 35 4.1.1 BST Sensor Sensitivity 35 4.1.2 BST Sensor Linearity Voltage Variations 37 4.1.3 BST Sensor Linearity Resistance Variations 38 4.1.4 BST Sensor Repeatability 39 4.1.5 BST Sensor Dynamic Range 40 4.2 Signal Conditioning Circuit Analysis 41 4.2.1 Output Voltage Analysis 41 4.2.2 Gain Calculation 42 4.3 Microcontroller Board Test 45 4.4 Software Development 46 4.5 Circuit Integration System Analysis 47 4.6 Project Constraints and Limitations 48 CHAPTER 5 CONCLUSION 5.1 Summary 50 5.2 Recommendation for Future Project 52 5.3 Commercialization Potential 53 REFERENCES 54 APPENDICES Appendixes A 56 Project Assembly Language Appendixes B 60 Project Part List and Cost vii
LIST OF TABLES Tables No. Page 4.1 Resistance variations with respect to different physical inputs. 36 4.2 Voltage values with respect to light intensity. 37 4.3 Resistance values with respect to light intensity. 38 4.4 Resistance values taken with in a week time period. 39 4.5 BST sensor dynamic range test data. 40 4.6 Output voltage range with a differential amplifier in circuit. 42 4.7 Evaluation results for microcontroller board. 46 4.8 Evaluation results for system analysis. 48 viii
LIST OF FIGURES Figures No. Page 1.1 Signal conditioning circuit. 4 1.2 Differential amplifier circuit. 7 2.1 Resistance variations towards light intensity graph. [9] 12 2.2 A photodiode in simple circuit. [11] 13 3.1 Signal conditioning circuit 21 3.2 Schematic of the system output. 22 3.3 Project flow diagram. 24 3.4 A voltage divider circuit. 26 3.5 A voltage divider circuit with variable resistor. 28 4.1 BST sensor with raisin usage. 36 4.2 New BST sensor without raisin usage. 36 4.3 Voltage versus Light Intensity. 37 4.4 Resistance versus Light Intensity. 38 4.5 A voltage divider circuit used for dynamic range test. 40 4.6 Signal conditioning circuit board. 41 4.7 The microcontroller board that utilizes PIC16F876. 46 4.8 Complete System of this project. 47 4.9 Colorful functioning night lamp at night. 47 ix
LIST OF SYMBOLS, ABBREVIATIONS OR NOMENCLATURE BST DC PWM CPU PIC EEPROM ADC LED LDR Barium Strontium Titanate Direct Current Pulse Width Modulation Central Processing Unit Peripheral Interfaces Communication Electrical Erasable Programmable Read Only Memory Analog-to-Digital Conversion Light Emitting Diode Light Dependant Resistor x