24
CHILD MONITORING SYSTEM (PARENT) NABILLAH BINTI SALEH This thesis is submitted as partial fulfillment of the requirements for the award of the degree of Bachelor of Electrical Engineering (Electronics) Faculty of Electrical & Electronics Engineering Universiti Malaysia Pahang NOVEMBER, 2008

CHILD MONITORING SYSTEM (PARENT) NABILLAH … are about PIC microcontroller, ... 4.2.2 PICKit 2 Software Programmer 26 4.2.3 ISIS 7 Professional 31. x ... EEPROM Electrically Erasable

Embed Size (px)

Citation preview

CHILD MONITORING SYSTEM (PARENT)

NABILLAH BINTI SALEH

This thesis is submitted as partial fulfillment of the requirements

for the award of the degree of

Bachelor of Electrical Engineering (Electronics)

Faculty of Electrical & Electronics Engineering

Universiti Malaysia Pahang

NOVEMBER, 2008

iv

ACKNOWLEDGEMENT

I would like to express my gratitude to Allah with His permission I am done

with my project and it ran smoothly and successfully. Alhamdulillah, His

Willingness has made it possible for me as the author to complete the final year

project in time.

I would like to take this opportunity to give my special thanks to my

dedicated supervisor, Mr Fairuz Rizal bin Mohamad Rashidi for guiding this project

at every stage with clarity, spending much time to discuss and help with this project,

and that priceless gift of getting things done by sharing his valuable ideas as well as

share his knowledge.

I would also like to thank to all UMP lecturers and electrical technicians

whom had helped directly or indirectly in what so ever manner thus making this

project a reality.

Not forgotten are my best colleagues for their openhandedly and kindly

guided, assisted, supported and encouraged me to make this project successful. My

heartfelt thanks to my dearest family which always support and pray on me

throughout this project. Their blessing gave me the high-spirit and strength to face

any problem occurred and to overcome them rightly.

The great cooperation, kindheartedness and readiness to share worth

experiences that have been shown by them will be always appreciated and treasured

by me, thank you.

v

ABSTRACT

Bluetooth technology allowed multiple devices to communicate with each

other or one device could control and manage the other device wirelessly. The Child

Monitoring System (Parent) is one of alarm system which is developed using

Bluetooth technology to monitor child in a certain area which is about 20 meters

radius from the parent. The system is developed due to many cases of missing kids

that happen nowadays in our country. To develop the system, there are several things

needed to be learned. They are about PIC microcontroller, Bluetooth module data

transmission and reception and also the existence system proposed by the other

researchers. The important things to do during developing the system are assembly

of the hardware which contain Bluetooth module as the main component for data

transmission and reception while liquid crystal display (LCD) and buzzer as the

indicator for the status of the child. The PIC microcontroller is acted as a controller

that is reprogrammable and got the most important features to communicate two

Bluetooth which is Universal Asynchronous Receiver Transmitter (UART). The

software used is Microcode Studio to write and compile the PICBASIC

programming language. This system could assist the parent in keeping an eye for

their child whenever needed without the need of any licence.

vi

ABSTRAK

Teknologi Bluetooth membenarkan pelbagai alat berkomunikasi antara satu

sama lain atau satu alat menjadi pangawal dan pengurus alat-alat lain tanpa

menggunakan sebarang wayar. Sistem Pengawasan Kanak-Kanak (Ibu Bapa) adalah

satu sistem penggera yang dihasil menggunakan teknologi Bluetooth untuk

memerhati anak-anak dalam lingkungan 20 meter daripada ibu bapa. Sistem ini

dihasilkan kerana kes kehilangan kanak-kanak di negara ini semakin meningkat.

Bagi menghasilkan sistem ini, beberapa perkara perlu dipelajari antaranya mengenai

pengawalmikro PIC, cara penghantaran dan penerimaan data oleh modul Bluetooth

dan sistem yang telah ada yang telah diusulkan oleh pengkaji-pengkaji lain sebelum

ini. Perkara penting yang perlu dilakukan semasa penghasilan sistem ini ialah

menggabungkan perkakas yang terdiri daripada modul Bluetooth sebagai komponen

utama yang menghantar dan menerima data sementara paparan kristal cecair (LCD)

dan penggera sebagai penunjuk tentang status kanak-kanak. Pengawalmikro PIC

bertindak sebagai pengawal yang boleh diprogram semula dan mempunyai

keistimewaan yang penting untuk dua Bluetooth berkomunikasi iaitu Universal

Asynchronous Receiver Transmitter (UART). Perisian Microcode Studio digunakan

untuk menulis dan menukar bahasa program PICBASIC kepada bahasa mesin.

Sistem ini boleh membantu ibu bapa untuk mengawasi anak-anak apabila diperlukan

tanpa memerlukan sebarang lesen.

vii

TABLE OF CONTENTS

CHAPTER TITLE PAGE

DECLARATION ii

DEDICATION iii

ACKNOWLEDGEMENT iv

ABSTRACT v

ABSTRAK vi

TABLE OF CONTENTS vii

LIST OF TABLES xii

LIST OF FIGURES xiii

LIST OF SYMBOLS xvi

LIST OF ABBREVIATIONS xvii

LIST OF APPENDICES xix

1 INTRODUCTION 1

1.1 Background 1

1.2 Introduction to the Project 1

1.3 Problem Statement 4

1.4 Objective 5

1.4.1 To design and program the parent’s part of

the system to monitor child in the specific

range of area by using Bluetooth

technology 4

1.4.2 To program the microcontroller to

function as desired 4

viii

TABLE OF CONTENTS

CHAPTER TITLE PAGE

1.5 Scope of Project 5

1.5.1 Develop the system only for the parent’s

part 5

1.5.2 Develop the power module to supply

5V to the PIC and Bluetooth module 5

1.5.3 Develop the PIC module that contains

some components such as LCD and

buzzer to indicate the status of the child 5

1.5.4 Develop programming for the system to

function as desired 6

1.6 Thesis Overview 6

2 LITERATURE REVIEW 7

2.1 Personal Monitoring System 7

2.2 Kids Finder through Bluetooth Technology 8

2.3 KC Wirefree Bluetooth 10

2.3.1 Bluetooth Technology and Transceiver 10

2.4 PIC 16F877 12

2.4.1 Addressable Universal Synchronous

Asynchronous Receiver Transmitter

(USART) 12

2.4.1.1 USART Baud Rate Generator 13

2.4.2 I/O Ports 14

ix

TABLE OF CONTENTS

CHAPTER TITLE PAGE

2.5 PICBASIC Language 14

3 METHODOLOGY 15

3.1 Project Methodology 15

3.2 System’s Flow 17

3.3 System’s Diagram 19

4 SYSTEM’S ARCHITECTURE 20

4.1 Hardware Design 20

4.1.1 Power Supply Module 20

4.1.2 PIC Module 21

4.1.3 LCD Display and Buzzer 22

4.1.4 Bluetooth Module with PIC 23

4.2 Software Implementation 25

4.2.1 Microcode Studio 25

4.2.2 PICKit 2 Software Programmer 26

4.2.3 ISIS 7 Professional 31

x

TABLE OF CONTENTS

CHAPTER TITLE PAGE

5 RESULTS AND ANALYSIS 37

5.1 Power Supply Module 37

5.2 PIC Module 37

5.2.1 Blinking Test 38

5.2.2 LCD Test 39

5.2.3 UART Test 41

5.3 Bluetooth Module 42

5.3.1 Functionality Test 42

5.4 System Setting 45

5.4.1 Change Baud Rate 45

5.4.2 Bluetooth Module Setting 48

5.4.3 LCD Setting 49

5.5 Result 50

6 CONCLUSION 54

6.1 Achievement 54

6.2 Advantages and Disadvantages 55

6.3 Future Recommendation 55

6.4 Cost and Commercialization 56

xi

TABLE OF CONTENTS

CHAPTER TITLE PAGE

REFERENCES 58

APPENDICES A - G 60 - 95

xii

LIST OF TABLES

TABLE NO. TITLE PAGE

2.1 Baud Rate Formula 13

6.1 List of Components and Prices 57

xiii

LIST OF FIGURES

FIGURES NO. TITLE PAGE

1.1 Block diagram for Parent’s Part 2

2.1 Host to Host Communications through Bluetooth

Transceiver 11

3.1 Developing the Child Monitoring

System (Parent) 16

3.2 Flowchart on Parent’s Part 18

3.3 Block Diagram on Input and Output

of Microcontroller 19

4.1 Full Schematic Diagram 20

4.2 Power Module Circuit Diagram 21

4.3 Circuit Diagram for PIC Module 22

4.4 Schematic for LCD Display and Buzzer 22

4.5 Schematic for Bluetooth Module and PIC 23

4.6 Board Layout for the Parent’s Part (Master Device) 24

4.7 Board Layout for Bluetooth Module

With 5V Voltage In 24

4.8 Compile the Program 26

4.9 Device Family Selections 27

4.10 Midrange Device Family for PIC 16F877 27

4.11 Import .HEX File and Write Device Button 28

4.12 Import Hex File Dialogue Box 28

4.13 Download Program Progress 29

4.14 File Update Notifications 29

4.15 The Location of the Button on the Programmer

Hardware 30

xiv

LIST OF FIGURES

FIGURES NO. TITLE PAGE

4.16 The Success Downloading Process Notification 30

4.17 Edit Properties for PIC Microcontroller 31

4.18 Program File 32

4.19 File Selection 33

4.20 PIC Microcontroller Sending Data to Bluetooth 33

4.21 Connection Established with Slave Device 34

4.22 Data Receive From Slave Device

(In Range and Tag Attached) 35

4.23 Data Receive From Slave Device

(In Range and Tag Not Attach) 35

4.24 Data Receive From Slave Device (Out of Range) 35

4.25 Connection with Slave Device is Disconnected 36

5.1 Power Supply Module 38

5.2 LCD Test 40

5.3 HyperTerminal Displaying Data Received 42

5.4 HyperTerminal Window 43

5.5 Connect To Dialogue Box 43

5.6 COM Properties Dialogue Box 44

5.7 AT Response from KC Wirefree

Bluetooth Transceiver 44

5.8 Toolbar of HyperTerminal 45

5.9 Dropdown List of Transfer Menu 46

5.10 AT Command to Change Baud Rate 46

5.11 Selection of Change Baud Text File 47

5.12 AT Response for Changing Baud Rate 47

xv

LIST OF FIGURES

FIGURES NO. TITLE PAGE

5.13 Scan for Response from Slave Device Process 50

5.14 Connection with Slave Device Established 51

5.15 Slave Device Attached to Child 51

5.16 Slave Device Not Attach to Child 52

5.17 Child is Out of Range 52

5.18 Connection with Slave Device is Disconnected 53

xvi

LIST OF SYMBOLS

bps Bit Per Second

F Farad

G Giga

Hz Hertz

M Mega

p Piko

V Volts

VDC Volts Direct Current

xvii

LIST OF ABBREVIATIONS

A/D Analog to Digital

AT Attention

BASIC Beginners All Purpose Symbolic Instruction Code

BRG Baud Rate Generator

CD Compact Disc

CODEC Coder Decoder

CRT C Run Time

CTS Clear To Send

D/A Digital to Analog

EEPROM Electrically Erasable Programmable Read-Only Memory

FOSC Frequency Oscillator

GPIO General Purpose Input Output

GPS Global Positioning System

HCI Host Controller Interface

I/O Input Output

IrDA Infrared Data Association

ISM Industrial Scientific Medical

LCD Liquid Crystal Display

OEM Object Exchange Model

PDA Personal Digital Assistant

PIC Peripheral Interface Controller

RAM Random Access Memory

RFID Radio Frequency Identification

RTS Request To Send

RxD Receive Data

SCI Serial Communication Interface

xviii

LIST OF ABBREVIATIONS

SPP Serial Port Profile

TxD Transmit Data

UART Universal Asynchronous Receiver Transmitter

USB Universal Serial Bus

USARTUniversal Synchronous Asynchronous Receiver

Transmitter

xix

LIST OF APPENDICES

APPENDIX TITLE PAGE

A Program for Parent’s Part 60

B Circuit Schematic 64

C PIC16F877 Datasheet 66

D KA7805 Datasheet 82

E KSP2222A Datasheet 85

F LCD Datasheet 87

G AT Command 89

CHAPTER 1

INTRODUCTION

1.1 Background

The Child Monitoring System is a system which is developed using Bluetooth

technology to monitor child in a certain area. The system is separated into two parts.

This thesis will concentrate more on parent’s part while the thesis on child’s part will

be concentrated by other person. Parents have the master device while the child has

the slave device. The master device is sending and receiving data through Bluetooth

module by using some command which is programmed into PIC microcontroller.

The device has liquid crystal display (LCD) and buzzer in order to alarm parents

about their child who probably out of Bluetooth range or the child is drop the slave

device or can be both of the causes.

2

1.2 Introduction to the Project

The system has two main separated parts which are the parents’ part (master

device) and the child’s part (slave part). The master device will send out a

continuous signal to slave device. The slave device will receive the signal and

remains silent but if the signal did not reach, the child will be alerted. In the other

hand, the slave device will also send out signal to the master device so the master

device will receive the signal and remains silent but if the signal did not reach,

parents will be alerted and if the child is no longer wearing the device, the master

device will produce some sort of information to notify the parents about that.

Figure 1.1 Block diagram for Parent’s Part

In this project, master device used PIC Microcontroller to interface with the

Bluetooth module. The program for it has been written using PICBASIC language.

Microcode Studio is used to write and compile the program while PICkit 2 v2.40

programmer is used to program the PIC16F877.

3

1.3 Problem Statement

Nowadays, there are many cases of missing kids in the whole world. Due to

United States Justice Department reports,

797,500 children (younger than 18) were reported missing in a one-year

period of time studied resulting in an average of 2,185 children being

reported missing each day.

203,900 children were the victims of family abductions.

58,200 children were the victims of non-family abductions.

115 children were the victims of “stereotypical” kidnapping. (These

crimes involve someone the child does not know or someone of slight

acquaintance, who holds the child overnight, transports the child 50 miles

or more, kills the child, demands ransom, or intends to keep the child

permanently.)

(National Incidence Studies of Missing Abducted Runaway, and

Thrownaway Children, NISMART, October 2002)

It always happens in the playground, shopping complex and other public area

which have so many people around. It will be worst case if the kid is missing when

the parents are there but doing some other things at the moment. Parents are unable

to monitor all their children especially when they have more than one child in

crowded and wide area simultaneously. Other, parents’ line of sight is limited.

4

1.4 Objectives

There are two objectives for this project.

1.4.1 To design and program the parent’s part of the system to monitor child in the specific range of area by using Bluetooth technology

The Bluetooth technology has some specific range for its coverage normally

measured in meter of its radius. It also has some protocols and steps to allow this

Bluetooth work smoothly. This project is done by designing the circuit and

programming the controller so that the parents would know the status of their child

whether their child is still in the range and wearing the slave device or the child just

step out of the range and dropping the slave device.

1.4.2 To program the microcontroller to function as desired

The microcontroller used in this system is PIC microcontroller. The program

is downloaded and other devices are integrated with the PIC microcontroller.

5

1.5 Scope of Project

This Child Monitoring System which is specifically for the parent’s part has

four scopes.

1.5.1 Develop the system only for the parent’s part

The master device has to search and initiate connection with the slave device

by creating the SPP connection. SPP is used for host to communicate with Bluetooth

module and its understanding language is AT command.

1.5.2 Develop the power module to supply 5V to the PIC and Bluetooth

module

The main components such as PIC microcontroller, SKKCA Bluetooth

module and LCD need only 5VDC power supply to function correctly. If the supply

is over than 5VDC, they could damage.

1.5.3 Develop the PIC module that contains some components such as LCD

and buzzer to indicate the status of the child

The alarm in this system contains LCD and buzzer to indicate the status of

the slave device. There are three conditions set which only two of them will trigger

the alarm. They are when the slave device is not attached to the child but it is in

range and another one is the slave device is out of range. The one condition where

the slave device will remains silent is when the slave device is attach to the child and

at the same time is in Bluetooth range.

6

1.5.4 Develop programming for the system to function as desired

The programming is developed and burned into PIC microcontroller to do the

data transmission serially and to do other jobs such as trigger the alarm. The

Bluetooth also need a specific program that must be written into PIC microcontroller

to be able to communicate with another Bluetooth.

1.6 Thesis Overview

This Child Monitoring System (Parent) final thesis is a combination of 6

chapters that contains and elaborates specific topics such as the Introduction,

Literature Review, Methodology, Architecture, Result and Analysis, Conclusion and

Further Development that can be applied in this project.

Chapter 1: basically about the introduction of this project.

Chapter 2: describe about the literature review for the development of the

Child Monitoring System (Parent)

Chapter 3: discuss on the full methodology of this project.

Chapter 4: discuss about the architecture of the project that consist the

hardware design and the software implementation.

Chapter 5: discuss all the results obtained and the limitation of the project.

All discussions are concentrating on the result and performance of

the Child Monitoring System (Parent).

Chapter 6: discuss the conclusion and further development of the project.

CHAPTER 2

LITERATURE REVIEW

This chapter reviews about the study that have been done before developed

the Child Monitoring System. Some of them are about the systems that are look

alike this Child Monitoring System. Other, they are the study about the main

components used.

2.1 Personal Monitoring System

From the article published on January 08, 2008 by Ong Dee Nai, the Personal

Monitoring System is a proposed system to assists parents in keeping an eye on their

children while shopping. The system consist two separated parts which are master

monitoring device and one or more slave devices. Both parts are Bluetooth-capable

device. Master device could be either stand-alone or built into mobile phone carried

by parents and slave device could be attached to a child. The both devices will

communicate continuously and remain silent. Whenever one or more slave devices

are found out of predetermined Bluetooth range, the master device will emit some

notification like audible sound. The slave device could also be designed to emit an

audible alert to assist the parent in locating one or more of the children.