26
HOME AUTOMATION USING X-10 TECHNOLOGY MOHAMAD RIDHWAN BIN MOHAMED RODZI UNIVERSITY MALAYSIA PAHANG

HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

Embed Size (px)

Citation preview

Page 1: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

HOME AUTOMATION USING X-10 TECHNOLOGY

MOHAMAD RIDHWAN BIN MOHAMED RODZI

UNIVERSITY MALAYSIA PAHANG

Page 2: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

HOME AUTOMATION USING X-10 TECHNOLOGY

MOHAMAD RIDHWAN BIN MOHAMED RODZI

This project is submitted as partial fulfillment of the requirement for the award of the

Bachelor Degree Electrical Engineering (Power System)

Faculty of Electrical & Electronic Engineering

University Malaysia Pahang

NOVEMBER 2008

Page 3: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

DECLARATION

I declare that this project entitled “Home Automation Using X-10 Technology” is the

result of my own research except as cited in the references. The project has not been

accepted for any degree and is not concurrently submitted in candidature of any other

degree.

Signature : ………………………………………………………..

Author : MOHAMAD RIDHWAN BIN MOHAMED RODZI

Date : NOVEMBER 2008

Page 4: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

Specially dedicated to

My beloved parent

ACKNOWLEDGMENT

Page 5: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

Alhamdulillah, the highest thank to God because with His Willingness I

possible to complete the final year project. In preparing this thesis, I was in contact

with many people, researchers, academicians, and practitioners. They have

contributed towards my understanding and thoughts.

In particular, I wish to express my sincere appreciation to my main thesis

supervisor, Mr. Rosmadi Bin Abdullah, for encouragement, guidance, critics and

friendship. I am also very thankful to all lecturer and laboratory technician for

sharing their valuables ideas and willing to spend their time for helping me. Without

their continued support and interest, this thesis would not have been the same as

presented here.

My fellow undergraduate students should also be recognized for their

support. My sincere appreciation also extends to all my colleagues and others who

have provided assistance at various occasions. Their views and tips are useful

indeed. Unfortunately, it is not possible to list all of them in this limited space. I am

grateful to all my family members.

ABSTRACT

Page 6: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

X-10 is a power line carrier technology that allows device throughout the

home to communicate with each other via the existing mains wiring in the house. X-

10 uses 120 kHz bursts timed with the 240VAC power line zero-crossings to

represent digital information. Transmitter burst the 120 kHz PWM signal using

PIC16F877A into AC power line that have time of zero-crossing. Receiver was

function as signal detector. Signal that has been detected from all the receiver circuit

will be operated by the PIC16F877A. The X-10 technology is one of the easiest and

most popular ways to automate home without re-wire our own house. Without it, we

will spend a lot of money and time to do some maintenance in our house. Basic

flows of X-10 power line system are input from computer was send to

microcontroller using Visual Basic 6 software. Then, the input data send through

mains power line by using coupling circuit in the modem transmitter. At the

receiving end, data was passed through receiver modem and go to controller. Load

was operated by controller depend on the input signal that has been send by the

computer at the transmitting before.

ABSTRAK

Page 7: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

X-10 adalah teknologi yang membenarkan semua peralatan elektrik di rumah

berkomunikasi sesama sendiri melalui talian kuasa(elektrik) yang sedia ada di

rumah. X-10 menggunakan pancaran daripada gelombang frekuensi 120 kHz yang

mana masanya untuk memancar adalah mengikut perubahan arus ulang-alik 240V

dari positif ke negatif bagi mewujudkan informasi berdigit. Di sebelah

penghantaraan, gelombang frekuensi 120kHz akan dipancarkan ke dalam arus ulang-

alik 240V dengan menggunakan PIC16F877A dengan mengikut masa perubahan

positif ke negatif arus ulang-alik 240V. Pada bahagian penerimaan pula, ia akan

berfungsi sebagai pengesan gelombang. Gelombang 120kHz yg dihantar dari sistem

penghantaran tadi akan dikesan oleh sistem penerima dengan menggunakan litar-litar

tertentu. Selepas melalui proses di setiap litar, gelombang tersebut yang telah

disaring akan dikesan oleh PIC16F877A dan terus diproses. Teknologi X-10

merupakan salah sebuah sistem yang termudah dan paling terkenal dalam sistem

rumah pintar tanpa melakukan pengubahsuaian litar di dalam rumah kita. Tanpa

teknologi ini kita akan banyak menghabiskan waktu dan wang untuk membuat

penyelengaraan di dalam rumah. Berikut adalah sedikit penerangan tentang asas

sistem teknologi X-10. Data masukan akan diterima oleh PIC melalui perisian Visual

Basic 6. Data tersebut akan dhantar terus ke talian arus ulang-alik. Ia kemudiannya

akan dikesan oleh sistem penerima bagi membolehkan PIC memprosesnya sebelum

PIC mengarahkan bebanan(lampu atau kipas) menyala atau padam.

TABLE OF CONTENTS

Page 8: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

CHAPTER CONTENT PAGE

TITLE i

DECLARATION ii

DEDICATION iii

ACKNOWLEDGEMENT iv

ABSTRACT v

ABSTRAK vi

TABLE OF CONTENTS vii

LIST OF TABLE xii

LIST OF FIGURE xiii

LIST OF ABBREVIATIONS xvi

LIST OF APPENDICES xvii

1 INTRODUCTION

1.1 Overview of Project 1

1.2 Objectives 2

1.3 Scope of Project 2

1.4 Problem Statement 3

Page 9: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

2 LITERATURE REVIEW

2.1 Home Automation 4

2.1.1 Definition 4

2.1.2 Standards and Bridges 6

2.2 Power Line Communication 7

2.2.1 Definition 7

2.2.2 Introduction 7

2.3 Home Control System 8

2.4 Performance of Power Line for Home Control 9

System

2.5 History of X-10 9

2.6 X-10 for Home Control System 12

2.7 Performance Analysis of X-10 14

2.8 Zero-Crossing 15

2.9 X-10 Timed with the Zero-Crossing 17

2.10 PIC16F877A Microcontroller 19

2.10.1 Introduction 20

2.10.2 Features 21

2.11 Visual Basic 6 22

2.11.1 Introduction 22

2.11.2 GUI Development in Visual Basic 6 23

3 METHODOLOGY

3.1 Overview of Project 24

3.2 Hardware Description 25

3.2.1 Zero-Crossing Detector 26

3.2.2 120 kHz Carrier Detector 28

3.2.3 120 kHz Carrier Generator 29

Page 10: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

3.2.4 Transformer less Power Supply 31

3.2.5 Load Switch 32

3.3 PIC16F877A 33

3.3.1 Schematic 33

3.3.2 Memory Usage 34

3.3.3 Programming PIC16F877A 34

3.3.4 PIC Basic Pro 35

3.3.5 PIC Programmer 37

3.3.6 MAX232 Interface 39

3.3.7 Serial Port Test (RS232) 40

3.4 Software 41

3.4.1 Visual Basic 6 Design Flow Chart 41

3.4.2 Printed Circuit Board Design 42

4 RESULT AND DISCUSSION

4.1 Printed Circuit Board 49

4.1.1 Transmitter Schematic Design 50

4.1.2 Transmitter Layout Design 51

4.1.3 Receiver Schematic Design 52

4.1.4 Receiver Layout Design 53

Page 11: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

4.2 Transmitter Board 54

4.2.1 +5V Supply 55

4.2.2 120 kHz PWM Generated by PIC 56

4.2.3 120 kHz PIC Basic Pro Code 57

4.2.4 240VAC Zero-Crossing Interrupt 62

4.2.5 Interrupt Basic Pro Code 63

4.2.6 Frequency Coupled Filter 64

4.3 Receiver Board 66

4.3.1 High-Pass Filter 67

4.3.2 Amplifier 68

4.3.3 Envelope Detector 69

5 CONCLUSION AND RECOMMENDATIONS

5.1 Conclusion 71

5.2 Recommendation 72

5.3 Costing And Commercialization 73

5.3.1 Costing 73

5.3.2 Commercialization 75

Page 12: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

REFERENCE 76

APPENDIX A 78

APPENDIX B 79

APPENDIX C 81

APPENDIX D 83

APPENDIX E 87

APPENDIX F 101

APPENDIX G 105

APPENDIX H 110

LIST OF TABLES

TABLE NO TITLE PAGE

Page 13: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

2.1 Comparative of Home Automation Bridges 6

2.2 Performance Analysis Results of Using 15

X-10 for HCS

2.3 Features of PIC16F877A 21

3.1 Memory Usage for X-10 Functionality 34

3.2 Memory Usage for the Home Controller 34

5.1 Total Cost of the Project 73

B.1 List of Component 1 79

LIST OF FIGURES

FIGURE NO TITLE PAGE

Page 14: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

2.1 Transmissions Synchronized to Zero Crossing 13

2.2 Basic Configuration HCS interconnected 14

With X-10

2.3 Zero-crossing in a waveform representing 16

Voltage vs. time

2.4 Zero-crossing of AC power line 18

2.5 Zero-crossing of AC power line 18

2.6 PIC16F877A 20

3.1 Application Block Diagram 25

3.2 Zero-Crossing Detector 27

3.3 120kHz Carrier Detector 29

3.4 120 kHz Carrier Generator 30

3.5 Transformer less Power Supply 31

3.6 Load Switch/Dimmer (TRIAC) 32

3.7 PIC16F877A 40Pin 33

3.8 Software Layout 37

3.9 Cytron Programmer 38

3.10 PIC Programming (Burn) Process 38

3.11 Schematic of the MAX232 40

3.12 Serial Port Testing Using RS232 40

3.13 Start with Altium DXP 2004 42

3.14 Create the PCB Project 43

3.15 Blank Project 43

3.16 Adding Schematic to the Project 44

3.17 Save for Safe 44

3.18 Resize Sheet Size 45

3.19 Select Sheet Size 45

3.20 Finding the Component 46

3.21 Adding components to Project 46

Page 15: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

3.22 Drawing schematic 47

3.23 Export schematic to PCB Board Wizard 47

3.24 Setting PCB rules 48

3.25 PCB routing 48

4.1 PIC Circuit Schematic 50

4.2 Application Circuit Schematic 50

4.3 PIC Circuit Layout 51

4.4 Application Circuit Layout 51

4.5 PIC Circuit Schematic 52

4.6 Application Circuit Schematic 52

4.7 PIC Circuit Layout 53

4.8 Application Circuit Layout 53

4.9 Transmitter Board 54

4.10 5V Supply 55

4.11 5V DC from oscilloscope 55

4.12 PIC PWM port 56

4.13 Coding for PWM 57

4.14 PWM Output 58

4.15 Finding PWM Resolution 59

4.16 PIC Interrupt port 63

4.17 Coding for Interrupt 62

4.18 High-Pass Filter Circuit 64

4.19 Receiver Board 66

4.20 High-Pass Filter 67

4.21 Amplifier Circuit 68

4.22 Envelope Detector Circuit 69

A.1 Full Schematic of the Project 78

Page 16: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

LIST OF ABBREVIATON

DC - Direct Current

Page 17: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

AC - Alternate Current

PWM - Pulse Width Modulation

PIC - Programmable Intelligent Computer

PLC - Power Line Communication

GUI - Graphical User Interface

HCS - Home Control System

VB - Visual Basic

PCB - Printed Circuit Board

Page 18: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

LIST OF APPENDICES

APPENDIX TITLE PAGE

A Full Schematic of the Project 78

B List of Component 79

C Transmitter Coding 81

D Receiver Coding 83

E PIC16F877A Data Sheet 87

F Reset able Fuse Data Sheet 101

G IR2109 Rectifier Data Sheet 105

H Voltage Dependent Resistor Data Sheet 110

Page 19: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

CHAPTER 1

INTRODUCTION

1.1 Overview of Project

This project is about power line communication using X-10 technology to

control any electrical home’s device. X-10 is a power line carrier technology that

allows device throughout the home to communicate with each other via the existing

mains wiring in the house. X-10 uses 120 kHz bursts timed with the power line zero

crossings to represent digital information. X-10 technology is one of the easiest and

most popular ways to automate home without re-wire our own house. X-10 works

across home power lines and is extremely low-bandwidth. X-10 devices send about

one command per second and these commands require less than 1/1000th of the

bandwidth of a dial-up connection. Like a broadcast network, every command is sent

through every wire in our house. In this project, Visual Basic 6 software from the

computer was used to act as the input. User is able to select which devices that wants

to be control from it. The microcontroller also was used in this project. It worked as

a controller to receive and transmit data and signals from the input and send through

our home existing power line wiring. Basically, this project was fabricated and

design in two set of the power line communication using X-10 technology. One will

operate as a receiver and the other one will operate as transmitter.

Page 20: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

1.2 Objectives

The objective of this project is to;

i. Design and fabricate power line communication system to control house

devices.

ii. Control house devices using Graphical User Interface (GUI).

1.3 Scope of Project

i. To design power line communication modem using X-10 technology.

i. To design Graphical User Interface using Visual Basic 6.

Page 21: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

1.4 Problem Statement

Home Control System (HCS) helps to monitor and control the home

appliances. Let say a house that have size larger than 2000 square feet (185 square

meters). How we going to control home electrical devices which is located anywhere

and everywhere in our house. X-10 technology is the best way that we can use for

home control system using existing power line wiring. Without this technology, we

may face many problems in setting up a Home Control System to control our home

devices such as:

Do a re-wiring in our house in a way to control devices.

Waste our money to buy remote sensor to interfaces with each devices.

Some home control system product may not match with our home devices

specification.

Our home devices lifetime may not be longer.

Waste our time in case; we must turn back home if we forget to switch off

any devices that may be danger to our house.

Waste electricity in case; we forget to switch off any home devices.

So, X-10 power line communication can solve all the problem state above.

The advantages of using this technology are:

It is ideal for applications in existing houses.

No extra wiring is necessary which means low-cost solutions.

Saves power - with more control and automation over lights and heating you

can cut down unnecessary use of power.

Easy to use.

Page 22: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

CHAPTER 2

LITERATURE REVIEW

2.1 Home Automation

X-10 Technology normally has been applying with Home Automation. It

perfectly matches with the entire specific needed by the home automation work.

2.1.1 Definition

Home automation (also called domotics) is a field within building

automation, specializing in the specific automation requirements of private homes

and in the application of automation techniques for the comfort and security of its

residents. Although many techniques used in building automation (such as light and

climate control, control of doors and window shutters, security and surveillance

systems, etc.) are also used in home automation, additional functions in home

automation can include the control of multi-media home entertainment systems,

automatic plant watering and pet feeding, automatic scenes for dinners and parties,

and a more user-friendly control interface. When home automation is installed

Page 23: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

during construction of a new home, usually control wires are added before the

interior walls are installed. These control wires run to a controller, which will then

control the environment [1].

An automated home is sometimes called a smart home. Home automation

may also allow vital home functions to be controlled remotely from anywhere in the

world using a computer connected to the Internet. Besides the functions already

mentioned, remote control can be extended to telephones and answering machines,

fax machines, amateur radios and other communications equipment, and home

robots such as automatic vacuum cleaners [2].

The fundamental components of a well-designed home automation system

include a computer (or computers) with the appropriate programming, the various

devices and systems to be controlled, interconnecting cables or wireless links, a

high-speed Internet connection, and an emergency backup power source for the

computer, its peripherals, and the essential home systems [2].

Page 24: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

2.1.2 Standards and Bridges

Specific domotic standards include INSTEON, X10, PLC BUS, KNX

(standard), System Box, Lon Works, C-Bus, Universal power line bus (UPB), UPnP,

ZigBee and Z-Wave that will allow for control of most applications. Some standards

use communication and control wiring, some embed signals in the power line, some

use radio frequency (RF) signals, and some use a combination of several methods.

Control wiring is hardest to retrofit into an existing house. Some appliances include

USB that is used to control it and connect it to a domotics network. Bridges translate

information from one standard to another (e.g. from X10 to EIB) [1].

Table 2.1: Comparative of Home Automation Bridges

Page 25: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

2.2 Power Line Communication

Standard power that has been supply in our county is 240VAC with 50 Hz of

frequency.

2.2.1 Definition

Power line communication (PLC), also called power line carrier, mains

communication, power line telecom (PLT), or power line networking (PLN) is terms

describing several different systems for using electric power lines to carry

information over the power line [3].

2.2.2 Introduction

Electrical power is transmitted over high voltage transmission lines, medium

voltage distribution, and inside buildings at lower voltages. Power line

communications can be applied at each stage. Most PLC technologies limit

themselves to one particular set of wires (for example, premises wiring), but some

systems can cross between two levels (for example, both the distribution network

and premises wiring) [3].

All power line communications systems operate by impressing a modulated

carrier signal on the wiring system. Different types of power line communications

Page 26: HOME AUTOMATION USING X-10 TECHNOLOGYumpir.ump.edu.my/id/eprint/402/1/3198.pdf · home to communicate with each other via the existing mains wiring in the house ... Berikut adalah

use different frequency bands, depending on the signal transmission characteristics

of the power wiring used. Since the power wiring system was originally intended for

transmission of AC power, the power wire circuits have only a limited ability to

carry higher frequencies. The propagation problem is a limiting factor for each type

of power line communications [3].

Data rates over a power line communication system vary widely. Low-

frequency (about 100-200 kHz) carriers impressed on high-voltage transmission lines

may carry one or two analog voice circuits, or telemetry and control circuits with an

equivalent data rate of a few hundred bits per second; however, these circuits may be

many miles (kilometers) long. Higher data rates generally imply shorter ranges; a

local area network operating at millions of bits per second may only cover one floor

of an office building, but eliminates installation of dedicated network cabling [3].

2.3 Home Control System

Home Control System (HCS) helps to monitor and control the home

appliances as well as security aspects of the digital home that is expected to be the

standard for the future home. Chiefly, HCS is an integration of Home Appliance

Control Systems (HACS) and Home Security Systems (HSS). HACS enables the

home-owner to control appliances such as stove, refrigerator, air-conditioner, and the

like, remotely, while the HSS helps to monitor the status of various networked

security devices in the home and control certain aspects of the devices. Monitoring

and control may be done by a personal digital device such as a laptop, PDA,

telephone, or even a cell phone. For this to work there is at least one home controller

in the house that is connected to other appliances and equipments that need to be [7].