UNIVERSITI TEKNOLOGI MALAYSIA NOTES : * If the thesis is CONFIDENTIAL or RESTRICTED, please attach with the letter
viii 2.2.1 COUNTER 6 2.2.2 MICRCONROLLER 8 2.2.3 SK40C 9 2.2.4 PIC 18F452 13 2.2.5 PIC PROGRAMMER 15 2.2.6 MICROC PRO 17 2.2.7 PICKIT 2
ix 4.3.1 POSSIBILITIES THAT NEED TO BE CONSIDERED 50 4.3.2 PROBLEM OF THE OVERALL SYSTEM 52 5 CONCLUSION AND RECOMMENDATION 55 5.1 INTRODU
x LIST OF TABLES TABLE NO. TITLE PAGE 2.1 Label of Function 12
xi LIST OF FIGURES FIGURE NO. TITLE PAGE 2.1 Counter 7 2.2 Microcontroller 9 2.3 Component connection to SK40C 10 2.4 Wire conn
xii 2.12 PICkit 2 software 19 3.1 Block diagram of overall system 23 3.2 Overall flowchart design 25 3.3 Microc PRO Start Page 28 3.4
xiii 3.16 Call function to display the welcome and greeting 38 3.17 PIC 18F452 type 39 3.18 SK40C board 39 3.19 Distance sensor block diagra
xiv 4.6 a) Fluorescent lamp turn off b) Total occupant equal zero 49 4.7 Counter show negative value 53
xv LIST OF ABBREVIATIONS ADC - Analog Digital Converter A/D - Analog to Digital FKE - Fakulti Kejuruteraan Elektrik UART - Universal Asyn
xvi PC - Personal Computer MCU - Multipoint Control Unit IR - Infrared I/O - Input / Output LED - Light Emitting Diode PIC - Periph
xvii NO - Normally Open NC - Normally Close
“I hereby declare that I have read this thesis and in my opinion this thesis is sufficient in terms of scope and quality for the award of t
xviii LIST OF SYMBOLS cm - Centimeter Hz - Hertz MHz - Mega Hertz uF - Mikro Farad V - Volt KB - Kilo Byte
xix LIST OF APPENDICES APPENDIX TITLE PAGE A PIC MICROCONTROLLER CODE OF COUNTER SYSTEM USING MICROCONTROLLER FOR VISITOR (SK40C) 61 B PIC MI
CHAPTER 1 INTRODUCTION 1.1 PROJECT BACKGROUND In a public place such as shopping malls and cinemas, data on the number of visitor is frequ
2 integration of power electronics components, such as circuits and sensors; and using the integrated components for standardized methods of assembli
3 lighting system in laboratory at Faculty Kejuruteraan Elektrik (FKE) , Universiti Teknologi Malaysia always been detected did not
4 iv. To develop a programming for microcontroller to count up and down visitor traversing a certain passage or entrance which in this case
5 1.5 THESIS OUTLINE This thesis consists of five chapters. In first chapter, it gives an overview with commence on introduction and backgroun
CHAPTER 2 LITERATURE REVIEW 2.1 INTRODUCTION This chapter brief in detail about the tools used and rough overview about this project.
7 in up and down modes depending upon the state of the selector. It can be used to count the number of persons entering a hall in the up mode at entr
8 2.2.2 MICRCONTROLLER A microcontroller is a highly integrated chip which performs controlling functions. A microcontroller, or embe
COUNTER SYSTEM USING MICROCONTROLLER FOR VISITOR NUR FARAHIN BINTI ASA @ ESA A thesis submitted in partial fulfilment of the requirements f
9 Figure 2.2 : Microcontroller [15] 2.2.3 SK40C SK40C is a start up kit for beginner to design and test a system. In this project
10 8. USB on board for certain PIC18F. 9. Users are able to utilize the function of PIC by directly plugging in the I/O components in whatever way
11 3. I/O pins of the SK40C plugged onto a breadboard. Then, I/O pin can be access through the breadboard. Figure 2.5 : SK40C conne
12 Label Function Label Function A DC power adaptor socket I Programmable Push Button B USB Connector J Reset button C Toggle Switch for power su
13 2.2.4 PIC 18F452 This powerful 100 nanosecond instruction execution are easy-to-program with which have 77 single word instruction
14 Figure 2.8 : PIC 18F452 pin diagram [18] Figure 2.9 : PIC 18F452 [19] The basic features of PIC 18F452 are: 1. Consist of 40-pin Programmed D
15 PIC divided into 3 types of memories: i. Program Memory - A memory that contains the program after the program had been burned. As a reminder t
16 family including PIC 18F452. Besides 8bit,16bit and 32bit PIC MCU also can be programmed using this programmer. On board In Circuit Serial P
17 2.2.6 MicroC PRO The mikroC PRO for PIC is a powerful, feature-rich development tool for PIC microcontrollers. It is designed to
18 a) b) Figure 2.11 : a) microC PRO icon b) microC PRO start page software 2.2.7
“I declare that this thesis entitled “Counter System Using Microcontroller for Visitor” is the result of my own research except as cited in
19 by the PICkit 2 is also programmed into program memory locations reserved for the purpose. The PICkit 2 can operate in two hardware configuratio
20 2.3 Related Work i. Street Light Switch the lights on and off automatically during night and day time respectively. This system used Light D
21 iv. Occupancy Detection Count the number of people that enter and exit each room (counter). If the counter is more than zero, l
CHAPTER 3 METHODOLOGY 3.1 INTRODUCTION The software implementation and hardware implementation are explained in detail through this chapte
23 3.2.1 Defining the task and problem Figure 3.1 : Block diagram of overall system The user accesses the abilities of the microcontroller by w
24 devices for a specific project. Within each device family, we usually find a selection of family members, each with different combinations of opti
25 Figure 3.2 : Overall flowchart design
26 First of all, sensor 1 will detect any presence of object. If there are object detected, the microcontroller will proceed to detect senso
27 The system model designed is the key element used in this study. Without proper design and correct model, this study will not be successful. For
28 Figure 3.3 : MicroC PRO start page Click „Next‟ to skip the introduction. Figure 3.4 : First page to create new project For the first st
ii This thesis is dedicated to my loving parents, always be my inspiration. You are the reason I step forward to this stage. To teammate,
29 Figure 3.5 : Selecting the device Next, clock of the device must be setup. For counter system, the suitable device clock is 20 MHz
30 Figure 3.7 : Select the path to save project Click next to proceed until step 5/6 and lastly click finish for the last step. At this moment,
31 After connecting the PIC programmer and the microcontroller, the PICkit 2 programmer is launched in PC. By using PICkit 2, the programming will
32 Figure 3.9 : The hex file is successfully imported to PIC 3.2.3 Testing and debugging This is the most important part. After a program
33 After the PIC 18F452 had been programmed, it placed to the SK40C and connected to input and output to run the system. This chip had b
34 buttons is pressed for a long period (more than 0.5 second), so it means the buzzer will sound on and at the same time RB7 LED will remain lit.
35 Figure 3.10 : Relay circuit diagram Figure 3.11 : Sensor connection to SK40C [10]
36 3.3.3 Type of Call Function Function of analog-to-digital converter to detect presence of object: Figure 3.12 : Analog-to-dig
37 The coding above shows that ADC for the sensor that needed to make sure the output of sensor converted to digital before microprocessor can under
38 Function to display the introduction for the beginning of the system: Figure 3.16 : Call function to display the welcome and greeting
iii ACKNOWLEDGEMENTS Alhamdulillah. In the name of Allah, the Most Compassionate, the Most Merciful. Praise be to Him, the Lord
39 Figure 3.17 : PIC 18F452 type ii. SK40C It is easy to use this hardware where the input and output can be any device. No circuit d
40 iii. Sharp GP2YOA21 This type of sensor is widely used; popular choice for application and development that require accurate distanc
41 output terminal which can then be used to activate any number of devices. For the purpose of this exercise, a small green LED will turn on when t
42 and much more in the market. All these relay have same function but different in specification [6]. Figure 3.21 : Relay schematic diagram
43 Figure 3.22 : Relay Circuit used in Project v. Liquid Crystal Display (LCD) A 16x2 liquid crystal display is used to display the total occupa
CHAPTER 4 RESULT AND DISCUSSION 4.1 INTRODUCTION There are two parts discussed in this chapter which is divided to microcontrol
45 4.2 RESULT Figure 4.1 : Programming successfully compiled The C++ programming is compiled successfully with no error. The full coding can be
46 a) b) c) Figure 4.2 : a) System in off condition b) RB6 LED turn on
47 a) b) Figure 4.3 : a) RB7 LED turn on shows error when RB1 pressed mor
48 ii. Part II This is the result when the completed circuit is implemented on the laboratory door. The first test when an occupant is entering,
v ABSTRACT Nowadays, people often waste energy without realizing it. Home automation concept had been introduced to save power consumption. A co
49 When the last occupant inside the laboratory is leaving, which means there is nobody inside the laboratory, counter count to zero and fluorescent
50 4.2 DISCUSSION 4.2.1 Possibilities that need to be considered During this project, there are many possibilities need to be considered. Ther
51 3. If someone walks in right behind the other person. Unless both of the occupants are literally holding on to each other with no space between
52 7. Function of reset button. A reset button on SK40C can be reset only if the system is unreliable. There are a few possibilities such as the co
53 It will lead to error such that, the counter will be negative value or the counter will never decrease to zero. Counter will be negative due to fa
54 detection range affect the accuracy of the sensor. To overcome this problem, a bright LED can be placed near to the sensor to give extra light at
CHAPTER 5 CONCLUSION AND RECOMMENDATION 5.1 INTRODUCTION In this chapter, the entire objective achieved is explained in brie
56 programming to count up and down visitor traversing a certain passage or entrance is operating successfully. 5.3 RECOMMENDATIONS FOR FUTURE I
57 REFERENCES 1. Jan Axelson Published, The Microcontroller Idea Book, Circuits, Programs, & Applications featuring the 8052-BASIC Micro
58 8. Engineer Garage, Automatic bidirectional visitor counter using 8051 microcontroller (AT89C51). June 2012. http://www.engineersgarage.com/microc
vi ABSTRAK Pada masa kini, manusia sering membazirkan tenaga tanpa disedari. Sistem automatik telah diperkenalkan untuk menjimatkan pengguna
59 17 “SK40C schematic diagram”, Last access: June 2012. http://www.cytron.com.my/usr_attachment/SK40C.Rev2.0.0%20Schematic.pdf 18 “18FXX2 datashee
60 26 Scribd, Introduction to mikroBasic PRO for PIC. June 2012. http://www.scribd.com/ 27 R4R, C Programming. June 2012. r4r.co.on
61 APPENDIX A PIC MICROCONTROLLER CODE OF COUNTER SYSTEM USING MICROCONTROLLER FOR VISITOR (SK40C) //Define port #define sensor1 portb.f0
62 sbit LCD_RS_Direction at TRISB4_bit; sbit LCD_EN_Direction at TRISB5_bit; sbit LCD_D0_Direction at TRISD0_bit; sbit LCD_D1_Direction at TRISD1_bit
63 if((sensor1==0)&&(sensor2==0)) continue; count1++; displayLCD(count1);
64 } error=0; if(count1>0){relay=1;} if(count1==0){ relay=0; } count=0
65 for(i=0; i<16; i++) { // Move text to the left 16 times Lcd_Cmd(_LCD_SHIFT_LEFT); delay_ms(80); } Lcd_Cmd(_LCD_CLEA
66 APPENDIX B PIC MICROCONTROLLER CODE OF COUNTER SYSTEM USING MICROCONTROLLER FOR VISITOR (FULL SYSTEM) //Define port #define error portb
67 sbit LCD_D1_Direction at TRISD1_bit; sbit LCD_D2_Direction at TRISD2_bit; sbit LCD_D3_Direction at TRISD3_bit; sbit LCD_D4_Direction at TRISD4_bit
68 while(1) { readSensor3(); calculateHight(); //display hight LongToStr(Hight,txt2); Lcd_Out(2,1
vii TABLE OF CONTENTS CHAPTER TITLE PAGE DECLARATION ii DEDICATION iii ACKNOWLEDGEMENTS iv ABSTRACT v ABSTRAK vi TABLE OF CONTENTS vii
69 { delay_ms(50); count++; } }
70 //display "Out" Lcd_Out(1,14,"Out"); delay
71 Lcd_Out(2,1," Full "); } if(count1<0) continue; }//while(1) }//main void introduction(void)
72 } void readSensor(void) { int j; for(j = 0 ; j < 10 ; j++) // take analog result for 10 times { s1_va
73 void calculateHight(void) { Vout=(s3_value*500000)/1024; if ((Vout > 43945)&&(Vout < 279785)) // read only fr
Comments to this Manuals