Professional Documents
Culture Documents
Remote Monitoring: A Simulation of a Home Automation System over Broadband with LabVIEW
A dissertation submitted to the Institute of Technology, Sligo in part fulfilment of the requirements for award of Masters (MSC) in Computing
by
Declaration
I hereby certify that the material, submitted in this dissertation, towards the award of Masters (MSc) in Computing is entirely my own work and has not been submitted for any academic assessment other than part-fulfilment of the award named above.
Signature of candidate.
Date.
ii
Acknowledgements
A special thanks to Dr Paul Flynn for his guidance and encouragement to me so as to make the research possible. He offered me the ideas to help me to define a research scope at the project proposal stage. Thanks to my colleagues at the Dublin Institute of Technology for encouragement and support. Finally a special thanks to my wife, Anne for her patience and support throughout the past year.
iii
Seamus Rooney
Abstract
With broadband access, the demand for sending digital voice, video and Internet data within the home will increase continuously. In the ten years time, there will be an inexpensive universal broadband where connections will be entirely fibre optic. There will be no more desktop PCs and every device will have a wireless connection to broadband. Streaming video will be incorporated into camera phones, which will have a broadband connection. The Internet will become more three-dimensional and real time active and eventually broadband connections will be a gigabyte a second. Virtual networking computing is used to access another computer remotely over a broadband connection. A remote computer desktop can be accessed by connecting to its unique IP address from anywhere in the world. The IP camera is used to broadcast video to a remote location without the need for cabling or storage systems. ACHE is a theoretical system, which adapts control of the home to the environment and is the idea of the neural home of the future. Already there is a car surveillance monitoring system called Project54 that can be adapted to monitor devices in the home from a remote location. The electricity power line has been an important home automation system in controlling lights, ventilators, security systems and temperature levels in the home. The main protocols for home automation power line technologies are CEBus, LonWorks, Konnex and X-10. The X-10 protocol enables home appliances to be connected to broadband using the electricity supply line where modules interface data control signals with wall electrical supply outlets. This dissertation addresses the use of virtual networking computing in combination with XML web services to control household devices from a remote location. There is an overview of CGI which is a toolkit to build an interactive interface for the remote computer. LabView remote panels are used to interface and connect to a remote computer over a broadband connection. A sample application to simulate a home central heating system is to monitor a soldering iron heating an aluminium block.
iv
Table of Contents
CONTENT PAGE
Title Page .................................................................................................................. i Declaration .............................................................................................................. ii Acknowledgements................................................................................................. iii Abstract .................................................................................................................. iv Table of Contents .....................................................................................................v Table of Figures........................................................................................................x List of Tables ........................................................................................................ xiii Chapter 1 ..................................................................................................................1 Introduction..............................................................................................................1 1.1 1.2 1.3 Introduction ............................................................................................... 1 Objectives.................................................................................................. 2 Organisation of the Dissertation ................................................................. 3
Chapter 2 ..................................................................................................................5 Accessing Broadband and Virtual Networking.......................................................5 2.1 2.2 Introduction ............................................................................................... 5 Development of Broadband........................................................................ 5 Broadband Topology.......................................................................... 5 Wired Broadband Network................................................................. 6 Wireless Broadband ........................................................................... 6 Optical Fibre ...................................................................................... 6 Digital Subscriber Line (DSL)............................................................ 7 Wireless Local Loop (Fixed Wire Access).......................................... 7 Microwave Broadband ....................................................................... 7 Satellite - Broadband (VSAT) ............................................................ 7 Benchmarking Irelands Broadband Performance ............................... 8 Definition of Wi-Fi .......................................................................... 12 Definition of WiMax........................................................................ 13 Fibre over Cabinet Technology ........................................................ 14
2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3 2.3.1 2.3.2 2.3.3
2.4
Virtual Networking Computing ................................................................ 15 Origins of VNC................................................................................ 16 The VNC Protocol............................................................................ 16 The Future of VNC .......................................................................... 17 Access-Remote-PC Computer Program............................................ 18 Access-Remote-PC Operations......................................................... 19 Access Control of Access-Remote-PC.............................................. 19 Installing Access-Remote-PC Software ............................................ 19 Access-Remote-PC Screen Resolution ............................................. 19 Access-Remote-PC Security Issues .................................................. 20 Connecting Access-Remote-PC over Broadband .............................. 20 Broadcasting with Access-Remote-PC ............................................. 21 Licensing of Access-Remote-PC ...................................................... 21 LogMeIn Computer program............................................................ 21 Security of LogMeIn and Secure Sockets Layer Protocol ................. 22 Accessing the remote PC using LogMeIn ......................................... 22 Adding a remote computer to the LogMeIn account ......................... 22 Virtual Networking and Accessing Home Appliances ...................... 23
2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.4.10 2.4.11 2.4.12 2.4.13 2.4.14 2.4.15 2.4.16 2.4.17 2.5
Summary ................................................................................................. 23
Chapter 3 ................................................................................................................25 IP Surveillance and Video Conferencing...............................................................25 3.1 3.2 3.3 Introduction ............................................................................................. 25 Development of IP Cameras..................................................................... 25 Wireless IP Surveillance .......................................................................... 27 Setting up an the AXIS MPEG-2 Network Camera........................... 27 IP Address Configuration ................................................................. 27 Configuring TCP/IP and Video on the IP network camera ................ 28 IP Camera Software ......................................................................... 28 Power over Ethernet and 802.11 Wireless LAN................................ 29 Implementing IP Surveillance .......................................................... 29 Configuring an IP camera:................................................................ 29 Installing an IP Camera in the Home ................................................ 30 ATM for Videoconferencing ............................................................ 31 vi
3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.4 3.4.1
Summary ................................................................................................. 35
Chapter 4 ................................................................................................................37 Broadband over Electricity Supply Networks.......................................................37 4.1 4.2 Introduction ............................................................................................. 37 Electrifying Broadband ............................................................................ 38 Advantages of Broadband over Power lines...................................... 39 Standards for Internet Communication over Power lines................... 39 Digital Communication over Power lines ......................................... 40 Broadband over Power line Communication..................................... 41 QFDM Modulation........................................................................... 41 Communication Channel Characteristics of the Power-line............... 42 Signal Propagation model................................................................. 43 Interference Problem of Broadband over Power-lines ....................... 45 Broadband using G-line Microwave Technology.............................. 46 Overview of Spread Spectrum Technology....................................... 46 Direct Sequence Spread Spectrum (DSSS) ....................................... 46 Frequency Hopping Spread Spectrum (FHSS) .................................. 47 Pseudo Noise Signal......................................................................... 47 Narrowband and Wideband Interference........................................... 48 Message Type and Codes ................................................................. 48 Code Division Multiple Access ........................................................ 49 Multi-path Channels ......................................................................... 49 Evaluation of Spread Spectrum technology ...................................... 50 X-10 Principles ................................................................................ 51 The X-10 Code................................................................................. 52 The ISO Seven Layer Model for an X-10 system.............................. 56 Interfacing the PC to an X-10 network ............................................. 57 Switches and Sensors ....................................................................... 57 Source Code for the PIC16C54 X-10 Appliance Module .................. 59 vii
4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.8 4.3.9 4.4 4.4.1 4.4.2 4.4.3 4.5 4.5.1 4.5.2 4.5.3
4.6 4.7
4.6.1
Chapter 5 ................................................................................................................65 Testing and Evaluation with LabView ..................................................................65 5.1 Introduction ............................................................................................. 65 Overview of LabView ...................................................................... 66 LabView Test Program..................................................................... 66 LabView and Internet Protocol (IP).................................................. 66 LabView and User Datagram Protocol (UDP) .................................. 67 LabView and Transmission Control Protocol (TCP)......................... 67 Waiting for an Incoming Connection................................................ 68 Creating a TCP Client ...................................................................... 68 Creating a TCP Server...................................................................... 69 LabView Remote Panels .................................................................. 69 Enabling Remote Panels................................................................... 70 Client Operation............................................................................... 70 Remote Panel Connection Manager.................................................. 70 Web Server Configuration................................................................ 71 Application Security......................................................................... 71 Overview of LabView 8.2 ................................................................ 72 Installing NI-DAQmx driver software .............................................. 74 Sample Application with X-10 Devices ............................................ 76 Sensor (Thermocouple or RTD) ....................................................... 77 Thermistor........................................................................................ 78 X-10 Thermostats............................................................................. 80 X-10 CM11A LabView Virtual Instrument ...................................... 81 Controlling Lights and Switches....................................................... 83 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.1.8 5.1.9 5.1.10 5.1.11 5.1.12 5.1.13 5.1.14 5.2 5.2.1 5.2.2 5.2.3 5.2.4 5.2.5 5.2.6 5.2.7 5.2.8 5.3 5.4
Chapter 6 ................................................................................................................86 Home Automation Project Engineering ................................................................86 6.1 Introduction ............................................................................................. 86 viii
6.2
Common Gateway Interface control of Household devices....................... 86 Overview of CGI.............................................................................. 86 Event driven Computing................................................................... 88 Overview of Project54...................................................................... 89 Configuring the Interface on Project54 ............................................. 92 Overview of Neural Home................................................................ 93 Ache................................................................................................. 94
6.2.1 6.2.2 6.3 6.3.1 6.3.2 6.4 6.4.1 6.4.2 6.5 6.6
Chapter 7 ................................................................................................................99 Conclusions and Recommendations ......................................................................99 7.1 7.2 7.3 7.4 7.5 Introduction ............................................................................................. 99 Other standards for Remote Automation Monitoring................................ 99 Broadband in ten years time ....................................................................100 Future research .......................................................................................100 Ergodic Chaotic Parameter Modulation (ECPM) .............................100 Summary ................................................................................................104
7.4.1
APPENDICES ......................................................................................................106 Appendix 1............................................................................................................107 X-10 House and Unit Code Formats....................................................................107 CM11A Format and Cable configuration ...........................................................109 Appendix 2............................................................................................................111 Configuring a Data Acquisition Board................................................................111 Appendix 3............................................................................................................114 PIC16CR54C ROM based Microcontroller and Data Sheet ..............................114 Appendix 4............................................................................................................117 Source Code for PIC16C54 X-10 Appliance Module..........................................117 References.............................................................................................................127 Bibliography .........................................................................................................130
ix
Table of Figures
CONTENT
PAGE
Figure 2-1 Broadband take up in Benchmark countries Q2 2005...............................9 Figure 2-2 Cost of entry level DSL in Ireland 2002-2005 .........................................9 Figure 2-3 Figure 2-4 Figure 2-5 Figure 2-6 Figure 2-7 Broadband in Europe............................................................................10 International leased line costs ...............................................................11 National leased line costs......................................................................11 VNC Architecture ................................................................................16 Front Panel of Remote-PC-Access ....................................................18
Figure 3-1 Figure 3-2 Figure 3-3 Figure 3-4 Figure 3-5
IP Surveillance Network.......................................................................26 A Wireless IP Surveillance of a Remote Oil Facility.............................27 H321/H320 Interconnection .................................................................32 H.310 Protocol Reference Model..........................................................33 H.323 protocol stack changes for RTP over AAL5 ...............................34
Figure 4-1 Figure 4-2 Figure 4-4 Figure 4-5 Figure 4-6 Figure 4-7 Figure 4-8 Figure 4-9
Power Line Communication Model ......................................................43 Spectral Analysis of simulated power line ............................................44 Fourth Order LC filter as a line coupler ................................................45 M-Sequence Simple Shift Register SSRG.............................................48 Three Phases in the Electricity Supply line ...........................................52 Binary Data Transmission ....................................................................53 Start Code is Two Cycles .....................................................................53 House or Letter Code............................................................................53
Figure 4-10 Unit Code............................................................................................54 Figure 4-11 Standard X-10 Transmission................................................................54 Figure 4-12 Command Code...................................................................................55
Figure 4-13 Complete Transmission .......................................................................55 Figure 4-14 PC Interfaced to X-10 using a Stamp Microcontroller..........................57 Figure 4-15 Microcontroller and tuned amplifier signal conditioner........................58 Figure 4-16 PC with CM11A Interface to X-10 Network........................................61 Figure 4-17 Architecture Model..............................................................................62 Figure 4-18 X-10 House Scenario...........................................................................62 Figure 4-19 Typical X-10 Modules.........................................................................64 Figure 4-20 CM11A Transmitter Module ...............................................................64 Figure 4-21 Lamp Module......................................................................................64
Figure 5-1 Figure 5-2 Figure 5-3 Figure 5-4 Figure 5-5 Figure 5-6 Figure 5-7 Figure 5-9 Figure 5-10 Figure 5-11 Figure 5-12 Figure 5-14
LabView 8.2 Startup Window ..............................................................72 Front panel of a temperature Virtual Instrument ...................................73 Block Diagram of a temperature Virtual Instrument .............................73 Instrument Connection diagram............................................................74 Temperature Control Flowchart............................................................77 Thermister Curve using Stein-Hart Equation ........................................79 Circuit to measure temperature using a Thermistor ...............................79 CM11A Virtual Instrument LabView X10 Library software .................81 CM11A X10 Application LabView Front Panel .................................82 CM11A X10 Application LabView Block Diagram............................82 LabView Front Panel to control lights and Switches ...........................83 PIC Microcontroller LabView Front Panel .........................................84
Figure 5-13 LabView Block Diagram to control lights and Switches ......................83
Figure 6-1
Figure 6-2 Three Steps to Processing a CGI...........................................................88 Figure 6-3 Prototype to control only X-10 devices.................................................90 Figure 6-4 Enhanced system to control Household Devices over Broadband .........91 Figure 6-5 Figure 6-6 Figure 6-8 Default Home Automation Window .....................................................91 Control Automation Window ...............................................................92 ACHE diagram.....................................................................................95
xi
Diagram of the proposed Analogue SS Modem ..................................101 Ergodic Chaotic Parameter Demodulator............................................101 Mean Value Estimator, Windowed Integrator as a Demodulator.........102 Signal Waveform at various stages for the ECPM SS system..............103
Figure A 1 Configuring a DAQ Board ..................................................................111 Figure A 2 Figure A 3 Figure A 4 Figure A 5 Setting Up a Simulated device in LabView ........................................112 X10 CM11A ON/Off Front Panel ......................................................113 ROM based Microcontroller ..............................................................114 PIC16C54A Microcontroller Integrated Circuit..................................116
xii
List of Tables
CONTENT Table 1-1 Table 2-1 Table 4-1 Table 4-2 Table 4-3 Table 4-4 PAGE Broadband Speed Table ...........................................................................2 Remote Access PC logging of Information ............................................20 ISM Bands.............................................................................................50 House or Letter Code.............................................................................53 Number or Unit Code ............................................................................54 Command Code.....................................................................................55
Table 4-5 House Unit and Function bit Sequence ...................................................59 Table 4-6 CM11A Cable Parameters ......................................................................60 Table 5-1 Thermocouple versus Resistive Temperature Devices.............................78 Table 5-2 Decode Table of X-10 Commands for TX15-B Thermostat ....................81 Table 5-3 Table A 1 Table A 2 Table A 3 Table A 4 Table A 5 Table A 6 Table A 7 Table A 8 Table A 9 LabView Serial Communication Frame Structure ..................................84 X-10 House (Letter) Code Pattern ......................................................107 X-10 Standard Message Format .........................................................107 X-10 Number (UNIT Code) pattern....................................................108 CM11A Cable Connections................................................................109 Format for first Transmission to CM11A Interface .............................109 CM11A Header ..................................................................................109 Defining the X-10 Transmission Code Byte .......................................109 PC to CM11A Codes..........................................................................110 ISO Layer Model for an X-10 System ................................................110
xiii
Chapter 1 Introduction
1.1 Introduction
The concept of remote management of household devices over the Internet from anywhere in the world can be a reality with broadband. Assume a system where from the office desk, the user could log onto the home computer remotely. A control panel would come up. The control panel would contain virtual switches as well as a map of the house. The software would control a PCI card in a computer attached to a control panel containing switches, timers, lights, TV, Alarm, heating or ventilation. By also logging onto the IP address of an IP camera, sophisticated remote surveillance can be incorporated into the remote control system. High speed DSL has provided broadband. The speed is causing advances in technology over the Internet to expand rapidly. The typical household or business is no longer depending on a dial up connection. Technologies such as streaming video incorporating IP cameras can now be used to replace cumbersome wired CCTV systems. The home can be monitored and controlled using the laptop computer, PDA or mobile phone by connecting into a broadband connection anywhere in the world. Today there is a heightened requirement for security and public safety. With broadband, the trend towards using an IP network for video surveillance is part of the larger drive to incorporate Voice over IP, remote control of buildings and video conferencing. The benefits of IP-based networking over broadband include cost over traditional dial up, attracting more subscribers and the delivery of more diverse services. By using wireless networking broadband can be made more available to rural areas. Remote plant monitoring using wireless technologies over broadband can be used for supervision and control in manufacturing environments.
Chapter 1 Introduction
The aim of this thesis is to analyse broadband and find out how broadband could revolutionise remote surveillance and monitoring of a building such as the home. This dissertation will first analyse some of the home automation standards. Investigate the possibility of remote control using LabView and a broadband connection to the Internet to control household devices. There will be an investigation into the use of X10 device modules and how to control them using a LabView program. A remote monitoring surveillance system is incorporated in conjunction with LabView to make a remote control and video monitoring system. 56k ISDN: (64k--128k)
64Kbps (1 B-channel) or 128Kbps (2 B-channels)
The standard modem speed, 56k only on the download side Expensive; being phased out due to inefficiency 2MBPS Affordable; must be within 3.5 miles of a switching station Clean connection; efficient; affordable; rain plays a factor Shared Connection; the more users, the slower the speed Up to 50MBPS for 2GHz Expensive; leased line; point-to-point dedicated line Expensive; leased line; point-to-point dedicated line Very expensive; leased line; point-to-point dedicated line Very expensive; leased line; point-to-point dedicated, digital circuit Table 1-1 Broadband Speed Table
Cable Modem:
(1500k to 3000k)
1.2 Objectives
The main object of the dissertation is to get a clear understanding of broadband and remote surveillance and monitoring technologies. To find out if the technology exists and if it is possible to control and monitor a remote home automation system from the web. Underlying objectives within the project are to: Get a clear understanding of broadband topology and investigate broadband and the benefits of implementation in Ireland. To research for existing remote monitoring packages. To implement and analyse IP surveillance and research videoconferencing technology. 2
Chapter 1 Introduction
Research the sending of data over the electricity supply network. Investigate using the TCP/IP protocol with LabView. To implement a LabView program that will control and monitor a remote device such as a temperature module. Research other methods of remote management and the technology of the neural house. Predict the economic and social impact of remote management over broadband if technologies were implemented in ten years time.
Chapter 1 Introduction
Chapter 5 researches LabView, a graphical programming language in which icons are used as building blocks to generate a program. LabView can be interfaced to the outside world using the input and output ports of the PC. LabView remote panels have a TCP/IP application and are a way of remotely controlling and monitoring household devices over a broadband connection. The chapter describes an application of remotely controlling the temperature of an aluminium block using a LabView program to drive an X-10 device so as to simulate the remote control of a home central heating system. Chapter 6 describes other methods that can be used to remotely manage a home automation system. The Common Gateway Interface is researched and there is an overview with LabView. Prototype54 is a system that remotely monitors and controls functions using voice command in police cars. The system can be adapted to remotely manage the home. Usually the GUI is located in the police car. The GUI could be implemented on a PC, PDA or mobile phone to remotely manage devices in the home. The neural home is investigated here and the concept of ACHE, which is a system where a program learns from the history of the occupant in the home. The system theory is to adapt the automation of the home to suit future needs while conserving energy in the home. Chapter 7 investigate the future needs to implement home automation over broadband. There is an investigation into the Ergodic Chaotic Parameter Modulation scheme that can revolutionise the integration of broadband over power lines in the future. There is a summary of the findings of the dissertation and suggestions for future research. conclusions are drawn up as well as
The backbone transmission network is extended through towns and cities using distribution networks. These are in turn connected to businesses and residential customers by an access network called a Metropolitan Area Network. National broadband networks are connected to the Internet and to International broadband networks in the same way as the gas network is connected to the European gas network using a gas interconnection.
2.2.2
Copper, coaxial cables and optic fibre cables physically link the locations on the network together. Implementation of wired broadband requires a multi-disciplined joint civil and electronic engineering team to build a duct and chamber network to run the cable underground. The duct system is structured access and the chamber system connects customers to the network. In metropolitan areas, chambers are used to accommodate access to the fibre cables. The chambers are 250m and 450m apart. In the backbone network the chambers are spaced between one and two kilometres apart. The greater space is attributed to being able to blow the fibre using compressed air pressure up to two kilometres in distance.
2.2.3
Wireless Broadband
The physics of electromagnetic waves at radio frequencies provides the connectivity between points. There is a wireless base station with the exception of a satellite system. The design is a combination of radio and civil engineering. The radio spectrum is equivalent to the fibre optic cable. For broadband, the operator server wireless station must be in line of site of the customers wireless station.
2.2.4
Optical Fibre
Optical fibre systems work by transmitting signals carrying information data through glass or plastic wires. Lasers and Light Emitting Diodes are used to transmit light pulses that have been converted before transmission from electronic digital signals. Fibre optic cables carry much more information than conventional copper wire and are less prone to electromagnetic interference. Optical fibre offers scalability and expansion on demand. The high availability levels and high resilience can be guaranteed to customers. The disadvantage of optical fibre is the cost of laying cable associated with civil engineering.
Optical fibre is generally used to distribute broadband to customers from the local loop connection and to build new networks. Optical fibre can deliver broadband speeds ranging from 2Mbps to 40Gbps.
2.2.5
DSL provides broadband over existing copper wire such as the existing telephone lines. There is transmission equipment attached to the copper wire to enhance transmission. ADSL in Ireland has up to 1Mbps transmission downstream and 256kbps transmission upstream to the service provider. DSL technologies are limited by distance between the end user and the nearest exchange and by the quality and age of the copper wire. DSL is mainly an access technology to connect customers to the main metropolitan network.
2.2.6
Fixed Wire Access, which is also called Wired Local Loop, connects Internet Service Providers to the customers premises using a method similar to terrestrial microwave. FWA can deliver a cost-effective broadband of 2Mbps. Narrow-band units of 64kbps can service areas where there is no cable such as in rural and underdeveloped areas.
2.2.7
Microwave Broadband
Point to point microwave radio uses a pair of directional antennas to connect the broadband link. A narrow beam focuses the radio frequency signal to reach a distance of up to 60km. The distance covered is governed by radio frequency but realistic distances are only from 3 to 12 kilometres. Broadband speeds of 256kbps to 155Mbps can be achieved. Microwave links are connected as part of the backbone structure of the network ahead of expansion using optical fibre. Microwave broadband links can be a solution to connecting broadband to remote areas.
2.2.8
A VSAT (Very Small Aperture Terminal) is a communication terminal that is installed on the roof of a users premises and used to broadcast video and to provide Internet access. Vsats communicate using orbiting satellites to relay information to and from gateway stations known as hubs. VSAT systems provide access to broadband that is 35 times faster then the standard telephone link.
Current VSAT system provides capacities of up to 2Mbps to the user in the downlink direction and between 64kbps to 256kbps in the uplink direction. VSAT can connect broadband to remote areas because of the large geographical areas covered by a satellite system.
2.2.9
A Forfs report in 1998 called Broadband Telecommunication Investment in Ireland recommended actions to address the gap of investment and quality of broadband services in Ireland relative to services in other countries. The government has allocated 200 million euros to support regional investment in the National Development Plan 2000-2006. Competition and international capacity have contributed to improved telecommunication investment in Ireland. The experience of multinational companies in Dublin is favourable to broadband services. The experience of small to medium size companies is not as good. This is due to lack of ADSL connection to small businesses. Broadband access is confined to larger companies due to lack of competition for customers. Deployment of broadband in urban areas where there are a lot of customers is more feasible than in deploying broadband in rural areas. Broadband communication price must reduce so that the level of demand will grow and the product can become economic when connected widespread over the country. The report states that widespread availability is essential for development of the economy. The concern is that the wide investment may not be realised and would leave Ireland behind other developed economies in terms of broadband access. The telecommunication infrastructure is operated by a number of state organisations under control of the Department of Public Enterprise ESB, CIE and Bord Gis. The report recommends that the state telecommunication infrastructure be viewed as an asset, which can be deployed in the national interest. The report also recommends that opening and linking these organisations would act as a stimulus for expansion of Broadband in the Irish market. The government can ensure that Ireland can be broadband competitive by ensuring the right environment for private sector investment, ensuring broadband communication needs are met in areas where provision could become uneconomic in the future.
Figure 2-3
Broadband in Europe
In the private sector broadband can enable e-business and new market opportunities. Companies can realise growth through productivity increases due to improved information exchange. In the public sector there would be more efficiency in health and education services. For consumers, broadband can enhance the quality of life through social and cultural development. In rural areas broadband enables social and economic inclusion. Broadband was initially set up for business because the benefits, efficiencies and cost saving over dial up and leased lines are substantial. Business can access news sites, find out about competition and find out about worldwide opinion about the industry. Broadband makes it possible to use Customer Relationship Management (CRM) packages to move some of the business to hosted services outside the office. CRM is a strategy used by businesses to learn more about customers needs and behaviours in order for the business to develop a one to one relationship with the customer. Broadband makes it possible to avail of online backup, hosted services and security services. With broadband, video streaming and PDF documents can be used to make a business more competitive. According to BT, only 50% of businesses have broadband. This is due to location and resistance to change. Businesses are deterred by having to install the latest firewalls and anti virus software in their PCs. In remote areas, satellite is the only option otherwise the location must have a group broadband scheme that can avail of wireless broadband.
10
Irelands broadband is improving through metropolitan area networks (MANs) and the group broadband scheme. The development of wireless standards such as WiMax is making it more likely that all businesses will be able to receive broadband.
Figure 2-4
Figure 2-5
11
12
There is a 64bit encryption system that uses 40 bits and a 128-bit system that uses 103bits. This is called a WEP key and is entered into the Wi-Fi software so as to gain entry to the network. The channel number is 6 by default but can be set to any number from 1 to 11 so as to not interfere with a neighbours Wi-Fi equipment. The WEP key is disabled by default, but to turn it on a WEP key must be entered with 128-bit encryption.
2.3.2
Definition of WiMax
WiMax means Worldwide Interoperability for Microwave Access and is a standard based technology that can provide broadband access to the Internet. WiMax is not like Wi-Fi because it requires a network plan and sites for base station antennas. Wi-fi can broadcast up to 100metres with a maximum power of 54Mbps, WiMax has a range of 50km with a transmission rate of 70Mbps. WiMax is used mainly for data transmission. Voice transmission requires VoIP as the transmission medium over WiMax. In rural areas WiMax can supplement Universal Mobile Telecommunication systems (UMT). WiMax was developed for home and business use where there is no fixed access to broadband. UMT is a technology that guarantees quality of voice and multimedia to Internet adaptable mobile phones. WiMax provides wireless Internet access for the laptop user within a WiMax radio cell. Future generation laptop computers will have both WiMax and Wi-fi technology built in so that WiMax can complement Wi-Fi. This will gave Personal Digital Assistants, PDAs and laptop computers access to broadband outside the range of Wi-Fi access points. Since 2005, outdoor stations similar to satellite dishes have become available. Second generation indoor installable modems similar to cable and DSL modems are to become available in 2006. Portable modems that can be integrated into a laptop are to become available in 2007. Siemens predicts that WiMax as well as Wi-Fi and bluetooth will be incorporated into chipsets for laptops and PDAs. This will enable delivery of broadband direct to the home, to laptops and to PDAs. Licensed frequencies are necessary to provide WiMax services.
13
The WiMax forum was established in 2004 to establish a working group to promote the allocation of a licensed frequency spectrum for broadband wireless access. The group lined up three frequency bands, a 5.8 GHz band, which is unlicensed in many countries, a 3.5 GHz band, which is unavailable in the USA and Canada but available in Europe and a 2.5 GHz band which is licensed in the USA. Siemens and Intel are working together on the development of WiMax base station infrastructure equipment and user subscriber stations. Intel will market the technology with chipsets for laptop PCs. It is predicted that there will be 3.8million users of wireless broadband connections and this will see growth in Eastern Europe and third world countries such as Africa. The user will have unrestricted access to wireless broadband but the different wireless standards will have to be harmonised into one specific standard.
2.3.3
Fibre over Cabinet technology provides a higher bandwidth by decreasing the length of the copper wire in the access network while increasing the reach of fibre optic from the exchange gradually. This is an evolution of fibre-to-the-x (FTTX) technology, where x denotes exchange (E), the cabinet (C), the kerb (K), the home (H) or building (B). The Multi-Service Access Platform (MSAP) supports the provision of multiple telecommunications services from a single switch. The MSAP is a convergence of broadband with multi access multi service network architecture. The remote unit of the MSAP is contained in a roadside cabinet and connected to the MSAP central unit at the local exchange over fibre optic cable. Eircom are testing FTTC in the Dublin area while Siemens provided a surpass MSAP for one location and Teledata Networks (Israel) has provided a Broadband Access 40 integrated MSAP to another location. There are 300 lines and there are multiple locations for roadside MSAP cabinets. The cabinets have to be powered by electricity and power can be provided from the exchange without the need for battery backup. Electrical power can be transmitted over the copper cable that has already been replaced with fibre optic cable as the communication medium. The network consists of two pairs of optical cable that connect the MSAP remote unit to the MSAP central unit at the local exchange.
14
The central unit is linked to the Internet for broadband connectivity and the ISDN/PSDN network for voice connectivity. There is a connection to the network management system that is distributed over several sites for network management functions.
15
2.4.1
Origins of VNC
An X-Window system allows applications to be displayed on a remote computer. ORL extended the system to dynamically redirect an X-application to a different display. This is called a teleporting system. The disadvantage with the system is that PDAs can not run because the software overhead is too high and application start up is slow on high latency links. An X-server program is needed to run the display machine. The X-window system is not the standard windows operating system as Microsoft dominates the windows market. Microsoft has developed a protocol called T.Share based on the ITUT120 protocol and is already used in Microsofts NetMeeting conferencing software product. Videotile was built in 1994 by ORL as an experiment of ultra thin client technology. This was a display device and a pen with an ATM connection that displayed quality video and used up a lot of bandwidth. More intelligence was added at the application side and only the parts of the screen that changed were transmitted to reduce the bandwidth required to become the VNC protocol. Sun Microsystems released the alpha version of the Java language and the HotJava browser in 1995. Taking advantage of the thin client paradigm, a VNC Java applet of 6Kbytes was then developed to implement the Videotile mechanism in Java. Any Java capable browser could then access a users desktop using the mobility of the teleporting system.
2.4.2
The VNC protocol is simple for remote access to a graphical user interface. The protocol works with TCP/IP and all operating systems The VNC client is the endpoint where the user interacts with display and input devices. VNC is ultra-thin system requiring few demands of the client and it is a simple task to create new clients to run on a wide range of hardware.
Figure 2-6
VNC Architecture
16
The display protocol is based on placing pixels on x, y co-ordinate positions. Raw Encoding is used where pixel data for a rectangle is sent in a left to right scan line order. VNC clients and servers must support raw encoding. The client activates frame update where the server in response to a request from the client only sends the update protocol for the display. The input side of VNC is based on a standard workstation of a keyboard and a mouse. To establish client-server connection, the server requests authentication from the client. The client gets an update of the desktop screen and a session begins. A VNC viewer uses the TCP/IP transport system and the VNC server protocol is designed to make the client viewer as simple as possible. The VNC server must provide pixels in a format to suit the client. The server mirrors the real display to the remote client so that only a single VNC desktop is available from any one PC. VNC could be extended to control consumer electronics in the home to bring up the controls for the video recorder on a mobile phone while the user is away from the home. The telephone answering machine could be programmed through a graphical user interface to control a household appliance. Controlling the video recorder would require a driver that is designed for the mobile phone operating system. The interface that is already with the remote device could be used and interacted with directly. A GUI protocol allows devices with no physical display to provide graphical information. A variety of GUIs need to be created with the VNC protocol and interfaced with consumer electronic devices and there are standards such as IEEE-1394 Fireware and USB to physically interface household devices. VNC requires a reliable transport mechanism and a simple display capability. VNC can be used to create a standard plug and play interface.
2.4.3
The Oracle Research Laboratory is now building VNC software for a variety of desktop platforms. Remote access is not practical for a wide range of devices. A 7segment display could be driven by cheap hardware and the display equivalent sent over a USB or RS232 link. The VNC commands to draw and erase can be stored in ROM as a sequence of bytes and sent over a communications link when the segment switched on or off. Television sets could have VNC viewers built in so that TVs can act as displays for a variety of household devices.
17
2.4.4
Access Remote PC is a computer program that can be downloaded from the Internet and installed on a local host computer. The local PC can access a remote PC over the local area network (LAN), the Ethernet or over the wide area network (WAN), the Internet. The local PC connects to the remote client PC by searching for the IP address of that PC or by using the PC identifier name. The remote PC responds by displaying its desktop as a window on the desktop of the local PC. The local mouse and keyboard can then access the remote desktop. Files on the remote PC can be accessed in the same way as if that PCs desktop is in front of the user and will allow transfer of files between the remote PC and local PC. There is a remote PC (RPC) subscription service optional feature that enables easy access to the remote computer without a requirement of an IP address. Firewalls, routers and dynamic IP addresses can be bypassed. An active Internet broadband connection is necessary to connect to RPC servers.
Figure 2-7
18
2.4.5
Access-Remote-PC Operations
To access a computer over a LAN network, the IP address is entered in the RPC server window. The server window comes up on the host computer screen when the RPC program is accessed. When a remote PC is to be accessed over the Internet, the subscription service provides a unique number that identifies the remote computer. To access the remote computer the RPC number is entered in the server window message box and a connect icon or button is clicked upon using the mouse.
2.4.6
The server PC, on which the server program is installed, can grant access to any number of clients. Each client has a separate account with username and password. The access rights can be specified such as View Screen, Control keyboard and Mouse, Transfer Sound, Access file system, Display Notification When User Connected and Enforce a Timeout so that the session can automatically disconnect.
2.4.7
Remote PC Server is run on the remote computer so that the computer can be controlled remotely. Remote PC Client is run on the host computer to view and control the screen of the remote computer using the keyboard and mouse. The program that is downloaded is 1.59MB in size when installed and there are no video drivers so as to make the system more stable. A set-up wizard is used to set-up the configuration for LAN access. A subscription service is used to set up a connection over broadband where the RPC number for the remote computer is emailed to the user.
2.4.8
Access Remote PC can achieve screen updates of 25-100 frames/second on 512 Kbps connections over a local area network. On a dial up connection, which is 3-6 Kbps, the frame speed is 1-2 frames/second. By default picture quality is favoured over speed but this can be changed manually in the Options Window by selecting the Tools menu.
19
Date-time c-ip s-ip s-port sc-status cs-username cs-method sc-bytes cs-bytes time-taken
Date and time of session started Clients IP address Servers IP address Servers port Authentication Status: 0- authorised; 4 wrong username; 12-wrong password Clients username Clients permissions Bytes sent Bytes received Length of the session in milliseconds Table 2-1 Remote Access PC logging of Information
2.4.9
Access remote PC is controlled by a username and password and uses Secure Remote Passwords (SRP) technology for authentication and key exchange. One time passwords are supported that expire after a period of time after the first use. Windows Integrated Authentication is also supported and allows the use of password management which is built into the operating system. A user account is created and a method of authentication is chosen. A windows username or group name is specified and permissions are granted for access. A domain name is specified as username domain for domain level authentication.
20
21
22
2.5 Summary
Broadband describes a high-speed connection to the Internet. Bandwidth is the width of the amount of data that can be sent through a broadband connection and is expressed in bits per second. Broadband is a wide bandwidth connection that allows large volumes of data to pass through a medium at the same time. Narrowband is a two-channel ISDN connection with 128kbps in both directions. Mid-band allows 512kbps upload speed and 256kbps download speed. Broadband provides a greater than 512Kbps upload speed and a 256Kbps download speed. Wired broadband networks are implemented using a duct and chamber system. A civil and electronic engineering team implement the system. Metropolitan areas are connected to chambers and onto the main duct network by optical fibre cables. The different ways of connecting the consumer to broadband are, using a cable wire, optical fibre, DSL, microwave, satellite and fixed wire access otherwise known as wired open loop. The three main technologies are fibre optic, cable modem and DSL.
23
Forfs has produced a series of periodic reports that benchmark the competitive position, cost and quality of telecommunications services in Ireland against other EU countries. The conclusion is that Ireland is comparing poorly with overall take-up of broadband. There is a lack of growth in competing technologies and in the DSL market. Wi-Max is a standard based technology that can serve as a wireless connection alternative to DSL and bring broadband to rural areas. It is considered a development from Wi-Fi but has more range and bandwidth. Wi-Fi is an OFDM coding technology meaning high fidelity 802.11 networking. Fibre over Cabinet is a multi-service access platform that uses optical fibre to connect to cabinets. This is implemented by decreasing the length of the copper wire and increasing the reach of optical fibre so as not to have to replace all of the copper wire. MSAP is a convergence of broadband with multi-access network architecture. Virtual network Computing is a thin client system that reduces the amount of state maintained at a user terminal. VNC achieves mobile computing without having to carry any hardware. In a virtual computing system, the entire remote desktop environment can be accessed from any Internet-connected PC using the networking computing software. Access remote PC is a computer program that can be downloaded onto a PC so as to access computer desktops remotely. The remote PC can accept or deny access. Another program is LogMeIn, which is a development from PCAnywhere. This program is more robust and can break through routers and firewalls. The user has to create an account at the LogMeIn website so as to access a PC remotely. The remote PC must have client software installed so that its IP address can be added to the LogMeIn user customer account. Passwords are required to gain access and IP filtering uses the SSL protocol to encrypt data transmitted between the local and remote computer.
24
25
A decentralised data encoding system that sends binary data over a shared standard IP network is used to transmit the video stream to broadband. This is a standard system used to send email, web pages and to send files over the Internet. A wireless IP camera requires a wireless access point (WAP) to be located within line of sight distance from the transmitted video stream. The wireless access point can be located behind a router or firewall and access requires an administrator username and password. Compressed video can be carried anywhere over a LAN or broadband network so that any PC with a web browser can monitor and control the quality of video stream. The camera can be configured from any location that has LAN or broadband connectivity. The IP camera surveillance system is low cost because the IP protocol adheres to open standards and integration applications continue to develop. Event driven alert and alarm software can be incorporated so that the administrator can set configurations to trigger on events or when certain conditions arise and specific thresholds are reached.
Figure 3-1
IP Surveillance Network
26
Figure 3-2
3.3.1
The IP network camera can be placed at the back of a classroom to broadcast a lecture over the Internet. Students can observe and listen to a class remotely over broadband. The AXIS 230 camera is connected to the network using an Ethernet cable. The only other hardware required is the power adapter.
3.3.2
IP Address Configuration
1. The school administrator provides a fixed IP address for the camera. There is a default router address and subnet mask.
27
2. A software application installs the IP camera on to the local area network. This software can be downloaded or installed from a CD by the PC administrator 3. The serial number of the IP camera has to be entered in the field along with the static IP address for the camera. 4. When the fixed IP address for the IP camera is received and set on the application software page, the utility prompts to restart the camera and confirms that the IP address is set. To view the cameras home page the IP address is typed into the address bar of the browser window, http: //147.252.238.68/view/index.shtml. The remaining parameters of the cameras configuration can now be set up. The basic configuration page opens with links to settings for TCP/IP, date/time and video settings.
3.3.3
The IP address, default router address and subnet mask can be entered in the configuration table manually. When the camera is set up for DHCP (Dynamic Host Configuration Protocol) the set up is for default automatic IP configuration. This is because the IP camera changes the IP address setting whenever the system resets on power up. This will also depend on the network settings set by the administrator. DHCP means the PC can extract configuration settings from the server. The time zone can be set to automatic for daylight saving time changes. The video settings can be adjusted for quality where the higher the quality, the bigger the file size. A file size is 400 megabytes per hour is sufficient for video analysis. Event configuration sets up timed recording instructions. The Upload Servers link sets the network address, upload path and login information.
3.3.4
IP Camera Software
The Active Webcam Program can capture video at 30 frames per second from any IP camera or another video device. The program can record and broadcast simultaneously from any number of cameras. Images and sound can be sent over a broadband connection to any number of computers using the UDP protocol. The transmitted video and audio can be encrypted and password protected for remote access. The FTP protocol uploads the images for viewing on web browser and the software has its own http server.
28
3.3.5
Power over Ethernet (PoE) and 802.11 Wireless LAN are standards that make IP surveillance attractive over conventional CCTV systems. The IP cameras are powered using external PoE adapters and transmit over RJ45 Cat5 UTP Ethernet cables. There is no need for electrical wiring and cameras can be installed based on needs of application.
3.3.6
Implementing IP Surveillance
Power over Ethernet can be used to centralise power manage the surveillance IP camera network. The IP camera can be protected by UPS battery back up and a centrally managed surveillance system enables remote reset and shutdown. Network switches need to have speeds from 100Mbps to 10Gbps to optimise speeds, storage capacity and server reliability. With a large number of cameras, network speeds need to be 1Gbyte to the management centre and 100Mbps to each camera. Wireless IP cameras can be installed within a cell were there are 802.11g wireless access points. The 54Mbps 802.11g is a standard sufficient for video surveillance applications. The 802.11g wireless standard has inferior quality of service to a wired version because the network is slowed down with high-resolution images. Performance is dependent on resolutions and frame rates that are selected for each camera. There is a security standard called WiFi Protected Access (WPA) for Wired Equivalent Privacy (WEP) authentication and encryption of wireless signals.
3.3.7
Configuring an IP camera:
The service set identifier is made the same as that of the router. The transmission rate is set to 11mbps. Data is set for encryption. Authentication set to automatic. The key length is set to 128 bits. A 26-character key is set the same as that of the router and the rest of the wireless network. All other settings can be set to default.
By setting the SMTP information, the IP camera can send emails to a remote computer. Audio and motion sensing can also be configured.
29
3.3.8
The D-Link DCS 2100+ IP Camera has software to archive streaming video to the hard drive of the PC. The software can manage and monitor 16 cameras. The camera can be connected to broadband using an Ethernet cable or 802.11b. The wireless version only needs an access point to the Ethernet with access to an AC power connection for the power adapter. The following hardware can be used to test the system:
Broadband Wireless Router based on the Linksys*802.11b/g router.
PC consisting of an Intel Pentium 4 Processor with HT Technology 3.06 GHz running Windows XP.
An 802.11b/g router is 5 times faster, 54Mbps, than the 802.11b and is common on home networks. The router should be Wi-Fi certified with dual-mode access so that it can connect to a PC as well as a laptop notebook simultaneously. The router is connected between the computer and an external broadband connection to the Internet. By typing in the specific router IP address in the URL web browser toolbar, the PC can find the router automatically. The administrator password is used to log into the configuration process and security is set to 128-bit encryption.128-bit encryption strength is gauged by key length which is the number of bits in the key used to encrypt or decrypt a message. Web browsers use the Secure Sockets layer protocol for secure e-commerce transactions. SSL uses a public key for encryption and a private key for decryption of a message. Earlier implementations of SSL used 40-bit encryption, now 128-bit offers 309,485,009,821,345,068,724,781,056 additional combinations. This should be adequate for Internet for the next ten years. The IP camera is connected to a router using the Ethernet cable. If the camera is wireless, an antenna has to be set up. The IP installer software connects the PC to the camera. The Media Access Control address directs the PC to the cameras IP address and an image of the camera will then be displayed on the web browser of the PC. The router is necessary to share cable with other ADSL and satellite Internet connections. Computers speed up the running of applications when monitoring activities are offloaded to a router. Routers have filtering facilities to block access to certain sites and have security features built in to block viruses.
30
Routers can have advanced security to allow home users to log onto a business computer remotely. A Virtual Private Network uses virtual connections that are routed over the Internet from the company's private network to the remote site. The router can have its own firewall and create log files showing a history of network use. The router can also send email alarms to the remote PC.
3.4.1
ATM is used for videoconferencing because of the requirement for high bandwidth. The characteristics make broadband videoconferencing possible are the availability of high bandwidths, the flexibility in bandwidth usage, variable bit-rate capability, service integration, use of cell loss priority, multi-point distribution and flexible multiplexing. The disadvantages of ATM broadband are cell loss, cell delay variation and delay in forming packets.
31
H.321 defines technical specifications to adapt H.320 terminals to broadband ISDN. This allows the inter-working of terminals over broadband ISDN and over narrowband ISDN.
Figure 3-3
H321/H320 Interconnection
H.321 focuses on the inter-working of H.320 and uses the same audio and video coding formats and H.221 multiplexing as the recommendation for N-ISDN. There is a limit on bandwidth to 2Mbps. Compression techniques that do not have a limit on bandwidth can give higher quality video. H.221 gives a resolution of (352 x 288) pixels and this is called Common Intermediate Format (CIF). CIF provides a uniform process of receiving CODEC to interpret a compressed video signal and is adequate for many videoconferencing applications. The ATM Adaptation Layer 1 (AAL1) has a constant bit-rate that allows a videoconferencing system to take advantage of the variable bit-rate service that is defined for ATM.
32
To take advantage of broadband, the H.310 standard has been approved. H.310 fulfils the requirement for systems to be able to do audio-visual communication over ATM networks. H.310 defines uni-directional and bi-directional terminals and classifies different types of terminals. Video on demand, broadcast TV, messaging, video transmission and surveillance service can also be adapted to the videoconferencing system. H.321 is included in H.310 as one of the operating modes for internetworking with other networks. H.310 solves some of the limitations of H.321 by defining native ATM mode. It keeps the basic H.261 and G.711 as the codings for interoperability in video and audio respectively. H.310 also defines the use of MPEG audio and video which provides better quality native mode operation.
Figure 3-4
The H.310 Protocol reference model consists of the following protocol stacks: Out of band network access signalling stack for DSS2 signals. In band communication control stack for H.245 messages, in charge of logical channel signalling and capabilities exchange. H.320/H.321 interoperation modes stack using H.221 multimedia multiplex. H.310 native modes stack using H.222.1/H.222.0 multimedia multiplex. T.120 stack for data applications.
33
The H.310 defines different types of terminals on the ATM Adaptation Layer to support videoconferencing. Terminals over AAL1 benefit from the function of the AAL1 convergence sub-layer (CS) because of clock jitter removal, bit error correction, with cell loss recovery and data structure preservation. H.321 is made compatible by the AAL1. AAL5 CS provides less functionality-bit error detection, cell loss detection and data structure preservation. There is a high availability of integrated circuits that implement AAL5 CS as it is already present for User to Network signalling meaning it is recommended for videoconferencing.
Figure 3-5
3.4.2
H.323 is the ITU recommendation for videoconferencing over LANs and the Internet. H.323 can be applied to a packet switched network regardless of the physical layer. H323 uses H.261 and G.711 as basic audio and video coding formats to provide interoperability with other networks. The delivery mechanism of TCP is used to carry control information. There is the unreliable delivery mechanism of UDP to carry audio and video packets with no overhead and latency of retransmission. ATM uses H.323 by using IP over ATM and ATM is transparent for H.323 protocols. Carrying audio and video in packets using RTP/RTCP over AAL5 and control data is sent using IP over ATM will make the transport of audio and video more efficient The quality of service (QoS) capabilities of ATM can be used if RTP/RTCP was directly over AAL5 and thus solving the problem with IP over ATM methods to provide a better service on demand. A limitation is that a decentralized conference is not possible.
34
3.4.3
Broadband networks offer great potential for applications that make use of videoconferencing because the requirements of real time audio and video communication. ATM is the chosen technology for broadband networks. The different standards for videoconferencing take advantage of the capabilities of ATM such as Variable Bit Rate (VBR) services. VBR allows users to specify throughput capacity and a sustained data rate.
3.5 Summary
This chapter can be divided into two sections, IP camera surveillance and videoconferencing. The IP camera also called a network camera is a development from the webcam. The IP camera does not need the PC USB port as a connection, but has its own IP address and its own microcomputer embedded in the camera. The IP camera can be wired or wireless, but the wireless version is gaining more significance where it can be a cost effective alternative to traditional CCTV systems. Wi-LAN is a leader in wireless IP surveillance and has been perfecting solutions for wireless IP challenges for a long time. Key advantages of wireless IP Surveillance is: Cost effectiveness over traditional CCTV systems. Mix video, voice and data traffic on the one network. Easy integration to existing IP infrastructure. A flexible engineering solution with less effort and risk to the consumer.
To set up an AXIS MPEG-2 network camera, the administrator provides a static IP address with a default router address and subnet mask. If the camera is in the home, the default IP address is used. The PC looks for the IP address of the camera. The cameras configuration page pops up when the PC finds the IP address of the camera. The active IP camera program can then send images back to any PC that logs on to the IP address of the camera. The second part of the chapter describes videoconferencing, which is an application for the IP network camera.
35
In videoconferencing users can communicate simultaneously by means of audio, video and using electronic whiteboards. It allows simultaneous communication for geographically dispersed people. Multimedia conferencing describes the integration of audio and video communication. Until recently the H.320 ITU standard described the equipment and protocols needed for videoconferencing over ISDN. Broadband has now advanced audio and video compression to provide better quality videoconferencing. The standards that support videoconferencing over broadband networks are the ITU recommendations H321, H310, and H.323. ATM is the chosen technology for future ISDN broadband because of high bandwidth, variable bit rate capacity, multipoint distribution and flexible multiplexing. There are different standards developed by ITU-T videoconferencing over ATM such as adapting to broadband networks and taking advantage of broadband. H.323 is the ITU recommendation for videoconferencing over the Internet because it is applicable to a packet switched network regardless of the physical layer. H.323 can be used on ATM using the IP over ATM method. Audio and video are sent in packets using the Realtime Transport Protocol/Real Time Control Protocol (RTP/RTCP) over ATM Adaptation Layer 5 (AAL5) while data and control is sent using the IP over Asynchronous Transfer Mode (ATM). The chapter gave an overview of different standards available for videoconferencing over broadband. The opportunities for the use of IP surveillance technology using the IP network camera is brought into more significance by videoconferencing as well as being an alternative to traditional CCTV systems.
36
37
There are tables showing the coding system and block diagrams showing two typical applications. There is a definition of an XML Web Service, which is a mobile interactive solution for X-10 power line networking.
38
At the local network station, communication signals and electricity are carried together on the grid and transported to the home. Once in the home, all power sockets can systematically send and receive communication signals.
4.2.1
4.2.2
HomePlug Alliance is a group which includes Intel, Advanced Micro Devices, Motorola, 3Com, Cisco and Texas Instruments. Intellon is a company that designs and sells Integrated Circuits for power line communications and evolved from a group of companies in 1989. Intellon ICs create instant network access for broadband modems to the Internet using the electrical wiring in the home. The group intends to develop a power based home network standard based on power lines. The HomePlug Alliance Group certifies power line devices. The devices plug into an electrical socket and use the Ethernet to connect to computers and IP devices. A simple power line network in the home can consist of a cable modem or DSL router connected to a power line Ethernet Bridge that is plugged into an electrical socket. The PC is connected to another Ethernet Bridge and plugged into another socket. This completes the network.
39
Likewise, an 802.11b-enable power line device can receive a broadband signal from the DSL router through the home power grid and pass it wirelessly to an 802.11b adaptable PC. Another group called the R7.3 group of the consumer electronics association (CEA) were formed in 1999 to specify a data-networking standard based on power lines. The group is developing home-networking schemes that use existing power lines to send audio, video and data between devices in the home. Where the HomePlug Alliance group focuses on PC data networking, the R7.3 group concentrates on networking a broader range of devices such as consumer electronic appliances in the home. Homeplug devices are easy to install because of the simplicity of setting up a network because of the Ethernet requirement. There is 56-bit DES encryption. Homeplug 1.0 specifies modulation and transmission on Orthogonal Frequency Division Multiplexing (OFDM). HomePlug 1.0 uses 76 tones within a 4MHz to 21MHz spectrum. With OFDM, the tones have the best signal/noise ratio and are transmitted on a clean portion of the frequency spectrum where noise is filtered out. The throughput is 5Mbps to 8Mbps at the physical layer.
4.2.3
The basis for the HomePlug Power line Alliance standard is Intellons Power Packet technology, which uses an enhanced form of orthogonal frequency-division multiplexing. OFDM has forward error correction, which is similar to the technology of DSL modems. OFDM is a variation of frequency division multiplexing (FDM) used in the telephone network. FDM puts the computer data on separate frequencies from the frequencies that carry voice signals on the telephone line. The signal space is separated into data channels that are of uniform bandwidth. The ranges of frequencies on an electrical system using OFDM is 4.3MHz to 20MHz and are split into 84 separate carriers. The packets of data are sent simultaneously on several of the carrier frequencies to ensure speed and reliability. A Power Packet Integrated Circuit (IC) will sense any noise or power disruption on the frequency and switch the data to another carrier. This is called rate adaptive design that maintains an Ethernet-class connection throughout the power line network and does not lose data. This is a spectrum efficient modulation technique that makes it possible to generate data rates of up to 100Mbps.
40
Broadband access for streaming video and audio will require speeds of up to 14Mbps. This is available with the latest PowerPack technology. The technology is scalable and functions reliably on AC power lines. Intelogis is a company that designs computer peripheral equipment. Intelogis developed an older power-line technology that used frequency shift keying (FSK) to send data over electrical wires in the home. Frequency shift keying uses two frequencies, one frequency represents logic 1 and another frequency represents a logic 0. A data stream representing data that is made up of ones and zeros can be sent using the two frequencies between computers on a network. The frequencies are used in narrowband, which is just above the level where most noise occurs. The disadvantage is that it is unreliable because data flow can be disrupted if the frequencies are disturbed. This causes the computer to resend data. The amount of electrical noise has to be reduced by inserting line conditioning power strips between the wall electrical outlet and the computer equipment. The power strips reduce electrical line noise and come with the network kit. The power line network kits are only suitable for 110V AC electricity lines and therefore cannot be implemented in Europe because of the need for a 240V AC power line standard.
4.2.4
Broadband over Power lines (BPL) is the transfer of data through a combination of the power lines in the home or office building and the metropolitan power distribution grid. No new wires need to be installed between the power grid and the house. OFDM divides the available spectrum into narrowband and low data rate carriers called sub carriers. For high spectral efficiency the sub carriers are overlapping and orthogonal hence OFDM. The sub carriers are modulated separately using various formats such as BPSK, QPSK and QAM. In an electrical system, broadband is available on frequencies from 4.3MHz to 20.9MHz and are split into 84 separate carriers. With OFDM, packets of data are simultaneously sent along several carrier frequencies with increased speed and reliability.
4.2.5
QFDM Modulation
High bandwidth digital devices that communicate over power lines need to use a very powerful error correction coding system with appropriate modulation techniques. The desired properties to communicate over the power lines are to overcome non-linear channel characteristics, overcome multi-path spread of the signal and adjust dynamically to carrier conditions and to filter out noise. 41
QFDM is a collection of transmission techniques in a wireless environment. When applied to a wired environment it is better known as Discrete Multi Tone (DTM). QFDM divides the available spectrum into paths that are overlapping and perpendicular. Each path has a low data rate put all paths together create a high data rate and make a more efficient use of the spectrum. With small data packets, when there is an interruption in the electricity supply such as electrical devices being turned on and off, only a small amount of data is lost instead of losing the whole signal.
4.2.6
The power-line was never designed for communications transmission. There are variable levels of impedance, signal attenuation and noise. Numerous reflections occur due to structure such as multi-path propagation leading to multi-path fading in the power line medium. A combination of multi-path distortion and complex wiring topology result in a very complex channel transfer function. Power supplies produce harmonics, dimmer switches and halogen lights create coloured background noise. RF and spark plug ignition systems cause interference. The power line is a suitable medium for low speed control applications for home automation systems. Integrated circuits are being developed to send high frequency signals over the power line to the home. The technical challenges governing power line networking to achieve highspeed communication include: Time varying frequency response characteristics of the power channel. Power line noise. Power line network impedance. Telecommunication regulations for permitting communication outside the amplitude modulation frequency band. Modems to modulate the carrier frequency of between 50 and 500 KHz using frequency shift keying or amplitude shift keying require constant tuning. Choosing a good carrier frequency for communications is a compromise between noise and low attenuation at low frequencies to low noise and high attenuation at high frequencies. When data has been generated it needs to be placed on the power line by a coupling network. The signal is superimposed onto the 240V 50Hz power line waveform. There are three possible combinations of lines on which to couple the signal, live to ground, neutral to ground and neutral to live.
42
Asynchronous noise
Coloured noise
Narrowband noise
Figure 4-1
4.2.7
The main factor that causes a signal to be attenuated is the impedance of the line and the voltage drop as loads are encountered. Attenuation is about 5db over short distances of about 10 meters and increases with distance over the entire frequency range. Attenuation over long and unknown distances is about 25db for frequencies below 60KHz and increases to about 50db at 250KHz. The power line channel can be characterized as a multi-path propagation channel due to signal reflections that are caused by impedance mismatch between connecting mediums. The noise signals that dominate the frequency range between 100KHz and 10MHz are coloured noise, narrowband noise, periodic noise and a-periodic impulsive noise. Background noise is present in the power lines caused by the summation of various low power noise sources. Narrowband noise is due to sinusoidal and modulation amplitudes caused by medium and short wave broadcast stations. Periodic noise is synchronous or asynchronous to the mains frequency and results in a spectrum of discrete lines caused by switching power supplies.
43
Figure 4-2
Figure 4-3
44
A filtering technique is used to couple the signal onto the line and to remove the 60Hz AC waveform carrier. The LC coupling and filtering network is the preferred method because it is cheap and the filter response can easily be modified.
L1
C1 L2 C2
Vout Powerline
Figure 4-4
4.2.8
Power line communication uses frequencies that would interfere with amateur radio. The HF band is 1Mhz to 30MHz and PLC uses the band 1Mhz to 80Mhz. Very little power is needed to transmit in HF around the world because radio waves in HF bounce of the ionosphere multiple times to get to a destination. The rest of the radio spectrum can only propagate like light in a straight line and so dont bounce of the ionosphere. Electricity power lines, copper twisted pair and coaxial cable are natural low pass filters which mean high noisy frequencies are attenuated. Twisted pair is suitable up to 100Mhz Coaxial cable is suitable up to 3GHz Power-lines are only suitable up to 20 KHz which is audio frequency.
Power lines are high radiators of frequencies used by PLC where the other mediums are low radiators. PLC is a high polluter of the radio spectrum causing a large rise in noise in urban areas. Repeaters that clean up the data signal emit frequencies in the same range as the radio frequencies used by HAM radio operators. Broadcasters of radio can be concerned about interference that would prevent their signal reaching their listeners. There were two competing Power-line Communication Systems (PLC) systems in operation in Crieff, a town on the southern edge of the Scottish Highlands that both interfered with HF reception. Tests done in four locations showed that interference from the main network modem was audible to residents who were able to receive very strong radio broadcasts. Reception was significantly impaired at various locations on a street between a residence and a substation despite the distributor cable being placed underground.
45
4.2.9
This is a method of transmitting microwaves over an electricity power line. Microwave is a technology that could be used because it does not interfere with HF radio. A system has been developed by Corridor Systems in the US using the microwave spectrum that is in the 2GHz to 20GHz range. The speed is up to 216Mbps and is a faster data rate than the HF system that is in the 1.7Mhz to 80MHz range. The microwave system can use 802.11 chipsets to achieve lower cost and avoid HF and VHF frequencies completely. Microwaves can transmit over a wire because HAM radio operators once used a UHF/microwave transmission line to send and receive radio signals. G-line is a technology that uses a cone shaped launcher to transmit a microwave signal along a wire.
4.3.1
The Spread Spectrum transmission technique is a pseudo-noise (PN) code that is independent of information data. It is a modulation waveform that is used to spread signal data over a bandwidth that is much greater than the signal information bandwidth. At the receiver, the signal is de-spread using a synchronised replica of the pseudo-noise code. There are two basic principles of SS systems, Direct Sequence Spread Spectrum (DSSS) and Frequency Hopping Spread Spectrum (FHSS)
4.3.2
DSSS is a pseudo-shift in phase where the PN signal generated at the modulator is combined with PSK modulation to shift the information signal pseudo-randomly. The transmitted bandwidth is determined by the clock rate and by base-band filtering. The maximum clock rate limits the maximum spreading rate. The clock rate is an integer multiple of the symbol rate.
46
A short code sequence uses a PN code length that is equal to the data symbol. A long code length uses a PN code that is much longer than the data symbol. A different clock pattern is associated with each symbol.
4.3.3
FHSS is pseudo-shift in frequency where the PN signal generated by the modulator is combined with FSK modulation to shift the carrier frequency of the FSK signal pseudo-randomly. The transmitted signal occupies a random number of frequencies at a time. FHSS divides the available bandwidth into N channels and hops between these channels according to the PN sequence. A frequency synthesiser dictates one of 2n frequency positions. Transmitter and receiver follow the same hop pattern.
4.3.4
The pseudo-noise signal does not reject random white Gaussian noise. This zero mean white Gaussian noise (WGN) has the same power spectral density, G(WGN)(f) for all frequencies. White means that white light contains equal amounts of all frequencies within a visible band of electromagnetic radiation. A pseudo random (PN) code sequence acts as a noise-like carrier used for bandwidth spreading of the signal energy. The length of the code sets the bounds on system capability. A PN code sequence is a pseudo noise or pseudo random sequence of 1s and 0s. It is periodic and therefore is not a real random sequence and random signals cannot be predicted. Autocorrelation of a periodic PN sequence is defined as the number of agreements less the number of disagreements in a term by term comparison of one full period of the sequence with a cyclic shift of sequence itself. Autocorrelation of a PN code has properties similar to that of white noise. Pseudo Random is not random but looks randomly for the user who does not know the code. The transmitter and receiver know the periodic signal. The longer the period of the PN spreading code, the closer the transmitted signal is to a true random binary wave and the harder it will be to detect. The statistical properties of sampled white noise are Short code which has the same PN sequence for each data symbol (NcTc = Ts) and Long Code where the PN sequence is much longer than the data symbol (Nc Tc >> Ts).
47
The properties of a PN code sequence are the balance property, where the number of binary 1s is different from the number of binary 0s and the run length distribution, where the digital signal has an autocorrelation function that is similar to white noise signals. The frequency spectrum of a PN sequence has spectral lines due to the periodic nature. The lines come closer to each other with increasing sequence length. Each line is smeared by data scrambling which spreads each spectral line and further fills in between the lines to make the spectrum continuous. The zero-one balance of the PN sequence determines the DC component.
4.3.5
Narrowband Interference is noise spread by multiplication of the noise with the PN sequence of the receiver. Spreading and de-spreading requires a higher bandwidth in exchange for a reduction of narrowband noise. The signal data is multiplied twice by the PN sequence, but the interfering noise signal is only multiplied once. This is how the SS system rejects narrowband noise. Wideband interference is the multiplication of the received signal with the PN sequence of the receiver. This causes a selective de-spread of the receiver signal and this induces a smaller bandwidth and a higher power density. The interference signal is uncorrelated with the PN sequence and is spread over the frequency band. Wideband noise is due to multiple SS users in the system causing Gaussian noise. There is no increase in SNR of the SS signal and the larger bandwidth increases noise power. This is due to the SS signal having a lower power density than that of the transmitted signal.
4.3.6
M-Sequence is a message type meaning maximum length sequence where the length of the sequence is Nc = 2L- 1. A Simple Shift Register Generator (SSRG) governs the message length.
f(x1,x2,x3,...xn)=c1x1+c2x2+c3x3++cnxn
---
OUTPUT
Figure 4-5
48
PN codes must have an autocorrelation property for good synchronisation and a low cross-correlation (orthogonal code) property for low Multiple Access Interference (MAI). MAI is interference between direct sequence users and is a factor that limits capacity and performance of DS-CDMA systems.
4.3.7
(CDMA) is a method for multiplexing wireless users by using distinct orthogonal code. Each user transmits at the same time and each user is allocated the entire available frequency spectrum for transmission. CDMA does not require the bandwidth allocation of FDMA or the time synchronisation of the individual users as in TDMA. A CDMA user has full time and bandwidth available but the quality of the communications channel decreases with the increased number of users. Crosscorrelation is a measure of agreement between two different codes. When the crosscorrelation is zero, all of the codes are orthogonal. With CDMA, multiple users occupy the same RF bandwidth and transmit simultaneously. When the user codes are orthogonal there is no interference between the users after de-spreading of the signal. Privacy of communication for each user is protected. Crosscorrelation between codes increases noise power after de-spreading due to codes not being perfectly orthogonal and limits the maximum number of simultaneous users. Hadamard-Walsh codes are used for synchronous CDMA and Gold codes are used for asynchronous CDMA. Hadamard Walsh codes are generated in a set of N = 2n codes with length N = 2n using a rows and columns HN matrix. Gold codes are product codes achieved by using Exclusive OR gates to exclusive-or the two multi-length sequences that are the same length. The code sequences are added by synchronous clocking. The msequence codes maintain the same phase relationship and the codes generated are the same length as the two base codes that are added together. The autocorrelation function is worst than that of the m-sequence and the change in position of the two msequence codes causes a new gold code to be generated.
4.3.8
Multi-path Channels
In wireless channels multi-path propagation is where there is more than one path from the transmitter to the receiver of a communications network. The causes of multi-path communication are atmospheric reflection or refraction, reflections from the ground and buildings and fluctuation in the received signal called fading caused by each path having its own attenuations and delays. 49
4.3.9
ISM Bands (Industrial, Scientific and Medical) are frequency bands that are reserved for SS applications. ISM Band 902-928Mhz 2.4-2.4835Ghz 5.725-5.850Ghz Table 4-1 Bandwidth 26Mhz 85.5Mhz 125Mhz ISM Bands
Traditional SS techniques such as direct sequence and frequency hopping have a problem of synchronization because of varying noise and frequency dependent attenuation. It is difficult for the receiver to track a hostile power-line environment. Therefore the traditional SS technique will not work due to complexity and high implementation cost. There is an analogue Spread-Spectrum physical layer interface for power-line data communication that is suitable for home networking. The proposed scheme uses a chaotic system to modulate the information signal onto the AC 240V 60Hz waveform. The system does not need quantization and complex synchronisation and therefore can be implemented at low manufacturing cost.
Appliances can be controlled locally but appliances can also be controlled remotely using keypads, radio and infrared remote controls, timers and computer interfaces. With a computer interface the appliances can be controlled remotely over the Internet using a broadband connection. The control signals are transmitted over the domestic electrical wiring. Controllers dont have to be connected to each appliance but a single controller connected to the electrical fuse box can control all appliances. The X-10 protocol can provide the controllers with the status of each appliance such as an on or off signal. Appliance modules generally do not have a status indicating facility and this has to be taken into account. The X-10 code format is the excepted standard for power-line carrier (PLC) transmission. The code was first introduced in 1978 for the Sears Home Control System. Original Equipment Manufacturer (OEM) versions of X-10 home control systems were developed for companies such as General Electric. Versions for Germany, France and Switzerland were developed as well as for Japan and Australia. All systems use the code format that is compatible with the original version in the USA. OEM takes advantage of a base of X-10 customers which use X-10 Powerhouse standard modules. OEM signifies that the particular version of that product does not come in a retail box. Installation instructions are loaded using a CD with reference to a printed manual.
4.4.1
X-10 Principles
X-10 compatible signals are coupled to the power line using the transmitter PL513 and transmitter/receiver TW523 interfaces. Power line interfaces and permission is needed from the ESB to transmit code in X-10 format over the power line. This is granted to purchasers of the interfaces. The PL513 is a transmitter and the TW523 is a transmitter receiver and both plug into the standard AC power sockets. They connect to an OEM product using the RJ11 telephone cable. An opto-coupled 60Hz square wave is synchronised to the zero crossing point of the 240AC power line signal. The X-10 codes that are generated by the OEM module are synchronised to the zero crossing point of the AC 240V signal. The OEM drives 1ms envelopes of 120KHz carrier signal to the TX input of the interface. These envelopes must be as close as possible to the zero crossing point of the AC 240V signal. A custom made IC reads and error corrects the X-10 codes from the power line so that the microprocessor in the OEM product does not have to continually monitor the power line and check X-10 codes for validity.
51
4.4.2
The X-10 code is applied in envelope form to the OEM product. There is a start code (1110) to alert the module that an X-10 code is to follow. A 1 bit from the TW523 interface appears as a negative pulse 1.1ms long beginning approximately 100s after the zero crossing point. The OEM samples the data between 500s and 700s after the zero crossing point. A LED on the TW523 interface gives a visual indication that X-10 codes are being received. If a code received is different from a code transmitted there is the assumption that corruption has occurred by noise on the power line or a data collision. This is achieved by the X-10 device reading from its own output. There is a line monitoring facility to ensure that there are no X-10 signals already on the power line before an X-10 signal is transmitted. A transmitter waits for a random number of power cycles before transmitting an X-10 signal. The signal envelope carrying the X-10 code is a 120KHz burst with a delay of 50s. The PL513 or TW523 power line X-10 interface generates a 50Hz square wave with a maximum delay of 100s from the zero crossing point of the 50Hz AC 240 signal.
Figure 4-6
52
All X-10 transmitters send out three pulses for each signal for a 3-phase system. The transmitter releases a pulse every 60 to concede with each zero crossing point of a 3phase electrical system.
Figure 4-7
Figure 4-8
Figure 4-9 A = 0110 B = 1110 C = 0010 D = 1010 E = 0001 F = 1001 G = 0101 H = 1101 Table 4-2
House or Letter Code I = 0111 J = 1111 K = 0011 L = 1011 House or Letter Code 53 M = 0000 N = 1000 O = 0100 P = 1100
A binary 1 is represented by 1 ms burst of 120 KHz at the zero crossing and a binary 0 is represented by an absence of a 120KHz signal. The 1ms bursts are transmitted three times to concede with the zero crossing point in a three phase distribution ESB system. A complete code takes up eleven cycles of the 240Volt 50Hz AC waveform. Immediately after the House (Letter) Code a number or Unit code is sent
Figure 4-10 Unit Code 1 = 01100 2 = 11100 3 = 00100 4 = 10100 5 = 00010 6 = 10010 7 = 01010 8 = 11010 Table 4-3 9 = 01110 10 = 11110 11 = 00110 12 = 10110 Number or Unit Code 13 = 00000 14 = 10000 15 = 01000 16 = 11000
Figure 4-11 Standard X-10 Transmission While transmitted pulses are 1ms in duration, the receiver opens a window of only 0.6ms.A complete code transmission is eleven cycles of the AC electricity supply
54
line. The first two cycles represent a Start Code, the next four cycles represent a House Code and the last five cycles represent a Unit (number) Code. Data is transmitted twice to allow for redundancy, repeaters and for reliability. Whenever the data changes from one address to another address, from address to a command or from a command to an address, the data frames must be separated by six zero crossings (or 000000). When a receiver has processed its address data, it is ready to receive a command code. A start code and the house code are sent first followed by a command code.
Figure 4-12 Command Code On = 00101 Off = 00111 All Lights On = 00011 All Lights Off = 00001 Table 4-4 Command Code Bright = 01011 Dim = 01001
Figure 4-13 Complete Transmission A standard X-10 transmission takes duration of 47 cycles of AC signal. Each eleven cycles of one start code, house code and one unit or function code is known as a frame. The transmission begins with a start code (1110) followed by four cycles of house code and then by five cycles of number or function code. Apart from the start code, the house and function code data is transmitted in true and complement form on alternate half cycles. This adds up to 18 bits. If a 1ms 120KHz burst of signal appears on a half cycle, this will represent logic 1. The absence of a 1ms 120KHz burst of signal will represent a logic 0 and this is on the next half cycle. There are 16 different house codes and there are 32 different key codes (function or number codes).
55
The key code 00000 is not used. This makes up 256 X-10 devices represented by different house and key codes. House codes are represented by a specific sequential four-bit pattern. Bit 0 is transmitted first. The bit sequence does not correspond to ASCII codes. The codes are unique for X-10. The bit pattern of 4 bits is transmitted in true and complement form hence 8 bits are used to send a 4-bit house code and 10 bits are transmitted for every 5 bit key code. The X-10 code and message format is displayed in appendix 1.
4.4.3
The physical layer transmits the data over the power lines. A simple scheme is to use a tone of 120Khz or the absence of a tone of 120Khz to convey a binary 0 or a 1 bit data transfer. The data link layer implements the start code framing sequence transmitted on alternative half cycles. The start code is a code that cannot occur within a message; this tone is a tone-tone-tone-no tone (1110) signal. The presentation and application layers define the content of the message and how to interpret the code. The codes are made up of house codes and key codes. X-10 does not implement the network, transport or session layer.
56
Passive infra-red motion detectors issue control codes when movement is detected. X-10 security floodlights are controlled like an ordinary lamp. Relay modules control electronic devices. X-10 controllers for light and temperature level detection. Plug in control keypads from units that control single code devices to multiple code devices on the same unit code to large desktop multi-channel units. These units require a neutral connection.
Telephone-based receivers convert touch tone telephone key presses to X-10 signals.
4.5.1
A microcontroller board can be used to interface the PC to the X-10 network. The onboard processor can read sensor signals and send X-10 signals to the power-line interface module, TW523. Analogue sensors are interfaced to the microcontroller using A/D converters. To support remote software development, the microcontroller can be simulated using LabView front panels.
4.5.2
A relay can be used to switch high-powered loads such as a lamp or a motor, low power loads, isolated loads and slow toggling devices. A triac can be used to switch medium power non-isolated loads and where rapid control is required such as the dimming of lights.
57
Lighting, fountains and pumps in a garden can be controlled using a triac. A TIC206D is a device that can trigger with low gate current. It is a 4-amp device, which will switch a 500Watt 240V load. Phase control and the dimming of lamps can be achieved by programming a triac to switch on at a certain points in the half cycle. Burst fire control is where devices are switched on and off for a number of half cycles of the power-line AC signal.Burst Fire control is ideal for central heating systems because time constants are long compared to the power-line frequency but unsuitable for lamps because of flickering. Logic Intelligence is where the X-10 device is controlled by central intelligence. The PC runs an environmental control program to monitor the interface to the power-line. The microcontroller can think for itself as if it is built into the household appliance. A digital sensor, DS1621 can measure temperature. Burst fire control can be used to set up a temperature control system for a green house where X-10 extended commands remotely set the target temperature. A photo sensor or a light dependent resistor, ORP-12 with a 47ohm pullup resistor can be used for day and night detection. RS232 Port RJ11 Telephone Jack X10
PC Software Control
Figure 4-15 Microcontroller and tuned amplifier signal conditioner The household appliances can be divided into categories and form a lookup table in the software such as appliance controller, lamp controller, movement sensor, temperature sensor and light sensor. A sample application is to interface a PIC 16C54A microcontroller IC from the PC to an X-10 household device.
58
The house and unit address is multiplexed onto four input pins by using eight diodes. Applications such as a garage door or a window blind opener require current limit switches. Other I/O pins can be used as switch inputs to sense when a door or blind is fully opened or closed so as to switch a motor on or off. Security can be improved by using a non-standard coding scheme. A control driver for all X-10 data coding and timing drives the TW523 from the software on the PC. A control driver can be modified to send non X-10 data so that a personal set of commands can be created. Non-standard coding ensures appliances cannot respond to a neighbours coding scheme or react to an interfering RF signal.
4.5.3
The source code is version 1.3 of the Microchip MPASM assembler. The PIC16C54 does not support hardware interrupts so the program flow has to be arranged in a loop. The manual push button switch and the zero crossing detectors need to continually poll for the signal. The power line is sampled at each the zero crossing point and a test is made to detect the code format of 1110 which indicates the start of the X-10 sequence. When a code of 1110 is detected after the zero crossing, subsequence cycles are sampled to extract the X-10 signal data. An MC563 mini-controller reads the X-10 data. There is a MT522 mini-timer and an SH624/ND561 RF remote/security console. There is an extra blank cycle produced by the ND561 security console, which generates a gap between the house and unit data sequence and the house and function data sequence. The software recognises the gap and resynchronises with the data. The X-10 data stream has all addresses and data duplicated for error checking. (Data sheet and source code for the PIC16C54A microcontroller are listed in Appendices)
start code 1110 house addr 8bit unit addr 10bit start code 1110 house addr 8bit unit addr 10bit gap start code 1110 house addr 8bit 10bit func start code 1110 house addr 8bit 10bit func
Table 4-5 House Unit and Function bit Sequence The house address is transmitted in an 8-bit sequence where each pair of transmitted bits corresponds to one bit of house code. A 01 sequence transmitted corresponds to a 0 and a 10 sequence corresponds to a 1.
59
A house code C is 0010 is transmitted as 01011001. The unit and function codes are transmitted in 10-bit sequences. The last two bits are 01 for a unit address and 00 for a function code. When the house address, unit address and function code is captured from the data stream the address is compared to the setting of the house/unit address switches. When there is a match, the transmitted function takes place on that address. Look up tables are used to convert the bit pattern from the address switches to the transmitted data in the address sequence. To increase the input/output capability of the PIC microcontroller, the house/unit addresses can be coded into the firmware of the PIC16C54. There is no need for an address switch and there will be eight extra pins on the PIC12C54 available for use. It is necessary to monitor X-10 data on the power-line to control appliances over the power-line. Instead of a triac being used to turn on the appliance, an opto-isolator can be driven with RS232 data. At each zero crossing point on the AC power line, an ASCII 0 or a 1 is transmitted to indicate the absence or presence of the 120KHz carrier. The X-10 data can be captured and displayed on the PC that is running a terminal program.
Table 4-6 CM11A Cable Parameters CM11A cable connections, header and transmission code byte are displayed in appendix 1. Header byte 0x04 is represented by binary 0100 and signals the CM11A that the following transmission is an address command with standard transmission method. The second transmission byte is 0x66 and is address, A1. A checksum is sent to the PC and the PC returns 0x00 to indicate transmission is correct, the interface then replies with 0055 to say it is ready for another transmission.
60
Header byte 0x06 is represented by 0110 and signals the CM11A that the following transmission is a function. The function commands the CM11A to switch on or off an appliance in a house coded A. The PC is attached to the power line via the CM11A interface from the RS232 port. The household appliances are attached to the power line using PCS04/TW513 receivers and PCS05/TW513 transceivers. Remote control can be over a broadband connection or from a control panel communicating with the RF transceiver interface directly. The CM11A can be wired or wireless and each transmitted command is synchronized and sent within 200s of zero crossing point of AC power line. A command packet requires eleven cycles of the power line to transmit and the CM11A serial interface controller handles this functionality independent of the PC. The PC controls the system in real time and remotely over the Internet. System behaviour is programmed in advance and status of the system can be continually monitored.
Remote Controller
Water Sensor
CM11A Interface
PCS04/PL513 Receiver
PCS05/TW523 Transciever
RS232 Connection
Lamp
Iron
61
4.6.1
XML web services are an infrastructure for presenting services to mobile computing devices such as PDAs or mobile phones. The infrastructure uses an X-10 communication protocol and the web services paradigm as the core technology for accessing household appliances across a network. X-10 services consist of a software layer that is able to translate requests of diverse mobile clients versus the X-10 devices. The X-10 communication protocol has a lower level of the architecture with a CM11A X-10 transmitter module that is connected to the computer via the RS232 port. Communication to the sensor devices is by way of the electricity supply network where the appliances are plugged into electrical sockets.
62
4.7 Summary
Broadband over Power Lines (BPL) means delivering broadband internet data to homes and businesses using the electricity supply network, the largest existing network structure in the world. Other methods are the telephone lines, cable TV, wide area microwave, DSL and cable. BPL uses radio frequency energy to carry data and has a variety of modulation schemes. There are advantages to using the electricity power lines to supply broadband. There is no regeneration over long distances and no re-wiring of buildings. Remote monitoring and plug and play can be implemented since every electrical socket in the house can be a broadband connection. The limitations are unpredictable noise, security, narrowband and wideband interference. QFDM is a modulation method that divides the spectrum into paths which overlap. QFDM creates a high data rate with small data packets and if packets get lost only part of the signal is lost. Research is ongoing on Spread Spectrum (SS) technology as a method to interface data signals to power lines. SS spreads an FSK or a PSK modulation waveform over a bandwidth that is greater than the signal information bandwidth, a limitation is that it does not reject Gaussian noise. G-line technology is where a microwave signal is transmitted over a wire and the same principle can be applied to sending high speed broadband over an electricity supply line. The X-10 system uses modules that plug into the electrical sockets in the home to interface data signals from appliances to the electricity supply network. A 120KHz burst of data is superimposed and synchronized to the 240V 50Hz signal at the zero crossing points. The X-10 signal consists of a Start code, House Code and Unit Code so as to be able to address a device within a building. The PC can be used to transmit X-10 code to devices over the electrical wiring. The PC can be interfaced to the X-10 network using a PIC microcontroller or a CM11A X-10 interface. By accessing the PC remotely using virtual networking computing, household appliances, such as the alarm system, washer dryer, audio video equipment, heating and ventilation can be controlled and monitored over the Internet. The appliance module would have to send back status signals so that remote operation is possible. A number of software packages are commercially available to download from the Internet to drive X-10 transceivers.
63
64
65
5.1.1
Overview of LabView
LabView by National Instruments can be combined with the Web to provide remote control of instruments over the Internet. It is a software tool that uses graphical programming to produce virtual instruments on the PC. LabView has its own web server with built in software for Internet connectivity such as TCP/IP and UDP functions. By opening the web browser, a Java applet interface is used to remotely connect to an instrument running LabView at another location, Using PC remote software, the instrument can be controlled over the Internet. A client program can communicate remotely with a distant computer to remote control and monitor instruments and devices. LabView has a graphical user interface that saves time and effort in programming. LabView is continually being upgraded for broadband application. The latest version, LabView 8 dramatically simplifies the development of distributed systems by delivering distributed intelligence. These are a collection of technologies that simplify the development of processes running across remote devices and applications. The protocol needed to transmit LabView data through the Internet is called the TCP/IP (Transmission Control Protocol/Internet Protocol). The DSTP (Datasocket Transfer Protocol) was developed as a sub protocol for data communication through the Internet. Various DSTP functions can be used with LabView.
5.1.2
In programming using LabView there are two windows called a Block Window and a Control Window. The block window is for programming and the control window is the graphical user interface. The graphical user interface window controls experimental parameters and monitors data. To control a remote device over the Internet, LabView uses the TCP/IP protocol. LabView has TCP and UDP VIs, and also functions that can be used to create client and server VIs. TCP/IP is uses to communicate over single networks or interconnected networks. Large geographical distances can separate individual networks. TCP/IP routes data from one network to another and is available on most computers.
5.1.3
IP performs a low level service of moving data between computers. IP packages data into components called datagrams. A datagram contains the data and a header that indicates the source and destination addresses. 66
IP specifies the destination and determines the correct path for the datagram across the network to that destination. IP cannot guarantee delivery of a datagram and does not retransmit the datagram if a failure in delivery occurs.
5.1.4
UDP is a low-level communication process between computers. Processes communicate be sensing datagrams to a destination or port. (A datagram is a selfcontained, independent entity of data carrying sufficient information to be routed from the source to the destination computer without reliance on earlier exchanges between this source and destination computer and the transporting network. A port is a location to which data is sent. IP handles the computer-to-computer delivery). After a datagram reaches the destination computer, UDP moves the datagram to the destination port. If the destination port is not open, UDP discards the datagram. UDP is used were reliability is not critical. UDP is not a connection-based protocol and there is no need to establish a connection between source and destination. The destination is specified, and UDP socket or port is opened using UDP open Function in LabView. The UDP open function returns a network connection reference that defines the port or UDP socket. The UDP write function is used to send data to the destination and the UDP read Function is used to receive data from a source address. Each read operation contains the source address and a port number. UDP can be used to send short datagrams, but because it is not reliable large datagrams are sent using TCP. The UDP close Function finishes all communication on a port to free system resources. UDP functions communicate with a single client on a subnet by broadcast. UDP functions must be configured to iterate through a list of clients.
5.1.5
TCP ensures reliable transmission across the Internet. The datagram is retransmitted until there is an acknowledgement received. TCP/IP is built into Windows and UNIX and LabView requires no additional set-up. With the Apple Mac operating system, LabView requires that Open Transport is included in Mac OS 7.5 or later. TCP is a connection based protocol. Sites must establish a connection before transferring data. Multiple and simultaneous connections can be made using TCP. A connection is made by seeking a specified address to establish a connection or to wait for an incoming connection. The address and port number at that address must be specified. 67
A number between 0 and 65,535 represents the port. Where there is more than one port at a given address with different numbers, this represents more than one service. UNIX reserves port numbers up to 1024 for privileged applications. In LabView, the TCP open Connection function established a connection with a specified address and port. When the connection is successful, the function returns a network connection refnum that uniquely identifies the connection. Subsequent VI calls can use this refnum as a reference to this address and port.
5.1.6
The TCP Listen function creates a listener and wait for an accepted TCP connection at a specified port. If the connection is successful, the VI returns a connection refnum which references the address and the port number of the remote TCP client. The TCP Create Listener function creates a listener and uses TCP Wait on Listener function to listen for and accept new connections. The TCP Close Connection function closes the listener to finish waiting on a new connection. It is not possible to read or write to a listener. When a connection is established the TCP Write function or TCP Read function is used to read and write data to the remote application.. The TCP Close Connection function terminates the connection to the remote application. TCP is used for reliable data transmission. UDP is used for higher performance but this does not ensure reliable data transmission.
5.1.7
The TCP Open Connection function opens a connection to the server where the Internet address of the server and the port number for the server are specified. The address identifies the computer on the network. The remote port identifies a communication channel on the computer that the server uses to listen for communication requests. The port must be specified so that the server can use this port for communication. The TCP Write Function is used to send a message to the server. The TCP Read function reads a message from the server but the number of bytes to be read must be specified. The TCP Close function closes the connection to the server.
68
5.1.8
The TCP Listen function is used to wait for a connection. The port, which is the same port as that of the client is attempting to access, must be specified. Once a connection is established a TCP Read function is used to read from that port to retrieve the message. The TCP Write function is used to return data in a form that the client accepts which is the number of bytes specified by the client to read. The TCP Close function is used to close the connection. If there is a server or client crash, the network application must be able to handle time outs and errors. To allow for this each client VI function has a timeout. When there is a failure, the client continues to try and establish a connection and eventually reports an error. The client can shut down the application.
5.1.9
A standard feature of LabView is labView remote panels. A user can quickly and easily publish the front panel of a LabView program for use on a standard web browser. Once published, any user on the web with the proper permissions can access and control an application from a PC with LabView installed. An application to control a device in the household such as a washing machine can be run locally using LabView were the device is connected to the computer through a standard interface. Labview can be interfaced with devices in the outside world using the Universal Serial Bus (USB), the General Purpose Interface Bus (GBIB) or Data Acquisition Hardware (DAQ) which is a serial or parallel interface board connecting external devices to the host computer. The client can be any computer running a web browser and connected to the Internet. Once connected, the client computer can log onto the remote computer, which is the server and observe the LabView front panel on the local PC. An application of LabView remote monitoring is set up at the Swiss Federal Institute of Technology. Mechanical engineering students are able to watch in a classroom as the professor uses a laptop computer to control a remote mechanical system. Visual feedback is provided using video conferencing software. Both video and LabView servers run in parallel, independent of the local host computer.
69
70
71
5.2 Controlling X-10 Devices using LabView 5.2.1 Overview of LabView 8.2
LabView 8 is the most up to date graphical programming language that can be used to control X-10 devices over the Internet. The graphical icons incorporated as a set of functions and controls can be used to build a software graphical program to control the X-10 interface to the PC. The X-10 interface can either be the CM11A interface or a PIC microcontroller. No lines of text need to be written to build the software. There is a robustness and speed in writing programs and debugging can be done easily. Most X-10 devices have software that can be downloaded to control devices. The software is not available to control X-10 devices over the Internet. LabView has a TCP/IP application software built in and therefore can be implemented to control and monitor X-10 devices over broadband Internet. A typical LabView program consists of a front panel and a block diagram. Each program is called a virtual instrument (VI) and a sub program is called a sub-VI. A LabView program to measure temperature can be set up on the PC that is interfaced to a temperature control sensor.
Figure 5-1
Figure 5-2
Figure 5-4
DAQ Assistant can be used to show the connection diagram for the Data Acquisition Hardware (DAQ) device. A task or virtual channel is selected by clicking on Connection Diagram tab. The virtual channel in the task can be viewed with terminal numbers for connections to a connection block.
5.2.2
The data acquisition hardware is installed in the PCI slot of the computer and is detected. The drivers for the DAQ card are installed from CD or downloaded from the National Instruments website. If no DAQ hardware is available the program can be simulated using a virtual instrument. National Instruments measurement devices are packaged with NI-DAQ driver software, which is a library of VIs and ANCI C functions that can be implemented into a LabView program from application software. These devices are signal conditioning modules and switch modules.
74
Driver software has an application-programming interface (API). There is a library of VIs, functions and properties for creating applications for interfacing devices. NiDAQ7.x is a development from the older traditional NI-DAQ software for configuring and programming DAQ interface boards to graphical user interfaces. The newer version software has two additional NI-DAQ drivers and each has an applicationprogramming interface with hardware and software configuration. Ni-DAQ7.x is the most recent version with LabView 8. It has advantages over the traditional NI DAQ software. DAQ Assistant is a new graphical way to configure virtual channels and measurement tasks for a device. N1-DAQmx code is generated based on virtual channels for use with LabView, LabWindows/CVI, measurement studio and a VI logging facility. NI-DAQmx simulation is available for devices for testing and modifying applications without having to install equivalent hardware on the computer. There are intuitive APIs for creating DAQ applications which use fewer functions and VIs that are an earlier version of NI-DAQ. LabView is one of the software packages that can be used to implement the application of NI-DAQ. A CD comes with the driver software for the DAQ device. The Ni-DAQ installer detects NI software installed on the PC and automatically selects latest versions of a driver, application software and language support files from the CD. PCI devices are plugged into the PCI slot of the computer motherboard. It is advisable to discharge static from the chassis of the PC. This is done by touching the metal part while being statically grounded on an anti static mat while physically attached to a wristband earth cable. The best way to insert PCI DAQ card in the PCI slot is to rock the device into place gently. PCMCIA devices can be installed in a TYPE 11 PC Card slot. A PCMCIA bus connector of the device is inserted in a slot of the laptop PC. PXI card devices are available for a PXI chassis under same procedure as installing PCI card devices in the PC chassis. USB/IEEE 1394 Devices are connected to the computer USB or IEEE 1394 port using a cable to a similar port on the device. The PC recognises a USB or IEEE 1394 device when the power LED on the devices flashes or lights up. Accessories and terminal blocks are installed by referring to instruction manuals. Windows will detect any new hardware and install the driver software by default. To confirm a device is recognised, the Measurement and Automation icon is double clicked on the desktop to open MAX, and Devices and Interfaces is expanded to locate NI-DAQmx devices. 75
To simulate a DAQ when there is no plug in device, Devices and Interfaces is right clicked upon, a list of devices appears and a device is chosen. Right clicking on the device and then selecting properties will configure devices. The window in properties is configured to set up the application.
5.2.3
A sample application can show the capabilities of X-10 devices and the LabView web server. The application is to maintain the temperature of an aluminium block at about 45C. The temperature of the block can be obtained using a Thermister. The block can be heated using a soldering iron connected to an X-10 device. Controlling the temperature of an aluminium block heated by a soldering iron simulates the CM11A X-10 interface control scheme of a central heating system. The control scheme for heating the aluminium block is described in the flowchart. An initial decision box ensures there is enough temperature range to simulate the process of heating and cooling a soldering iron. If there is no initial set up, it is impossible to control the temperature. A temperature reference is chosen to be 18 C. A decision box determines if Tsp (Ti + 5) <13 then Ta =13C. Otherwise Ta = Tsp (Ti +5) where Ta = Tsp Ti and Ti is the initial temperature of the iron. Tsp is a set point temperature and Ta is temperature difference Tsp Ti. The soldering iron will be on when: Tc = current temperature, is less than or equal to (Tsp - 13C) or when ( Tsp (Ti + 5C)). When the initial temperature is set up, the flowchart moves to a second phase to control the heating scheme. When the temperature of the soldering iron is between (Tsp 1.42) and (Tsp 1.6), the soldering iron is turned on. The temperature of the soldering iron is maintained between a Tsp of 2C.
76
Start
Yes
No
Ta = 13
Yes
No
Yes
No
Yes
Solder Iron On
Tsp = Temperature Set Point Ti = Initial Temperature Tc = Current Temperature Ta + Temperature Difference ( Tsp - Ti )
Figure 5-5
5.2.4
Thermocouples and Resistive Temperature Devices (RTDs) are used in applications where a temperature needs to be monitored. Thermocouples are the most widely used sensor in industry. They can be used to monitor temperatures from subzero to 2000C. A Thermocouple takes advantage of the voltage induced between two different metals as both metals are heated. By connecting a Thermocouple, there are three different metals used in the circuit.
77
The junctions between the metal and measurement device produce thermoelectric voltages that are proportional to the temperature at the device terminals. Cold junction compensation is used to remove an unwanted effect of having three different metals causing thermoelectric voltages. A Thermister is used to measure the coldjunction temperature and then this adds to the appropriate value of measured voltage. RTDs dont have this problem of parasitic thermocouple effects and there is no thermovoltage produced at the junctions to the device. RTDs are precision temperature sensors and are more accurate than Thermocouples.
Sensor Thermocouple Resistive Temperature Devices (RTD) Advantages Simple and rugged Wide operating range Passive Fastest response to temperature change No resistance lead wire problems Most stable over time Most accurate Most repeatable Resistant to corrosion No CJD required High Cost Slow response time Vibration Sensitive Decalibration if used beyond temperature range Disadvantages Least stable Low sensitivity to small temperature changes Low Accuracy Requires CJD which introduces error into system
5.2.5
Thermistor
A Thermistor can be used to measure the temperature of an aluminium block because it is more sensitive than a Thermocouple or a RTD device. A Thermistor is a temperature sensitive resistor and the resistance temperature relationship is negative because the resistance decreases with increasing temperature.
78
Figure 5-6
The thermistor curve can be approximated using the Stein-Hart equation; 1/T = A = Bln(R) + C (ln(R)) 3 T = temperature in degrees Kelvin, R = resistance of the Thermistor in K. A,B,C = curve fitting constants found by selecting three data points from the manufactures published data curve and solving three simultaneous equations. To measure temperature the Thermistor is connected to a power supply with a current limiting resistor. The circuit can be connected to the PC using a data acquisition card to measure voltage and LabView can be used to convert the measured voltage to temperature data. The purpose of the Thermistor is to imitate a thermostat where accuracy is not important but to achieve accuracy a Thermocouple or a Resistant Temperature Device is required.
R1
DC
Thermister
Figure 5-7
79
5.2.6
X-10 Thermostats
The TX15 and TX15-B model is a thermostat for an X-10 system and can be used for remote control, The TX15 model is a standard model and can receive X-10 commands, while the TX15-B can receive and transmit X-10 commands. The TX10 consists of two wall units, a wall display and a control unit. The wall unit is the traditional thermostat that monitors the current temperature and changing set point. The control unit is connected to the central heating, ventilation and air-conditioning system. The control unit receives X-10 commands to control setpoints and thermostat modes. The setpoint and fan mode settings are sent to the control unit by X-10 commands. The control unit turns on the heating when the temperature falls below a setpoint or the cooling system when the temperature rises above a setpoint. The control unit is connected to the power line using an external PSC05 X-10 interface module. The Thermostat has a house code and a unit address for X-10 communication. When reading temperatures in Fahrenheit, the Fahrenheit column is used and when reading temperatures in Celsius, the Celsius column is used. There is no relationship between the two columns.
Figure 5-8
80
Device Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 F 72 73 74 75 76 77 78 79 80 81 82 83 84 86 88 90
On Command C 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
Off Command Degrees F Degrees C SYSTEM OFF HEAT MODE COOL MODE AUTO MODE 40 5 60 6 62 7 63 8 64 9 65 10 66 11 67 12 68 13 69 14 70 15 71 16
5.2.7
The X-10 CM11A is an important communication device between the computer and the X-10 devices. The device can receive and send commands over the power line. The Virtual Instrument can be displayed on the desktop of a laptop or PC remotely using LabView remote panels. Remote control and monitoring can be implemented using the TCP application of LabView remote panels or by using an application of virtual computing such as Remote-PC-access, or LogMeIn from PCAnywhere. The following CM11A library software can be downloaded from the National Instruments website, the link of which is direct to a message forum listed in the references at the back of dissertation.
Figure 5-9
81
The following front panel and block diagrams are examples taken from the VIC_X10 library that can be downloaded from the National Instruments website. An ON/OFF LabView front panel and block diagram for CM11A X-10 interface are displayed in appendix 2 of the dissertation.
Figure 5-10
Figure 5-11
82
5.2.8
Sensors and signal lines are attached to terminal blocks and accessory terminals on the data acquisition board or to a PIC Microcontroller/CM11A board for control of X-10 devices. DAQ assistant and automatic code generation is used to control digital I/O lines to either send or receive a 5V TTL signal. The light control is an array of numeric controls. The outer white number and the up/down arrows control the index of the array. There is only one digital port therefore there is only one element in the array (element 0). The inner grey numeric control changes the value of element 0 in the light control array.
Figure 5-12
83
Figure 5-14
PIC Microcontroller LabView Front Panel Data Bits Stop Bits Parity Bits Stop Bits Baud Rate 8 1 0 1 19200
Table 5-3
The program reads ASCII values from the RS232 communication port and stores the values in a "read buffer" in the form of an array. The values are converted into decimal form and stored in a buffer array called a Resultant Array. A single value from this is then calculated and placed into a time delay variable. There is a calculation to obtain a velocity and frequency measurement that can be then converted to decimal form. A "Count Value" determines the number of characters to be read in a loop.
84
5.4 Summary
There is a sample application to test the LabView 8 webserver and the CM11A X-10 interface module. The aim is to adjust the temperature setpoint of an aluminium block connected to a soldering iron. LabView is a chosen programming language for the application because it is easy to program and debug. LabView is a graphical programming language where there is no need for codes or lines of text. A typical LabView program has a front panel and a block diagram. Each program is a virtual instrument (VI) and a sub program is a sub-VI. LabView has added on software to implement a webserver. The webserver is based on the common gateway interface (CGI). Java and ActiveX can also be used to control VIs through the Internet but extra software is required. X-10 devices can be controlled using the LabView Internet toolkit. The programming required is to set up a set of macros to perform tasks such as the switching on and off of lights. Web security is protected by authentication and by using logging information to account what a user is doing. A Thermistor is used instead of a Thermocouple or an RTD device because it is the most sensitive. A Thermistor is a temperature sensitive resistor. The CM11A communication device is an important communication device to interface a PC to an X-10 device. The CM11A is connected to the serial port of the PC. The LabView program for driving the CM11A module is a simple program that can be built on the LabView block diagram using sub-VIs. It will then become a virtual instrument. The VI can also be found by searching the National Instruments website. There is a forum on this site in which users can communicate and exchange ideas about implementing certain applications. The model TX15B Thermostat has an X-10 bidirectional protocol that allows a range of commands to implement information feedback to the remote controller. This module can be used with a CM11A interface to a LabView program on a PC. The webserver remote panel application of LabView can enable control and monitoring from a remote location. The protocol needed to transmit data through the Internet is TCP/IP. This can be achieved by logging onto the IP address of the remote PC and enabling remote panels to communicate with the client computer. 85
6.2 Common Gateway Interface control of Household devices 6.2.1 Overview of CGI
When writing a program to control and monitor a household device in LabView a CGI toolkit can be used to build an interactive interface for the remote computer. The program screen can be accessed over broadband using virtual computing software. A dynamic form with image maps and counters can process and record status history. The CGI standard specifies how http servers run external programs on the server machine. There is a mechanism to pass parameters to external programs and send an output in the form of an html page to the web browser. CGI takes an input and produces an output so as to process e-commerce and authenticate credit card numbers when purchasing items over the Internet. The CGI does not define a language to be used in external programs but only defines the interface between the http server and the external code. Code can be written in C, C++, Perl and Visual Basic to run a CGI application.
86
Figure 6-1
A CGI can provide forms that ask for feedback from the user that is surfing the Internet. The feedback can be house status or registration information. A CGI can provide an image map of the house. House appliances can be activated and deactivated by mouse clicking within the image map. A counter can display the number of users that accessed the image map. Utilities can be used to search a database for a particular device. There are three steps to processing a CGI application, firstly the web browser sends a http request to the webserver. The http server then calls an external CGI application and finally when the CGI application has finished executing, it returns the output to the web browser. LabView has an Internet Toolkit of VIs to create, write and read from client and server side cookies. Internet Toolkit>>CGI VIs>> Cookie VIs A cookie is a token that uniquely identifies some information. Client side cookies store a small amount of data of about a 4K limit on the browser. Server side cookies keep this information on the server but the information is deleted after a period of time. Cookies maintain state information across Internet connections. Cookies remember the parameter values as a client navigates a website. Http is a stateless protocol because each time a client wants a document from the server a new connection must be established. The server receives the request and returns a reply and the connection is then closed.
87
Figure 6-2
6.2.2
Event driven computing are programs that run systems that have interactive human computer interfaces, client server architectures and embedded systems. Programs adapt to an environment with concurrent processes and uncertainties. A CGI can be used to run a program on an application to control and monitor a device or interface on a computer using a web browser over a broadband connection. Java and Active X are other technologies that can be used with LabView to monitor and control information remotely. The Internet toolkit in LabView provides a complete set of CGI VIs that can be used in CGI applications. A LabView program using CGIs can load and run a VI dynamically from the web browser. The information on an html form is fed to the inputs of a VI. The results are then published back to the web browser. Security can be set up using schemes to access VIs with user authorization and authentication. A dynamic web page can be set up like a web counter using LabView.
88
Image maps can be used so as to click on a part of a VI panel image to simulate the behaviour of a VI as if it were inside the web browser. Html forms gather information from the client side for a CGI application. Forms are built with html and contain text input boxes, radio buttons, checkboxes, pull down menus and clickable images that are all nested in a form tag. <form name = MyForm action = /cgi-bin/process_form.vi method = GET></form> An imagemap is a snapshot image of a VI front panel. The image is clicked upon to send information to the CGI application. Image input<INPUT TYPE=image> creates a push button image. The x, y co-ordinates of the mouse pointer are included in the form that is submitted to the server. A hotspot is a hyperlink on a particular part of the image defined on an image map. An image map could be a map of the house showing the location of all the appliances. An appliance can be activated or deactivated by clicking on the image of that appliance within the image map of the house. Client side image maps are best created using a HTML editor such as Dreamweaver or Microsoft Frontpage.
6.3 Prototype Home Automation Project using Project54 6.3.1 Overview of Project54
Project54 Consolidated Advanced Technologies Laboratories is a design to integrate electronic devices such as radar, video, lights and an alarm into a common control system. This was designed in the US for police cars so that equipment could be centrally controlled from a windows based computer program. The project54 system provides control of functions through voice commands, an LCD touch screen and a keyboard. Many systems do not create a complete home automation system because of limitations in the hardware and software. Documentation of home automation systems have to be found and the drawbacks analysed. A judgment is then made on how to improve the system. A Project54 software program with hardware prototype can be built to help solve limitations. 89
The GUI that has been created for a police car could be adapted for a house automation system. Functions to be implemented are control of lamps, control of a heating system and the control of a burglar alarm. The PC interface must allow control of these devices and visualize a state in real time. A vocal control device can send feedback to the user on the state of each device. The function of the PC interface is to allow the remote client to control the system over a broadband connection in real time. The client can program the system behaviour in advance and send back the status of the system. The system needs three types of devices, X-10 devices control lamps, Weeder technology devices to control light sensors, a motion detector, a sprinkler system and iButton devices to detect temperature. The Intelligent Transport Data Bus (IDB) allows the use of the RS232 port to control peripherals. The IDB bus consists of IDB boxes. The IDB boxes are networked using a CAT5 network cable with an RS232 port to each box and connected directly to the PC.
Figure 6-3
The system hardware consists of a centralized PC controlling and monitoring the system, two IDB boxes connected in series to the PC and onto a CM11A module to the network. The CM11A interfaces to the house electrical powerline to control the X10 devices appliance modules, an X-10 2-way appliance module and an X-10 2-way lamp module.
90
Figure 6-4
Figure 6-5
91
6.3.2
Going to Define devices window configures devices. The House Status window displays Show all Devices and verifies that all devices are configured properly. The House Control window sets devices on or off. The House Status window displays Show Current Device Status for a particular house/unit address. Other devices can be added to the system by adding another IDB box and a new application can be created. Control of X-10 devices can be distributed on different computers using the proxy application of Project54. A microphone in the room or building connected to a voice recognition system can be added so that the user can control a device using voice encoding. The system can recognise that the user has a licence to activate the system. Voice over IP could be used to remotely activate a device over TCP/IP using a broadband connection.
Figure 6-6
92
Figure 6-7
93
The problem with the system is that conserving energy can conflict with the occupants preferences such as controlling heating and lighting. The control of lights is complicated because of light pattern and intensity. It is not adequate for lights to go on only when motion is detected, lights have to stay on when the person is sitting still on a chair reading a book. It takes 700ms for an X-10 device to react to a sensor sending a signal to that device and therefore X-10 is an insufficient protocol for generating commands for lights. The range of time scales involved in the control of lights spans many orders of magnitude and control decisions must respond within fractions of a second to changing environmental conditions. A control system can be based on a neural network reinforcement learning and prediction technique. Neural networks are artificial learning devices inspired by the workings of the human brain. These networks are made up of hundreds or thousands of simple neuron like processing units, which through their interactions, achieve complex behaviours and have the ability to learn from experience. A neural network could predict when the occupant returns home, determine when to start heating the house and detect statistical patterns of water use so as to turn on and off the immersion at certain times. An information database can be created listing the occupants behaviours and the system can learn to control the light patterns and intensities as well as to turn on and off the TV and stereo. Inferring the occupancy and usage pattern of the utilities in the house, the system can make life comfortable for the family while conserving energy in the home.
6.4.2
Ache
Ache means adaptive control of home environments. A system can be designed to manage all comfort aspects of a home, including air, water temperature, ventilation and lighting. The objectives of Ache is the anticipation of the persons needs, in that lighting, air temperature and ventilation are maintained to the inhabitants comfort need and hot water is available on demand. Lights have to be maintained at minimum intensity required and water maintained at a minimum temperature to satisfy demand so as to conserve energy. To achieve a conservation of energy objective the system has to be able to anticipate activities and work within tolerances.
94
Figure 6-8
ACHE diagram
Ache specifies the intensity of lighting setting that, which affects the state of the environment. This in turn serves as an input to ACHE. The training signals of ACHE are the actions taken by the occupants of the house and the energy costs. Data from the sensors can be sent to the PC using data acquisition boards or a micro-controller interface board. The PC detects the changes in sensor values and sends the data over the RS232 interface to a DEC 3000/600 UNIX workstation. On the workstation a server is running that maintains the current state of the house and computes a statistics table on the state of the environment. The server communicates with clients on the network so as to perform the operation of ACHE. When a client needs to control a device, the server passes the message to the PC. The PC then communicates directly to low voltage devices or by using a microcontroller. The microcontroller sends the commands over the AC power line to the device to be controlled. The electricity supply line can also send back status signals via the microcontroller to the PC when the inhabitant physically changes the state of a device such as dimming the lights or resetting the alarm. The DEC 3000/600 UNIX server can be remotely located outside the home. The PC can communicate with the server anywhere in the world by sending and receiving data over a broadband connection to the Internet. Traditional techniques of control theory and artificial intelligence is hard to implement because the behaviour of the occupants is not stationery and controlling devices are non linear. Multiple interacting devices have to be controlled simultaneously and there are only incomplete models of the environments and controlling devices.
95
Figure 6-9 Basic system Architecture of ACHE There are three control domains, lighting, heating and ventilation that represent the architecture of ACHE. The instantaneous environmental state is fed through a state transformation that computes statistics and averages, minima, maxima and variances in a window. The result is a state representation that provides information about environmental and instantaneous values. The instantaneous value is sent to an occupancy model. The occupancy model is governed by motion detectors and determines occupancy status when there is no motion detected. Predictors take the current state and forecast the future states of devices. Control decisions are then made concerning energy devices in the home. A set-point generator determines a set point profile for a lighting level or a temperature setting. A device regulator controls the physical devices to achieve the set-point. The control of the set-point generator and the device regulator is to achieve knowledge about habitual preferences. The set-point generator and device generator are built on a combination of look up tables and neural networks. They are trained in Q learning, a reinforcement learning technique. A control task for each zone is treated independent of other zones. A Q learning controller is implemented as a pair of look up tables, one for a zone being occupied and another for a zone being unoccupied. The components of ACHE are an occupancy predictor, a zone anticipator and a lighting set point generator.
96
Figure 6-10
6.6 Summary
When surfing the web there are interactive processes that ask for feedback and registration information. There are image maps that allow various parts of an image to interact with the mouse and counters that display the number of users of a document with utilities that allow the user to search databases. The effects are achieved using the common gateway interface (CGI). A CGI produces an interactive website and can be implemented with LabView to generate an interactive remote monitoring system using the LabView TCP application. 97
CGI lets http servers run other programs on server machines. A CGI consists of an input that produces an output to the browser. Code to handle a CGI includes C, C++ and Visual Basic. The CGI defines the interface between the http server and the external code. A simple CGI application would be a calculator, a CGI that can be written in LabView. The CGI application takes the input data through a web browser and performs the calculations in LabView before sending the results back to the browser. There is a vision that household devices such as appliances, multimedia entertainment audiovisual equipment as well as temperature and lighting units will have microprocessors that will enable interactive communication. Project54 is a remote monitoring system for police cars and the principles can be adapted to implement a home automation system. Neural networks have potential for intelligent control. A home can be equipped with sensors to provide information about environmental conditions such as temperature, lightning and motion within a room. The sensors can interact with the home PC, remote laptop or PDA to provide a communication medium over broadband. ACHE is a system that controls a home automation by adapting to the inhabitants needs while conserving energy in the home.
98
99
There are six mediums of communication, power line, twisted pair, infra red, radio frequency, coaxial and fibre optics. Power-line communication uses amplitude shift keying with 120 KHz bursts on the line. The presence of a 120KHz burst represents a superior state and the absence of a 120Khz burst represents an inferior state. The unit symbol time (UST) of 1ms is used where a logic 1 is one UST and a logic 0 is two USTs. An end of frame (EOF) is 3ms long and end of packet (EOP) is 4ms long.
Figure 7-1
The proposed chaotic SS scheme directly modulates the analogue multimedia signal onto a bifurcation parameter, of a chaotic system. Chaotic Parameter Modulation (CPM) modulates the information symbols, Si [0, 1]. By setting i = g (si) and keeping in the chaotic regime, the transmitted signal is chaotic and has a broadband spectrum. The resultant chaotic signal is converted to the RF band in the RF unit and coupled to the powerline network using the line coupler. The modulated chaotic signal then propagates through different paths in the powerline that is characterised by different attenuations and phase delays before reaching the receiver. At the receiver, after RF demodulation, the channel-distorted signal containing powerline noise is sent to the ergodic demodulator. The demodulation process of CPM is a parameter estimation problem of from noisy observations of the received signal.
Figure 7-2
101
S C Input R
Figure 7-3 Mean Value Estimator, Windowed Integrator as a Demodulator The proposed ECPM-SS can be implemented using a SIMULINK package in MATLAB. The performance of the proposed chaotic SS scheme can be compared with conventional direct sequence SS (DS-SS) in realistic power-line environments. The transmitted signals from all devices are combined together and passed through a time varying power channel. The power channel is corrupted by power line noise. Each communication link has a gold sequence that is used to spread the information signal and the receiver uses the same gold sequence for signal recovery. The analogue multimedia signal is quantized before transmission in DS-SS. A tent map is used to generate the chaotic signal.
Figure 7-4
Figure 7-5
Original Waveform. Transmitted wideband chaotic waveform. Received waveform. Integrator output. Recovered waveform. Squared error signal.
103
7.5 Summary
Virtual networking allows a remote user to access a PC remotely from anywhere in the world. VNC is thin client system in that it does not need an operating system and is available to download. The software allows a PC to be set up as a server and the remote PC to be set up as a client. Any software on the remote PC can be accessed locally on another PC by logging onto the IP address of the remote PC. If the remote PC has a program such as LabView that is interfaced to devices in the home, the remote software can be accessed and run as if on the users local desktop. WiMax is a wideband method of connecting broadband to remote areas. WiMax has a range of 50Km with a transmission rate of 70Mbps. It is suitable only for data and VoIP. The IP camera can be used to replace CCTV. The IP camera has its own built in IP address and can be accessed remotely by installing installation software on the local PC. The IP camera can be used for videoconferencing that uses ATM as the technology to communicate video over a broadband connection. Broadband over electricity supply networks can be a reality when the noise suppression techniques are sufficient to compensate for the deficiencies and interferences problems this will encounter. Appliances are interfaced to the home PC over the house electricity supply network using X-10 modules. Communication over the power lines uses the physical layer of the ISO model where a tone of 120KHz is a 1 and the absence of a tone of 120Khz is a 0. The tones are superimposed onto the zero crossing point of the 240V/50Hz AC signal. There is a 120KHz pulse at three intervals on a three-phase system because there are three zero crossing points instead of one. A CM11A adapter interfaces the PC to the electricity mains network. LabView has a TCP/IP application with Remote Panels so as to communicate over a broadband connection. In this way a local PC with LabView installed can communicate over a broadband connection to a remote PC with LabView running. The host PC can request and gain control of the LabView program on the remote PC. A program can be created using virtual instruments to control a CM11A interface connected to the remote computer. The CM11A X-10 device communicates over the AC power line network to the household appliances by sending instructions from the remote PC and relaying status data back to the remote PC.
104
Data acquisition software is used to communicate a LabView program to a measurement device. PCI devices are connected to the computer motherboard and communicate with the outside world to external devices. DAQ software can be downloaded from the National Instruments website. A home central heating system can be simulated in LabView. A soldering iron is interfaced to the PC using a data acquisition board and a temperature sensor such as a Thermistor or Thermocouple. A program written in LabView, Visual Basic or C tests and makes decisions on whether to switch on or off the soldering iron so as to maintain the temperature of the aluminium block at approximately 45. A common gateway interface is where interactive graphics on computer screens are generated. CGI is a standard specification that lets http servers run other programs on a server machine. It defines the interface between server and code. The code can be LabView, Visual basic, C, or C++. Project64 is a system used in the US to interface a remote police station to a police car. It can be used to interface household devices to a computer. A GUI is used to simulate the device and functions can be implemented to control an alarm system, heating or the TV in real time with voice feedback. ACHE is a system model for remote control of household devices while conserving energy in the home. A microcontroller interfaces the PC to the electricity supply network to send control signals to appliances as well as relaying status signals back to the PC. Communication has always been based on hearing and vision corresponding to communication of voice and video over broadband Internet. Video resolution for delivery to the human eye has to be uncompressed at a data rate in gigabytes per second. The data rate for DVD quality has to be 10Mbps and for broadcast needs to be 40Gbps using compressed video. Broadband has to take 100Mbps for high definition video delivery to a household and broadband over optical fibre is an only realistic interface to the home. The Ethernet will be a dominant standard for the next ten years and PCs with 1GHz speeds will have the capacity to transmit and receive high data rates. Technologies already exist to carry broadband over installed telephone lines and house electrical wiring. Wireless broadband is too slow for video but is useful within the home to connect broadband to the nearest wired access point.
105
APPENDICES
106
Appendices
Appendix 1
X-10 House and Unit Code Formats
Code A B C D E F G H I J K L M N O P H1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 H2 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 H4 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 H8 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0
Table A 1
Start Code 1110 1110 2 Cycles Start Code H1 /H1 0 1 0 1 0 1 H2 /H2 H4 /H4
1 0 1
107
Appendices
Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Units Off Lights On On Off Dim Bright Lights Off Ext. Code Hail Req Hail ACk Pre-Set Dim Ext Analog Status = on Status = off Status Req
D1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1
D2 1 1 0 0 0 0 1 1 0 1 0 0 0 0 1 1 0 0 0 0 1 1 1 1 0 0 0 1 1 1 1
D4 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 1 0 0 1 1 0 0 1 0 0 1 1
D8 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 1 0 1 0 1 0 1 0 1 X 0 1 0 1
D16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Table A 3
108
Appendices
CM11A Cable Connections PC Header: Code Checksum Acknowledge Interface ready to receive Interface
Format for first Transmission to CM11A Interface 5 4 3 2 1 CM11A Header 1 F/A 0 E/S
Dims define the dimming function of a lamp X-10 module. The number of Dims is between 0 and 22 (22 is 100% of lamps are dimmed). Bit 2 is for synchronization. F/A = (0), the code to follow is an address. F/A = (1), the code to follow is a function. E/S = (0), following byte is standard transmission. E/S = (1), following byte is extended transmission. Code: Address Function H1/bit7 H2/bit6 H4/bit5 H8/bit4 D1/bit3 D2/bit2 D4/bit1 D8/bit0 House Code House Code Table A 7 Device Code Function
109
Appendices Function only operates with devices addressed with the same house code. When the CM11A interface receives data from the PC, all the bytes are summed and a checksum byte is returned. The PC acknowledges by returning a value hex 0 (0x00) if the checksum is correct or will retransmit the data and look for a new checksum if incorrect. When an X-10 transmission takes place, the CM11A interface sends 0x55 to the PC to indicate that the CM11A is ready for another transmission. PC 0x04, 0x66 0x6A 0x00 0x55 0x06,0x62 0xEE 0x06,0x62 0x68 0x00 0x55 Table A 8 7 6 5 4 3 2 1 Application Presentation Session Transport Network Data Link Physical Table A 9 PC to CM11A Codes CM11A Interface Description Address: A1 Checksum: ((0x04 +0x66) & 0xFF) OK for transmission Interface ready Function: A ON Incorrect Checksum Re-transmit function Checksum: ((0x06+0x62) &0xFF) Ok for transmission Interface ready
Specifies interactions between applications Controls formatting for display, Print & Encryption Security, Logging and Administrator Functions Ensures error free transmission of Data Ensures data arrives at correct destination Defines rules for sending & receiving data Implements physical transfer of Data between computers ISO Layer Model for an X-10 System
110
Appendices
Appendix 2
Configuring a Data Acquisition Board
Configure a DAQ board and an SCC (signal conditioning carrier) in Measurement and Automation Explorer (MAX)
Figure A 1 Configuring a DAQ Board The DAQ SC-2345 Connector Block has terminals J1 to J21 and configured by selecting the modules that are attached from a list in drop down menus. SCC-FT01 feed through module for analogue input. SCC-TC02 thermocouple module. SCC-SG03 stain gauge module. An additional SCC-FT01 for analogue input.
111
Appendices
Figure A 2
If there is no hardware available, a device can be simulated by clicking on Devices and Interfaces and clicking New, select Simulated Device and then Finish. A simulated device for any application from Thermocouple, Thermister or Strain Gauge can be selected. The devices can be programmed to simulate a physical device being present.
112
Appendices
Figure A 3
113
Appendices
Appendix 3
Figure A 4
The high performance RISC CPU has 33 single word instructions where all instructions are single cycle (200ns) except for program branches which are two cycle. The operating speed is DC-20Mhz and DC-200ns instruction cycle. Device PIC16CR54C Pins 18 I/O 12 ROM 512 RAM 25
Table A 10 PIC16CR54C Specification 12-bit wide instructions. 8-bit wide data path. 7/8 special function hardware registers. 2-level deep hardware stack. Direct, indirect and relative addressing modes for data and instructions.
Peripheral Features: 8-bit real time clock/counter (TMRO) with 8-bit programmable prescaler. Power on Reset (POR). Device reset timer (DRT). Watchdog Timer (WDT) with on-chip RC oscillator for reliable operation. Programmable code-protection.
114
Appendices Power saving SLEEP mode. Selectable oscillator options: RC: Low-cost RC oscillator. XT: Standard crystal/resonator. LP: Power saving, low-frequency crystal.
CMOS Technology: Low power, high speed CMOS ROM technology. Full static design. Wide operating voltage and temperature. ROM commercial/Industrial 3.0 V- 5.5 V < 2mA typical @ 5V, 4 Mhz. 15A typical @ 3V, 32 KHz. < 0.6A standby current. (WDT disabled) @ 3 V, 0C to 70 C. Low Power consumption.
115
Appendices
VCC RA1 RA0 OSC1 OSC2/CLKOUT VDD RB7 RB6 RB5 RB4 18 17 16 15 14 13 12 11 10
1
1 2 3 4 5 6 7 8 9
U2 RA2 RA3 RTCC /MCLR VSS (GND) RBO RB1 RB2 RB3
RP1 100K
2 3 4 5 6 7 8 9
PIC16C54A
16 15 14 13 12 11 10 9
SW2
Figure A 5
PIC16C54A Microcontroller Integrated Circuit Switches 5 - 8 (House Address) are read on inputs RB4 RB7 Switches 5 - 8 (Unit Address) are read on inputs RB4 RB7
116
Appendices
Appendix 4
Source Code for PIC16C54 X-10 Appliance Module
; X-10 Receiver ; Client: ; File Name: ; File Date: ; Target Device: ; Clock Type: ; Watchdog: ; Code Protection: ; Customer ID Code: ; Assembler: ; Code Revision: TITLE LIST In House X10RX128.ASM 16 August 1996 PC 16C54A 4MHz Xtal, 1uS Instruction Cycle On Off 'ABAC' MPASM version 1.30 1.28 First released version
;Generic Definitions W F EQU H'0000' EQU H'0001' ; Result Destination = W Register ; Result Destination = F Register
; Standard Register Files INDF EQU H'0000' ; Indirect Addressing Register RTCC EQU H'0001' ; Counter PC EQU H'0002' ; Program Counter STATUS EQU H'0003' ; Status Register FSR EQU H'0004' ; File Select Register PORT_A EQU H'0005' ; Port A Input/Output Port PORT_B EQU H'0006' ; Port B Input/Output Por ; STATUS Register Bits #define CARRY STATUS, 0 ; Carry Bit #define DIGCARRY STATUS, 1 ; Digit Carry Bit #define ZERO STATUS, 2 ; Zero Bit #define NOT_PD STATUS, 3 ; Power Down Bit #define NOT_TO STATUS, 4 ; Watchdog TimeOut Bit #define PA0 STATUS, 5 ; Page Preselect #define PA1 STATUS, 6 ; Page Preselect #define PA2 STATUS, 7 ; Future use
117
Appendices ; OPTION Register Bits PS0 PS1 PS2 PSA RTE RTS EQU EQU EQU EQU EQU EQU H'0000' H'0001' H'0002' H'0003' H'0004' H'0005' ; Prescaler divide ratio Eight divide ratios: ; Prescaler divide ratio WDT 1:1 to 1:128 ; Prescaler divide ratio RTCC 1:2 to 1:256 ; Prescaler Assignment 0=RTCC 1=WDT ; RTCC Pin Signal Edge 0=Rising 1=Falling ; RTCC SIgnal Source 0=Clock 1=RTCC Pin
; Fuse Definitions and Configurations _CP_ON EQU H'0FF7' _CP_OFF EQU H'0FFF' _WDT_ON EQU H'0FFF' _WDT_OFF EQU H'0FFB' _LP_OSC _XT_OSC _HS_OSC _RC_OSC EQU H'0FFC' EQU H'0FFD' EQU H'0FFE' EQU H'0FFF' ; 32kHz ; 100kHz - 4MHz ; 4MHz - 20MHz ; 100KhZ - 4MHz
__FUSES _CP_OFF&_WDT_ON&_XT_OSC __IDLOCS H'ABAC' __MAXRAM H'01F' ; Input/Output Port Assignments #define TRIAC PORT_A, 0 ; Triac Gate Drive #define ZEROX PORT_A, 1 ; Zero-Crossing Detector Input #define CARRIER PORT_A, 2 ; Mains Carrier Detect #define BUTTON PORT_A, 3 ; Push Button Input #define UNIT3 PORT_B, 0 ; Unit/Function Code 3 #define UNIT2 PORT_B, 1 ; Unit/Function Code 2 #define UNIT1 PORT_B, 2 ; Unit/Function Code 1 #define UNIT0 PORT_B, 3 ; Unit/Function Code 0 #define HOUSE0 PORT_B, 4 ; House Code 0 \ #define HOUSE1 PORT_B, 5 ; House Code 1 | 0 to 15 #define HOUSE2 PORT_B, 6 ; House Code 2 | re-assigned as #define HOUSE3 PORT_B, 7 ; House Code 3 / A to O
118
Appendices ; Register File Variables FLAGS EQU H'0008' ; Bits used as status flags COUNT EQU H'0009' ; Counter used by Wait routines HOUSE EQU H'000A' ; House code, 0 - 15 == A - P UNIT EQU H'000B' ; Unit code, 0 - 15 == 1 - 16 RXHOUSE EQU H'000C' ; Received House code, 0 - 15 == A - P RXUNIT EQU H'000D' ; Received Unit code, 0 - 15 == 1 - 16 RXFUNC EQU H'000E' ; Received Unit code, 0 - 15 == 1 - 16 #define LOAD Define Macros TriacOn macro BCF TRIAC endm TriacOff macro BSF TRIAC endm GetBit macro locn CALL ReadBit RLF locn, F endm FLAGS, 0 ; 0=Load is off, 1=Load is on;
119
Appendices ;X-10 COMMAND FORMAT ; ; start unit house gap house start function ; house start unit start function house ; ;NB: Total of 94 zero-crossings used, 95 with ND561 (*) ; Control console/RF remote produce one extra blank half-cycle; ; (7 instead of 6) in gap: ; ;Control console ND561 via SH624 RF remote; sending A1 ON: ; (*) ; 1110 01101001 0110100101 1110 01101001 0110100101 0000000>continued ; 0110 01100 0110 01100 > ; S A 1 S A 1 GAP > ; ; >1110 01101001 0101100110 1110 01101001 0101100110 ; > 0110 00101 0110 00101 ; >S A ON S A ON DONE ; ; ;Mini-Controller MC563 or Mini-Timer MT522; sending C1 ON: ; ; 1110 01011001 0110100101 1110 01011001 0110100101 000000> ; 0010 01100 0010 01100 >continued ; S C 1 S C 1 GAP > ; ; >1110 01011001 0101100110 1110 01011001 0101100110 ; >0 0 1 0 0 0 1 0 1 0010 00101 ; >S C ON S C ON DONE ; ORG 00H
120
Appendices ; Program starting point Start MOVLW B'00001110' TRIS PORT_A ; Set Port A as Inputs & Outputs MOVLW B'11111111' TRIS PORT_B ; Set Port B as Inputs TriacOff ; Set Load off CLRF FLAGS CLRF HOUSE CLRF UNIT CLRF RXHOUSE CLRF RXUNIT CLRF COUNT MOVLW B'00000111' ; RTCC Prescaler, divide by 256 OPTION ; gives 256uS per count MainLoop CALL Wait500mSec Wait1110A CLRWDT BTFSS LOAD TriacOff BTFSC LOAD TriacOn ; Continuously re-assert load status
BTFSS BUTTON ; Check if manual button pressed, GOTO Manual ; if so do manual routines CALL BTFSS GOTO CALL BTFSS GOTO CALL BTFSS GOTO CALL BTFSC GOTO ReadBit ; Wait for Start Sequence 1110 CARRY ;1 Wait1110A ReadBit CARRY ;1 Wait1110A ReadBit CARRY ;1 Wait1110A ReadBit CARRY ;0 Wait1110A
121
Appendices GetBit RXHOUSE ; Read first house address GetBit RXHOUSE GetBit RXHOUSE GetBit RXHOUSE GetBit RXHOUSE GetBit RXHOUSE GetBit RXHOUSE GetBit RXHOUSE GetBit RXUNIT GetBit RXUNIT GetBit RXUNIT GetBit RXUNIT GetBit RXUNIT GetBit RXUNIT GetBit RXUNIT GetBit RXUNIT MOVLW D'0024' MOVWF COUNT BitCount1 CALL ReadBit DECFSZ COUNT, F GOTO BitCount1 MOVLW D'0011' MOVWF COUNT Wait1110B DECFSZ COUNT, F GOTO W1110B GOTO MainLoop W1110B CLRWDT CALL ReadBit ; BTFSS CARRY GOTO Wait1110B CALL ReadBit BTFSS CARRY GOTO Wait1110B CALL ReadBit BTFSS CARRY GOTO Wait1110B CALL ReadBit BTFSC CARRY GOTO Wait1110B MOVLW D'0008' MOVWF COUNT ; wait a maximum of 10 zero-crossings ; for next start sequence ; Read first unit address
; Abort as problem with data sequence Re-synchronise with pre-function ; 1 start sequence ; 1 Can not just count bits as gap ; length varies with transmitter type ;1 ;0 ; ignore next 8 bits = ; house address again
122
Appendices BitCount2 CALL ReadBit DECFSZ COUNT, F GOTO BitCount2 GetBit RXFUNC GetBit RXFUNC GetBit RXFUNC GetBit RXFUNC GetBit RXFUNC GetBit RXFUNC GetBit RXFUNC GetBit RXFUNC ; Read command function
; ignore last two bits of function ; as always 1 0 == 1 ; and ignore rest of data (22 bits)
CALL ReadDIPSwitches MOVF HOUSE, W SUBWF RXHOUSE, W XORLW 0 BZ GoodHouse GOTO MainLoop GoodHouse MOVF UNIT, W ; Received House code matches DIP switch SUBWF RXUNIT, W XORLW 0 BZ GoodUnit GOTO MainLoop GoodUnit ; Received Unit code matches DIP switch MOVLW B'01011001' ; On function 0010 1 SUBWF RXFUNC, W XORLW 0 BZ PowerOn1 MOVLW B'01011010' ; Off function 0011 1 SUBWF RXFUNC, W XORLW 0 BZ PowerOff1 GOTO MainLoop PowerOn1 TriacOn BSF LOAD GOTO MainLoop PowerOff1 TriacOff BCF LOAD GOTO MainLoop
123
Appendices Manual CALL BTFSC GOTO BTFSS GOTO ; Manual operation, de-bounce switch Wait100mSec ; by reading again after a delay. BUTTON ; Re-check if manual button pressed. MainLoop LOAD PowerOn2
Poweroff2 CLRWDT TriacOff ; Manual switch load off BCF LOAD ; Clear 'load on' flag BTFSS BUTTON ; Wait here until button released GOTO Poweroff2 GOTO MainLoop PowerOn2 CLRWDT TriacOn ; Manual switch load on BSF LOAD ; Set 'load on' flag BTFSS BUTTON ; Wait here until button released GOTO PowerOn2 GOTO MainLoop ReadBit CALL ZeroCross ; Call & return after zero crossing CALL Wait250uSec ; Wait so sample into carrier burst BTFSS CARRIER ; Check for presence of 120kHz carrier GOTO GB1 BSF CARRY ; Carrier present so set carry flag RETLW 0 GB1 BCF CARRY ; Carrier absent so clear carry flag RETLW 0 ZeroCross BTFSC ZEROX ; Check present +ve/-ve status of 50Hz GOTO Z1 ; power then wait for it to change Z0 CLRWDT ; Is low BTFSS ZEROX ; Loop until goes high GOTO Z0 RETLW 0 Z1 CLRWDT ; Is high BTFSC ZEROX ; Loop until goes low GOTO Z1 RETLW 0
124
Appendices Wait100mSec MOVLW D'0006' MOVWF COUNT GOTO WaitLoop Wait500mSec MOVLW D'0030' MOVWF COUNT WaitLoop MOVLW D'0192' MOVWF RTCC Wait16 CLRWDT MOVF RTCC, W BNZ Wait16 DECFSZ COUNT, F GOTO WaitLoop RETLW 0 Wait250uSec CLRF RTCC W0 CLRWDT ; Measured at about 273uSecs MOVF RTCC, W BZ W0 RETLW 0 ReadDIPSwitches SWAPF PORT_B, W ; Read DIP switch high nibble = house address MOVWF HOUSE ; and complement for true-logic COMF HOUSE, W ; Save in HOUSE variable ANDLW H'000F' ; 0 -> 15 == A -> P CALL HouseTable ; Look up bit pattern MOVWF HOUSE MOVF PORT_B, W ; Read DIP switch low nibble = unit address ANDLW H'000F' ; Unscramble bits and complement for true-logic CALL UnitTable ; Look up bit pattern & save in UNIT variable MOVWF UNIT ; 0 -> 15 == 1 -> 16 RETLW 0
; 6 x 16.384msec = 98.304msec
; 30 x 16.384msec = 491.52msec
125
Appendices
HouseTable ADDWF PC, F ; RETLW B'01101001' RETLW B'10101001' RETLW B'01011001' RETLW B'10011001' RETLW B'01010110' RETLW B'10010110' RETLW B'01100110' RETLW B'10100110' RETLW B'01101010' RETLW B'10101010' RETLW B'01011010' RETLW B'10011010' RETLW B'01010101' RETLW B'10010101' RETLW B'01100101' RETLW B'10100101' UnitTable ADDWF PC, F ; RETLW B'10100101' RETLW B'10100110' RETLW B'10011010' RETLW B'10011001' RETLW B'10010101' RETLW B'10010110' RETLW B'10101010' RETLW B'10101001' RETLW B'01100101' RETLW B'01100110' RETLW B'01011010' RETLW B'01011001' RETLW B'01010101' RETLW B'01010110' RETLW B'01101010' RETLW B'01101001' ORG 1FFH GOTO Start END Unit Code Look-up table: ;0>0>F = 16 = 1100 0 Flips bits 0 with 3, ;1>8>7 = 8 = 1101 0 and 1 with 2 and ;2>4>B = 12 = 1011 0 then complements result. ;3>C>3 = 4 = 1010 0 Bits must be twisted ;4>2>D = 14 = 1000 0 to undo twisting ;5>A>5 = 6 = 1001 0 on PCB layout. ;6>6>9 = 10 = 1111 0 ;7>E>1 = 2 = 1110 0 ;8>1>E = 15 = 0100 0 ;9>9>6 = 7 = 0101 0 ;A>5>A = 11 = 0011 0 ;B>D>2 = 3 = 0010 0 ;C>3>C = 13 = 0000 0 ;D>B>4 = 5 = 0001 0 ;E>7>8 = 9 = 0111 0 ;F>F>0 = 1 = 0110 0 House Code Look-up table: ; A = 0110 ; B = 1110 ; C = 0010 ; D = 1010 ; E = 0001 ; F = 1001 ; G = 0101 ; H = 1101 ; I = 0111 ; J = 1111 ; K = 0011 ; L = 1011 ; M = 0000 ; N = 1000 ; O = 0100 ; P = 1100
; RESET vector
126
References
Access and Control your PC from anywhere in the world: http://www.access-remote-pc.com/ 2006 Axis 216FD Fixed Dome Network Camera: http://www.axis.com/ 2006 Broadband Investment in Ireland: http://www.forfas.ie/publications/ 1998 Broadband for business: Report published in the Irish Independent Thursday 27th April 2006 Broadband Telecommunications Benchmarking Study: http://www.forfas.ie/publications/ November 2004 Benchmarking Irelands Broadband performance: http://www.forfas.ie/publications/ December 2005 Broadband over Power Lines-BPL Primer: CQ Magazine, May 2004 Broadband in Rural and Remote Areas www.oecd.org 2004 Broadband Last-Mile Technology: The National Academies of Science, Engineering and Medicine, http://www7.nationalacademies.org 2006 Broadband over Power-line (BPL) Frequently Asked Questions: http://www.qrpis.org/~k3ng/bpl.html#4 2006 Broadband Over Power-lines http://computer.howstuffworks.com CM11A Interface Communication Protocol http://mywebpages.comcast.net/ncherry/common/protocol.html 2006 CGI with LabView http://www.jeffreytravis.com/books/Ch9.pdf 2006 DAQ Getting Started Guide: http://www.ni.com/pdf/manuals/373235g.pdf Event-Driven Computing Projects for Software Engineering Education Computer Engineering & Science Dept, University of Missouri-Columbia http://www.cs.missouri.edu/~skubic/Papers/skubicASEE2002.pdf Ergodic Chaotic Parameter Modulation http://ieeexplore.ieee.org/iel5/61/30033/01375079.pdf? January 2005 Home Automation : Lessons from an Adaptive Home, Michael C. Mozer University of Colorado http://www.iee.org/OnComms/PN/controlauto/ LogMeIn Home Page: https://secure.logmein.com/ 2006 Learn LabView 8 in 3 hours: http://zone.ni.com/ 2006
127
References LabView six hour course: http://www.csee.umbc.edu/ 2006 LabView graphical programming course: http://cnx.org/content/col10241/latest/ 2006 LabView Tutorial: http://www.ece.mtu.edu/labs/EElabs/EE3305 2006 LabView to control X10 devices, Message board forum, 2006 http://www.perceptiveautomation.com/phpBB2/viewtopic.php?p=4022 Mobile Computing, Virtual Network Computing: http://ieeexplore.ieee.org/iel3/ January-February 1998 Making WiMAX the platform of choice for broadband wireless access: http://www.wimaxforum.org/ 2006 Microcontroller interface with LabView: http://zone.ni.com/devzone/cda/epd/p/id/4554 2006 Manuals: ftp://ftp.x10.com/pub/manuals/ Neural Network House: An Overview : Dept of Computer Science, University of Colorado http://www.cs.colorado.edu/ 2006 Power-line communications Electrifying the broadband PC Magazine: April 2004: http://www.pcmag-mideast.com/reviews/ Power-Line Communication on Broadcast reception http://www.rac.ca/regulatory/BPL/BBC%20White%20Paper.pdf Sept 2003 Prototype home automation project using the Project54 system http://www.project54.unh.edu/Documents/TechnicalReports 2004 Project54 Home Automation Project, July 21st 2006 http://www.project54.unh.edu/Reference/Download.pm/2335/Document.PDF Remote Control of Heating, Ventilation and Air Conditioning system with LabView: http://www.ece.msstate.edu/academics/gradprog/thesis/ Dec 2003 Surveillance IP Cameras; Texas Instruments: http://focus.ti.com/docs/solution/folders/print/207.html 2006 Serial communication protocol discussion forum with link to CM11A Virtual Instrument:http://search.ni.com/nisearch/nisearchservlet?nistype=default&ddo wn=3&filter=+taxonomy:"Discussion+Forums"&q=x10+cm11A 2006 Search Engine for University Sites: www.searchedu.com 2006 Spread Spectrum A Tutorial http://www.sss-mag.com/ 2006
128
References Spread Spectrum: An Analogue SS Interface for Power-Line Data Communications in Home Networking; http://ieeexplore.ieee.org/iel5/61/30033/01375079.pdf? January 2005 Virtual Laboratory for Distance Science and Engineering Education, Carl Steidley and Rafic Bachnak, Department of Computing and Mathematical Sciences Texas A&M University-Corpus Christi http://ieeexplore.ieee.org/iel5/10436/33131/01560227.pdf 2005 Virtual Network Computing: http://en.wikipedia.org/wiki/VNC 2006 Virtual Network Computing: The Olivetti & Oracle Research Laboratory http://computer.org/internet/ January-February 1998 Videoconferencing over broadband networks, Luis Bellido - Universidad Politcnica de Madrid, Dpto. de Ingeniera de Sistemas Telemticos. Spain http://greco.dit.upm.es/~leverage/conf1/bellido.htm 2006 WiMax: The Real Impact http://www.gartner.com ID Number G00125543, February 2005 WiMAX Unwiring the Last Mile: http://www.siemens-mobile.de 2006 WiMax The Broadband Mobile future? http://www.iei.ie/sectorpapers/ 2004 Wi-Fi Offers Viable Broadband Access for Europe's Rural Communities http://www.gartner.com/ 2003 Wireless Home Automation Using .NET and X10: http://www.15seconds.com/issue/040413.htm X10 Thermostats: http://www.resconsys.com/products/stats/x10.htm 2006 X10 to control computers: http://www.eng.auburn.edu/~doug/x10.html 2006 X-10 Compatible Appliance Module: Philip C Plunkett, ABACUS ELECTRICS, London http://www.cix.co.uk/~pplunkett/x10.htm Document Revision-May1997, Source Code Revision 1.28-August 1996 XML Web Services mobile interaction solution for X-10 Power-Line Networking: http://dienst.isti.cnr.it/ Technical Report 2005 European Research Consortium for Information & Mathematics (ERCIM Reference Digital Library)
129
Bibliography
Useful Articles: Electronics Today International March 1996 Driving Triacs with PIC Micro-controller Bart Trepak Everyday and Practical Electronics February 1995 Transformerless Power Supplies Andy Flind Distance Learning Solutions Guide - National Instruments http://www.ni.com/academic/distance_learning.htm Glossary of Computer/Internet terms http://www.isat.ie/Glossary/glossary.htm LabView: Introduction to LabView: Brian Bowe Centre for Industrial and Engineering Optics, School of Physics, Dublin Institute of Technology, 1999 Brian Bowe Centre for Industrial and Engineering Optics, School of Physics, Dublin Institute of Technology, 1999 Remote Plant Monitoring using Wireless technology Irish Engineers Journal volume 57:10th December 2003 SGS-Thomson ST6210/ST6215/ST6220/ST6225 data book Application note: Micro-Controller and Triacs on the 110/240V Mains X-10 Powerhouse Technical Note: The X-10 powerhouse Power Line Interface Model # PL513 and TwoWay Power Line Interface #TW523, Revision 2.4 Dave Rye http://x10ideas.com/articles/displayx10article.asp?articleid=29 X10 Home Automation Knowledge Base http://www.geocities.com/idobartana/ X-10 Manuals and Guides www.x10.com
130
Bibliography Books: Building Broadband Networks by Marlyn Kemper Littman Ph.D Published by CRC Press LLC, Email orders@crcpress.com 2002 Broadband Networks, A Managers Guide By Robert P. Davidson, Published by John Wiley & Sons, Inc. 1996 Internet Applications in LabView: http://www.jeffreytravis.com/books/ialv.html 2006 Mobile Internet Enabling Technologies and Services By Apostolis K. Salkintzis, Published by CRC Press LLC 2004
131
132