Power Line Communication Based Automation System Using iPod

0 downloads 0 Views 1MB Size Report
System Using iPod Touch. Abstract—An automation system for controlling electrical appliances using Power Line Communication(PLC) is pre- sented here.
Power Line Communication Based Automation System Using iPod Touch Abstract—An automation system for controlling electrical appliances using Power Line Communication(PLC) is presented here.Ubiquitous Power Lines are used as physical media to transmit data over 220V/50Hz signal to control appliances/equipment.The user sends control messages from the iPod/iPhone over Wi-Fi to a micro-controller.The data from the microcontroller is coupled onto the Power Lines using a PLC (Power Line Communication) modem and DCSK (Differential Code Shift Keying) modulation technique is employed to transmit data which is broadcasted over the Power Lines. Each receiver unit consists of PLC modem plus microcontroller and can be connected anywhere in the Power Line network. The receivers have addresses assigned to them and only respond to the commands sent to them by the transmitter PLC modem. The receiver unit controls the flow of electricity to the socket. The entire system is devoid of a computer to save power and lower cost. Use of open source hardware, Power Line Communication and micro-controller collectively reduce the cost of controlling appliances remotely. Keywords : iPod, PLC, DCSK, Automation, Open Sound Control, Open Source.

I. I NTRODUCTION Automation essentially involves leveraging the power of technology to reduce the dependency on human presence and decision making for any process. It leverages different electronic equipment (either standalone or interlinked with appropriate applications) to control different parameters of any process.In these days of energy scarcity, it is prudent to save energy in every way possible. It is paramount to make the system as easy to use as possible so that people can use their appliances in a smarter way to save energy. Aim of this project is to simplify the process of human-machine interaction through the use of a generic interaction system and to make things around us smarter and interactive. We envisaged building an interaction system that would allow us to interact with the physical/analog world. Earlier systems were mainly based on the use of telephone line, such as a phone-based system using a hardware-based remote controller [1][2], and a personal computer [3] which are impractical in this age. The technologies used in current automation systems also have a number of limitations. Most of them require rewiring or connecting every appliance to a central unit, for example the systems which use Ethernet [4]. Also RF, Bluetooth based automation systems have limitations in being employed in areas which have concrete walls and surroundings [6][7]. Some of the other existing systems use archaic user interfaces which are neither natural nor intuitive. For example [5].The above factors lead to escalation in costs and deters users from using such systems. To overcome the

limitations posed by the above technologies, a solution based on already existing infrastructure (Power Lines) to reduce costs and use of a touchscreen interaction interface(iPod Touch) for intuitive experience is proposed. The purpose of the system is to provide convenience to the user and also to reduce power consumption and save energy. This system requires no modification to the appliances, and it works for all appliances using electricity since electricity to the socket is controlled and not the appliance directly. Also the hardware and software used to build the system are licensed under open source license, unlike Zwave, Creston which are proprietary in nature, thus lowering the cost of the system significantly. II. SYSTEM OVERVIEW A Wi-Fi enabled device is used as means of input. An iPod Touch is used for this purpose, which provides the user with a touch screen interface facilitating ease of use. A Wi-Fi network is first setup using a wireless router. The micro-controller connects to the wireless router through an Ethernet interface card. The Ethernet interface card and the micro-controller communicate over a Serial Peripheral Interface (SPI) bus. OSC (Open Sound Control) protocol is used to communicate between the iPod Touch and the micro-controller over a WiFi network. When a user presses a particular button, specific messages are sent over the Wi-Fi network to the microcontroller which decodes the messages. The micro-controller converts these messages into simple control signals. The micro-controller sends data to the PLC modem using UART protocol. The commands sent by the micro-controller to switch ON/OFF an appliance is not sent directly to the appliance, but rather these commands are broadcasted over the power lines using a Power Line Communication (PLC) transmitter. Each end appliance has a PLC receiver plus micro-controller combination to listen to these commands, if the commands are intended to the corresponding appliance; it switches ON/OFF the appliance else ignores the commands. III. POWER LINE COMMUNICATION (PLC) Power Line Communication is a technology which uses power lines as physical media for data transmission. PLC offers a no new wires solution because the infrastructure has already been established. PLC modems are used for transmitting data at a rapid speed through a power line in a house, an office, a building, and a factory, etc. Here, the existing alternating current (AC) power wires serve as a transmission

Figure 1.

System Block Diagram

medium by which information is relayed from a transmitter or control station to one or more receivers.

A. PLC Modem description with application subsystem Figure 3.

UART

IT800D - The IT800D is a system on chip solution optimally designed to provide the best performance over the Power Line medium. PLC capabilities are added to the modem by integrating the IT800D into the modem circuitry. The IT800D handles the channel access on behalf of the modem, in addition to handling the entire communication over the power line. The PLC modem can be configured with various communication parameters through a programmable interface [8]. Analog Front End and Line Coupler - It sits between the IT800D and the physical network, connecting the device to the physical network medium (the power line). The AFE includes reception and transmission paths, with the required filtering and amplification. The Line Coupler couples the data to the power line. Power Supply - The power supply is a separate block, providing the required power to the IT800D and AFE. Figure 2.

PLC Modem block diagram

Application Circuitry - It contains the relay circuit which provides the interface for connecting the appliance. Host - It is typically implemented using a general-purpose micro-controller; a Atmega 328 in this case. The Host controls the behavior of the appliance. It also implements a software serial interface that allows it to communicate with and control the IT800D over the UART Host Interface.

B. Modulation DCSK (Differential Code Shift Keying) modulation technique is known for its extreme robustness and belongs to the family of spread spectrum modulation technologies. Spread spectrum modulation is a technique in which a signal is transmitted on a bandwidth considerably larger than the frequency content of the original information [9]. Spread spectrum modulations provide many advantages: they are less susceptible to narrowband and burst noises, able to work when the signal level is lower than the noise level (negative SNR). They are

also less susceptible to multi-path fading, signals arriving via different routes, and impedance modulation. A communication medium such as the AC Power Line may be corrupted by fast fading, unpredictable amplitude and phase distortion and additive noise. In addition, communication channels may be subjected to unpredictable time varying jamming and narrowband interference. In order to transmit digital data over such channels it is preferable to use as wide a bandwidth as possible for transmission of the data. This is achieved using spread spectrum techniques; in particular a type of spread spectrum called “Differential Code Shift Keying” is used for the modulation technique [10]. DCSK modulates the symbol by cyclic shifting of the basic symbol in the transmitter, and detection of the shift in the receiver. The first picture in figure 3 shows the original none shifted symbol, which may also represent a ‘0000’ information. The second and third picture in figure 3 (below) demonstrate modulated symbols that are created from the original symbol by cyclic shift according to the data value.

Figure 4.

MIDI‘s 31.25kbps. We have used OSC protocol to send control commands to the micro controller over the Wi-Fi network [11]. A. Structure of OSC content The basic unit of Open Sound Control data is a message. This message contains a symbolic address and message name, and any amount of binary data. Entities within a system (network) are addressed individually by an open-ended URLstyle symbolic naming scheme that includes a powerful pattern matching language to specify multiple recipients of a single message. OSC streams are sequences of frames (also referred to as ‘bundles’) defined with respect to a point in time called a timetag. A bundle contains a number of messages, each of which represent the state of a sub-stream at the enclosing reference timetag. The sub-streams are labeled with a human-readable character string called an address. OSC bundle timestamps can be used to recover the correct order of the packets at the receiving end. The size of an OSC packet is always a multiple of 4.

DCSK Modulation

DCSK is spectrum modulation technology that enables extremely robust Power Line Communication. The features of DCSK which make it one of the best technologies for Power Line communication are as follows: Resistance to pulse noise, Resistance to linear and non-linear distortion, Adaptive operation handles fast variations in medium characteristics, Resistance to synchronization errors & timing jitters, Fast recovery from severe fade or jamming. Figure 5.

OSC Structure Format

IV. OPEN SOUND CONTROL Open Sound Control (OSC) is a protocol for real time communication between computers, sound synthesizers and other multimedia devices which are optimized for networking technology. It is touted as the next generation replacement for the MIDI format. It is a transport independent protocol which means that it is a format for data that can be carried across a variety of networking technologies like USB, Firewire and Ethernet. It offers bandwidth greater than 10mbps compared to

The comparison below is given to give a perspective of how the OSC message format is in comparison with message formats for MIDI and XML. OSC’s advantages include interoperability, accuracy, flexibility, and enhanced organization and documentation, efficiency, low cost and reliability of this new protocol make it a potential replacement for current technology. Comparison of message formats of OSC vs. MIDI vs. XML

OSC: /server/slider1/3 f 0.25 MIDI: 0x01 0x00 0x03 0x32 XML: 0.25 Figure 6.

Screenshot of iPod Touch interface

V. IMPLEMENTATION An iPod touch is used for sending control commands to the micro-controller over Wi-Fi using OSC protocol.OSC can be used to encode integers, real numbers and text. Using the OSC protocol over the device‘s built-in Wi-Fi connection, the OSC application communicates with other compatible hardware and software nodes over the network.Any client which supports the OSC format could be used. For example Mrmr, Touch OSC, OSCemote. The iOSC application on the iPod allows us to send customized messages in the OSC format over Wi-Fi. The interface consists of three buttons (to send high and low values) and a slider for pulse width modulation.The sliders can be used for varying brightness of light bulbs or for controlling the speed of fans. This application will convert the button presses into predetermined OSC messages and will append specific IP and port addresses to the message. A router is used in the setup to host a local wireless network. The Ethernet interface card connected to the microcontroller is initialized to a specific IP address so that it is in the same network as the iPod. The IP address and port addresses are set to be the same in both Ethernet interface card and in the iOSC application. byte serverMac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; byte serverIp[] = { 192, 168, 1, 104 }; int serverPort = 10000; Ethernet.begin(serverMac ,serverIp); The MAC, IP and Port address values are defined and the Ethernet interface card is initialized using the Ethernet.begin() function. Table I PARTS SETTING OSC Message button1 button2 button3 slider1

/server/yelled /server/grnled /server/redled /server/pwmled

Data type int int int int

On

Off

1 1 1 max:255

0 0 0 min:0

Figure 6 Screenshot of iPod interface consisting of 3 buttons and a slider for controlling appliances. The program residing on the microcontroller is designed to decode the encoded OSC messages from the iPod. if( osc.available() ) { if(!strcmp( recMes.getAddress(0) ,topAddress ) )

{ if(!strcmp( recMes.getAddress(1) ,subAddress[0] ) ) { if(recMes.getArgInt(0) == 1) { digitalWrite(RED_LED, HIGH);}}}} In this code snippet, the osc.available() function is used to check for availability of OSC messages, and the topaddress and subaddress of the OSC message is compared. If both the address match and the integer value is checked to determine whether to switch ON/OFF the appliance. The code on the micro controller is 6.2kB in size. The micro-controller converts the decoded OSC messages into control signals to turn ON/OFF specified appliance. The microcontroller and the PLC modem communicate over UART. We have used Renesas M16C/6S which incorporates the IT800 PLC technology developed by YITRAN Communications Ltd.

Figure 7.

Actual picture Renesas PLC modem used in our setup

The micro-controller sends the commands serially to the master PLC modem. Serial.println("0"); delay(500); Serial.println("0"); The micro-controller sends data to the PLC modem over UART interface using the Serial.println() function. The data is sent twice to the PLC modem by retransmitting the same data with a delay of 500 milisecond. The PLC transmitter broadcasts the control signals through the Power Lines. At the receiving end, each appliance connected to PLC modem. This PLC modem listens over the Power Lines for any control signals. If a PLC control signal is available, the modem sends it to the receiving micro-controller. The micro-controller checks if the command was intended for this appliance, if

not simply ignores it. If the command was for that particular appliance, the micro-controller switches ON or OFF the relay connecting the appliance. while (Serial.available() > 0) { cmd = Serial.read(); switch (cmd) { case ’0’: { digitalWrite(RELAY_PIN, HIGH); digitalWrite(PIN, HIGH); break; }}} Here is a code snippet of the receiving micro-controller, where first the availability of serial data is checked and then read into a register. The received data is compared with the standard address of the unit and correspondingly the relay unit is switched ON/OFF.

Figure 8.

Figure 9.

Transmitter Schematic

Receiver Schematic

Figure 10.

Setup

Advantages • Use of computer is avoided resulting in significant reduction in energy consumption. A computer on an average consumes about 300 watts of energy, keeping it switched ON would consume more energy than the energy saved by turning OFF appliances remotely. • The use of a touch screen interface makes the system intuitive and easy to use. • In most of the existing systems every appliance has to be connected to a central unit which results in a myriad of hassles especially if the system has to be retrofitted. Power lines eliminate these hassles as they are ubiquitous. • The system is modular is in nature. Each of the receiver units can be added by just plugging them to the electric socket as when required. The controller’s software could be reconfigured when the need for additional input arises. • The use of micro-controller, ethernet interface card and PLC modem make the entire system compact to be fitted behind a switch board. • Since the system is modular in nature and uses ubiquitous power lines, the installation could be performed by the end user himself instead of a professional-this further cuts cost. • Open source hardware- This is what makes the system truly unique, the hardware and software used in this system, their circuit diagrams, schematics are all available on the internet so that anybody can build, modify and customise to his/her requirement. VI. A PPLICATIONS The generic system could be adapted for the following applications. • Remote Data Acquisition The system along with relevant sensors could be used to monitor various parameters like moisture content, humidity, nutrient content(Soil monitoring) and temperature, pressure etc (Weather station) and this information could be transmitted through Power Lines.

Home/ Industrial automation Enables users to control appliances remotely and wirelessly leading to energy saving while offering convenience. Various tasks and repetitive processes could be controlled remotely, enabling better utilisation of manpower and thus increasing productivity and efficiency in Industries. • Automatic meter reading systems The information from the consumer is transmitted to the supply company over the Power Lines. The billing system can be automated and bills generated at the premises of the supply company which will save money, manpower, fuel and energy. • Real time monitoring of energy consumption Every socket could be monitored for energy consumption, and the data could be transmitted over the power lines to a central unit or the data could be uploaded onto the web for visualization and analysis. Data could be accessed using multiple devices,providing the user wuth the energy consumption information of each appliance. • Building management solutions. The system can be used as a building management solution if all the applications listed above could be combined instead of having separate systems for each function. • Automated switching of streetlights over power line The powerline communication system coupled with any of the inputs can be used to automatically switch On/Off street lights, resulting in energy savings. •

VII. R ESULTS AND CONCLUSION Future Advancements/ Enhancements • The transmitter unit can be made portable and compact by incorporating a battery pack, Wi-Fi interface card instead of Ethernet to the existing set-up. • A java based interface could be implemented to enter the receiver address to increase the number of receiver units thereby controlling more number appliances. • One can use advanced communication interface (GPRS, EGPRS, UMTS) for extended range of control. • The entire setup could be miniaturized using SMD components and multiple layer PCBs. The resulting size will be small enough to be fixed inside a switch board. • High speed Power Line modems could be used for last mile broadband connectivity. • Implementation of PLC-Zigbee Hybrid combination could further enhance the functionality of the system. The system was tested using a Power Line transmitter and two receivers connected to appliances kept at different locations but within the same electric network. The appliances were controlled by sending specific commands to trigger the relays which were the switch link in the circuit. The signals do not get transmitted through the MCB so the signals sent from one house don’t interfere with that of the neighbor’s. Some of the challenges faced during the course of implementation of the system.

Porting the decoding program of OSC messages onto the microcontroller. • Reliability of Power Line communication system • To improve the reliability of data reaching the end receiver redundancy was introduced by sending the data twice from the Power Line transmitter. • The noise on the Power Line and interference if beyond a threshold could corrupt the data being transmitted on the Power Line. The system was extensively tested for various conditions/cases such as AC power, UPS and no power and practical conditions were simulated artificially; for example resetting automatically from no power state. •

R EFERENCES [1] E. M. C. Wong, “A phone-based remote controller for home and office automation,” IEEE Trans. Consumer Electron., vol. 40, no. 1, pp. 28-34, Feb.1994. [2] I. Coskun and H. Ardam, “A remote controller for home and office appliances by telephone,” IEEE Trans. Consumer Electron., vol. 44, no. 4, pp.1291-1297.Nov. 1998. [3] B. Koyuncu, “PC remote control of appliances by using telephone lines,” IEEE Trans. Consumer Electron., vol. 41, no. 1, pp. 201-209, Feb. 1995. [4] Intark Han, Hong-Shik Park, Youn-Kwae Jeong, and Kwang-Roh Park” An Integrated Home Server for Communication, Broadcast Reception, and Home Automation” IEEE Transactions on Consumer Electronics, Vol. 52, No. 1, February 2006 [5] Andreas Rosendahl, J. Felix Hampe and Goetz Botterweck, “Mobile Home Automation-Merging Mobile Value Added Services and Home Automation Technologies”, Sixth International Conference on the Management of Mobile Business (ICMB 2007) 0-760695-2803-1/07 [6] Sriskanthan N.; Tam, F.; Karande, A. “Bluetooth based home automation system”, Microprocessors and Microsystems 26, 2002, pp 281-289. [7] Poole, I. “What exactly is Zigbee?”, Communications Engineer, Volume 2. Issue 4, August-September 2004, pp 44-45. [8] Yitran IT800D Power Line Communication Modem Data Sheet [9] M. H. Shwehdi ,A. Z. Khan,Member “A Power Line Data Communication Interface Using Spread Spectrum Technology in Home Automation”, IEEE Transactions on Power Delivery, Vol. 11, No. 3, July 1996 [10] Dan Raphaeli, Spread Spectrum Communication System Utilizing Differential Code shift keying, Itran Communications, Israel [11] Andrew Schmeder and Adrian Freed and David Wessel, Features and Future of Open Sound Control version 1.1 for NIME, Center for New Music and Audio Technologies (CNMAT), UC Berkeley

Suggest Documents