i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

21
i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN BIN HASNAN This thesis is submitted as partial fulfillment of the requirements for the award of the Bachelor of Electrical Engineering (Electronics) Faculty of Electrical & Electronics Engineering Universiti Malaysia Pahang NOVEMBER, 2009

Transcript of i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

Page 1: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

i

CONTROL SYSTEM FOR MODERN HOUSE

MOHD HAFIZUDDIN BIN HASNAN

This thesis is submitted as partial fulfillment of the requirements for the award of the

Bachelor of Electrical Engineering (Electronics)

Faculty of Electrical & Electronics Engineering

Universiti Malaysia Pahang

NOVEMBER, 2009

Page 2: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

ii

I declare that this thesis entitled “CONTROL SYSTEM FOR MODERN

HOUSE” is the result of my own research except as cited in the references. The thesis

has not been accepted for any degree and is not concurrently submitted in candidature

of any other degree.

Signature : _________________________________

Name : MOHD HAFIZUDDIN BIN HASNAN

Date : 23 NOVEMBER 2009

Page 3: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

iv

ACKNOWLEDGEMENT

In the name of Allah S.W.T, the most Gracious, the ever Merciful, Praise is to

Allah, Lord of the universe and Peace and Prayers be upon His final Prophet and

Messenger Muhammad S.A.W.

This project would not have been possible without considerable guidance and

support. So, I would like to acknowledge those who have enabled me to complete this

project.

Firstly, I would like to express my great gratitude towards my supervisor, Pn.

Norazila Binti Jaalam who has given me much suggestion, continues advices, support

and help throughout the duration of finishing this project.

Secondly, I would also like to thank for all other Universiti Malaysia Pahang

staff members that I may called upon for assistance since the genesis of this project.

Their opinions and suggestions have helped me in realizing this project. Also not to

be forgotten, I would like to thank for all my friends with the support, valuable

opinion and sharing ideas during the progress of this project.

Finally, special thanks to my beloved family for their understanding,

encouragement and support towards the completion of my project. Thank you so

much!

Page 4: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

v

ABSTRACT

For more and more people, a control system has become a necessary part of

their home and they wouldn't dream of living in a home without one. This trend can

be directly traced from the life style and daily routine which is always busy with

works. People nowadays always want something that can make their life easier. This

project is proposed because it is believed that this project can make people life easier.

This project is also quite interesting as it combines a lot of features such as lighting

control module, mail notification module and door locking system. More important of

this project is low cost. The basic idea for lighting control is when low light intensity

occurs, the control circuit will turn on the light automatically. For mail notification,

the basic idea is when owner received a new mail, the control circuit will play the

voice message. Last but not least, the basic idea for door locking system is when

owner want to go out and into the house, the door will open and close automatically.

Page 5: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

vi

ABSTRAK

Bagi kebanyakan orang, sistem kawalan telah menjadi satu keperluan yang

penting untuk tempat tinggal dan mereka tidak pernah terfikir untuk hidup tanpanya.

Tren ini boleh dikesan terus dari gaya hidup dan aktiviti harian yang selalu sibuk

dengan kerja. Orang sekarang sentiasa mahukan sesuatu yang dapat memudahkan

urusan di dalam hidup mereka. Projek ini diusulkan kerana percaya yang projek ini

dapat memudahkan urusan mereka. Projek ini juga menarik kerana ia adalah hasil

gabungan modul kawalan lampu, modul pemberitahu surat dan sistem pintu berkunci.

Apa yang paling penting ialah perbelanjaan bagi projek ini adalah rendah. Idea awal

bagi bagaimana modul kawalan lampu berfungsi ialah apabila keamatan cahaya

rendah berlaku, litar kawalan akan menyalakan lampu secara automatic. Bagi modul

pemberitahu surat, idea awal ialah apabila pemilik rumah menerima surat, litar

kawalan akan memainkan mesej suara. Idea awal bagi sistem kunci pintu automatic

ialah apabila pemilik rumah mahu keluar atau masuk ke dalam rumah, pintu akan

buka dan tutup secara automatic.

Page 6: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

vii

TABLE OF CONTENTS

CHAPTER ELEMENTS PAGE

DECLARATION ii

DEDICATION iii

ACKNOWLEDGEMENT iv

ABSTRACT v

TABLE OF CONTENTS vii

LIST OF FIGURES x

LIST OF APPENDICES xii

CHAPTER 1 INTRODUCTION

1.1 Overview 1

1.2 Objective of the project 2

1.3 Scope of the project 3

1.4 Problems statement 3

1.5 Thesis outline 4

CHAPTER 2 LITERATURE REVIEW 6

Page 7: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

viii

CHAPTER 3 PROJECT DEVELOPMENT

3.1 Methodology 9

3.2 Hardware Description 12

3.2.1 Power Unit 12

3.2.2 Microcontroller 13

3.2.3 Lighting Control 14

3.2.4 Mail Notification 15

3.2.5 Door Locking 19

3.3 Software Description 22

3.3.1 THRSim11 22

3.3.2 HCLoad 6.0 25

CHAPTER 4 RESULT

4.1 Introduction 27

4.2 Complete Hardware 28

4.3 Controlling Module 29

4.4 Speech Module 30

4.5 Light Intensity Detector Circuit 31

4.6 PIR Motion Sensor 32

4.7 Keypad and Stepper Motor Circuit 33

Page 8: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

ix

CHAPTER 5 CONCLUSION AND RECOMMENDATION

5.0 Conclusion 35

5.1 Future Recommendation 36

REFERENCES

APPENDICES A – M

Page 9: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

x

LIST OF FIGURES

FIGURE TITLE PAGE

3.1a Software and Hardware used in Control 9

System for Modern House Project

3.1b Graphical Illustration 10

3.1c Flow Chart of Control System for Modern 11

House

3.1.2.2 Regulator Circuit 13

3.2.2 Microcontroller Connection Circuit 14

3.2.3 Light Intensity Detector Circuit 15

3.2.4.1.1 IR Transmitter Circuit 16

3.2.4.1.2 IR Receiver Circuit 17

3.2.4.2 Speech Circuit 18

3.2.5.1a Stepper Motor Architecture 20

3.2.5.1b Stepper Motor Connection Circuit 20

3.3.1a THRSim11 Software 23

3.3.1b Open a source code in THRSim11 Software 23

3.3.1c Run and test the source code in THRSim11 24

Software

3.3.2a HCLoad 6.0 Software 25

3.3.2b Graphical User Interface to Erase and Program 26

The data in microcontroller

Page 10: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

xi

3.3.2c Source Code Loading Process in Microcontroller 26

4.2 Complete hardware for Control System for 28

Modern House Project

4.3 Circuit for Motorola MC68HC11E1 controller 29

4.4a Speech Circuit 30

4.4b Infrared Sensor Circuit 30

4.5 Light Intensity Detector 31

4.6 PIR motion sensor 32

4.7a Keypad with Stepper Motor Circuit 33

4.7b Keypad and MM74C922 Decoder Connection 34

Circuit

Page 11: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

xii

LIST OF APPENDICES

APPENDIX TITLE PAGE

A Datasheet for 2SC9013 Transistor

B1 Fresnel lens Dimension

B2 Fresnel lens View

C Datasheet for PIR sensor

D Motorola MC68HC11E1 IC Base Datasheet

E1 Datasheet for ISD1110 Voice Recording

and Playback IC

E2 Datasheet for ISD1110 Voice Recording

and Playback IC

F1 Datasheet for LM741

F2 Datasheet for LM741

G1 Datasheet for Motorola MC68HC11E1

Microcontroller

G2 Datasheet for Motorola MC68HC11E1

Microcontroller

H Datasheet for MAX233

I1 Datasheet for LM555 Timer

I2 Datasheet for LM555 Timer

J1 Datasheet for ULN2003 for Stepper

Motor Driver

Page 12: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

xiii

J2 Datasheet for ULN2003 for Stepper

Motor Driver

K1 Datasheet for MM74C922 for 4x4 Keypad

K2 Datasheet for MM74C922 for 4x4 Keypad

K3 Datasheet for MM74C922 for 4x4 Keypad

L1 Datasheet for LM7805 Voltage Regulator

L2 Datasheet for LM7805 Voltage Regulator

M1 Source Code for Control System for Modern House

M2 Source Code for Control System for Modern House

M3 Source Code for Control System for Modern House

M4 Source Code for Control System for Modern House

Page 13: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

xiv

LIST OF ABBREVIATION

IR Infra Red

CPU Computer processing unit

RAM Random access memory

ROM Read only memory

MC Microcontroller

LED Light Emitted Diode

IC Integrated circuit

DC Direct Current

RPM Revolution per minute

EEPROM Electrically Erasable Programmable Read-Only Memory

EPROM Erasable Programmable Read-Only Memory

COP Computer Operating Properly

LCD Liquid-crystal display

PIR Passive Infra red

LDR Light Dependent Resistor

Page 14: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

1

CHAPTER 1

INTRODUCTION

1.1 Overview

The study design of automatic control systems, a field known as control

engineering is a large and expensive area of study. Control systems and control

engineering techniques have become a pervasive part of modern technical society.

From simple devices as a toaster, to complex machines like space shuttles and

rockets. Control systems are components that are added to other components to

increase functionality or to meet a set of design criteria. Control engineering

sometimes is a part of our everyday life. For more and more people, a control system

has become a necessary part of their home and they wouldn’t dream of living in a

home without one. This trend can be directly traced from the life style and daily

routine which is always busy with works. People nowadays always want something

that can make their life easier.

This project comes out because it is believed that this project can make people

life easier. This project is also quite interesting as it combines a lot of features such as

lighting control, mail notification and door locking system. More important of this

project is low cost. For lighting control system, Light Dependent Resistor (LDR) used

as the sensor, potentiometer for LDR sensitivity and LM 741 used as the driver. The

idea is when LDR received low light intensity, the driver circuit will switch on the

Page 15: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

2

light automatically. The intensity of light at the LDR can be varying by using

potentiometer. For mail notification system, a pair of infra red (IR) is used as the mail

detector and speech circuit as the notifier. When the infra red beam between the

transmitter and receiver cut off by the mail, the control circuit will switch on the

speech circuit and play the voice message. For door locking system, a keypad and PIR

motion sensor used as the input to open and close the door. To make the door open

and close, stepper motor is used. The idea is owner need to press five digit codes on

the keypad to open the door from outside the house. The door then will close

automatically after a certain time. PIR motion sensor used to sense human appearance

to open the door from inside the house. This project used a Motorola Microcontroller

as the brain to operate the system.

1.2 Objective of the project

The objectives of this project are to develop a system that can:

i. Turn on light automatically when low light intensity occur

ii. Turn off light automatically when high light intensity occur

iii. Activate speech circuit to play voice message when receive a new mail

iv. Open or close the door automatically when someone in or out

Page 16: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

3

1.3 Scope of the project

The scopes of this project are:

i. LED indicator/status of the system only can be seeing by owner when

owner is at home

ii. All features will functioning when the system is working

iii. By assuming the modern house has their own backup generator/power,

problem like blackout/no electricity not occur

iv. Using a Motorola Microcontroller (MC68HC11E1)

1.4 Problems statement

In recent years the energy crisis has become one problem which the whole

world must confront. Home power consumption makes up the largest part of energy

consumption in the world. In particular, the power consumption of lamps in a typical

home is a factor which can’t be ignored. The typical user needs different light

intensities in different places. Sometimes the light intensity from outside is sufficient

and thus we don’t need to turn on any light. People sometimes lazy to switch off the

light when woke up in the morning because they think it is not a big problem

especially those who are late/in hurry to go to work. Sometimes the light still on even

it is a day because nobody at home at that time to turn the light off. These factors

cause energy waste. To let the electrical things switch on for a long time unattended

could be a dangerous. People are also facing an acute shortage of electrical power

these days, every now and then there is a power cut in some part of city. If a little

power could be saving from the house, it could be utilized elsewhere. It could be a

good contribution towards national development process.

Page 17: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

4

Sometimes someone/owner that lives in a big house or multi-story buildings

do not know he/she received a new mail because not realize the postman send the

mail in a mailbox. Maybe at that time the owner were in the room or anywhere inside

the house. Owner will never come to know that an urgent letter is lying in the

mailbox, could it be an appointment letter or a call letter for interview or something

like that. Let say if the owner receives very important mail that needs to reply or take

action as soon as possible but does not know he/she has received that mail. Absolutely

the owner will have a big problem and later the problem will affect his/her life.

So, this project is proposed to reduce or to fix the problem. The lighting

control can turn on and off the light automatically based on sensitivity setting by the

owner/user. By that way, owner/user does not have to trouble himself to switch on or

off manually and at the same time, power consumption can be decreased. Mail

notification can inform/notice the owner when he/she receives a new mail by playing

a voice message that can be heard by entire house. So the owner will not miss the

urgent letter again.

1.5 Thesis outline

This thesis consists of five chapters. Chapter 1 will discuss about the overview

of the project, objective of the project, project scope and problem statement.

Chapter 2 contains a detail description of control system for modern house. It

will explain about the concept of control system, the application of this system and the

component that involved in this project.

Chapter 3 includes the project methodology. It will explain how the project

planning and the flow of process in completing this project. The circuit design,

software and hardware implementing are also discussed in this chapter.

Page 18: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

5

Chapter 4 will discuss about the result and discussion. This chapter will show

the result of this project step by step.

The last chapter contain the detail description about conclusion and

recommendation. It concludes the whole project and gives a future recommendation to

make this project perfect.

Page 19: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

6

CHAPTER 2

LITERATURE REVIEW

A control system is a device or set of devices to manage, command, direct or

regulate the behaviour other devices or systems. There are two common classes of

control systems with many variations and combinations: logic or sequential controls

and feedback or linear controls. Control system is a variable quantity or set of variable

quantities is made to adapt to a prescribed norm. It either holds the values of the

controlled quantities constant or causes them to vary in a prescribed way. A control

system may be operated by electricity, mechanical, fluid pressure (liquid or gas) or a

combination of means. When a computer is involved in the control circuit it is usually

more convenient to operate all of the control systems electrically, although

intermixtures are fairly common.

The new Lighting Control System (LCS) is a wall switch occupancy sensor

that has been designed specifically for hotel environments to save energy while

providing users a higher level of lighting amenity. The LCS has two key features that

make it ideally suited for placement in hotel guestroom bathrooms. The first feature is

that the LCS is preprogrammed with a timeout setpoint that is significantly longer

than what is typically used by occupancy sensors. Findings from prior research

conducted by LBNL and The Watt Stopper, Inc. suggested that most of the energy

used by hotel bathroom luminaries is from the relatively infrequent periods when they

are left on for very long periods of time (i.e. greater than four hours). By utilizing

longer timeout setpoints (one hour for the LCS), these long periods can be eliminated

Page 20: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

7

while greatly minimizing the chances of generating “false offs” in which the lights

turn off when there is a guest in the bathroom[1].

The design proposed using both a microprocessor and light sensors for

automatic room light detection and control. The Home Light Control Module

(HLCM) which will be installed in every light fixture of a family is made up of four

blocks: the pyroelectric infrared (PIR) sensor circuit, the light sensor circuit, the

microprocessor and the RF module. By using the PIR sensor circuit, the HLCM

detects if a human body enters the detection area or not. If there is no human body

present, all controlled lights are turned off. If there is, the HLCM detects the light

intensity under the environment and maintains sufficient light by controlling the

number of lights [2]. A low power HLCM in every lamp installed in a typical home.

The design detects whether someone is passing through the detection area not only by

means of the PIR sensor in the HLCM but also by detecting the change of light

intensity in a room by means of the light sensor in the HLCM. The RF module used to

communicate among the HLCM to pre-control the lights. For example, when the

room light intensity is insufficient all light controlled by HLCM A are turned on.

HLCM A will the send a signal to the nearby HLCM B to turn on a light controlled by

HLCM B to increase the light intensity. Moreover, if someone goes from the kitchen

to the living room, the HLCM in the kitchen notifies the HLCM in the living room to

turn on the light in advance [3].

Programmable electronic locks are a solid choice for facilities with a limited

number of users and access points. A step above the traditional generations-old

strictly mechanical pushbutton lock, programmable electronic locks are standalone,

microprocessor-based, battery-powered locks that one can program up to 100

individual user codes, right at the keypad. Facilities managers or the office manager

can add or delete users in seconds. Users' codes are typically kept between three to

seven digits and entered via the keypad by the user to gain entry. There is no external

wiring required and the locks will provide 80 000 plus activations or two to three

years of use with common AA batteries.

The choice of lever for door should not be taken for granted. It is highly

recommended that the exterior lever should swing freely in case intruders attempt to

Page 21: i CONTROL SYSTEM FOR MODERN HOUSE MOHD HAFIZUDDIN ...

8

break the door handle. The lever should only clutch when the electronic lock is

provided a correct user code. Such programmable locks are now priced comparably

with older mechanical and electrical keycode locks but can store many more codes.

The significance of so many multiple codes should not be overlooked. If the lock has

only one or a few codes, people must share codes. When an individual leaves the

organisation and you need to change the code, all others sharing that code much also

learn a new code. With nobody to notify, eliminating that ex-employee with the new

breed of programmable electronic lock can be less than a ten-second procedure [4].

The detailed design of a microprocessor-based door lock system including the

hardware design, software functional definitions, and diagnostics is presented. The

system is designed in two modules: a door lock controller board, in which all

functions necessary for keyless entry at a door are implemented, and a programming

board. There is only one such board for the whole dwelling and it has additional

hardware such as serial link interface circuitry and a display. The two modules are

connected temporarily to perform keycode modification and diagnostic functions

using a serial data link. The keycode is a four-character pattern. Authorized users of

the dwelling are given this code and are required to enter this pattern via a keypad for

entry. The number of integrated circuits used was kept to a minimum.