Citation
A Remote Control Application Using XBee and TCP/IP

Material Information

Title:
A Remote Control Application Using XBee and TCP/IP
Creator:
Miller, Evan
Publication Date:
Language:
English

Subjects

Subjects / Keywords:
Databases ( jstor )
Graphical user interfaces ( jstor )
Internet ( jstor )
Remote control ( jstor )
Resistors ( jstor )
Search services ( jstor )
Software ( jstor )
SQL ( jstor )
Switches ( jstor )
Websites ( jstor )
Household appliances, Electric
Remote control
Genre:
Undergraduate Honors Thesis

Notes

Abstract:
It is very common for people to leave their house and mistakenly leave an appliance or light on. This is undesirable, and a waste of electricity. This paper presents a system that allows a user to remotely monitor the status of an electrical device plugged into a wall outlet, that is using a wall outlet module, and gives them the ability to power the device on or off. The hardware used in this system is based around the ATtiny2313 microcontroller, and uses XBee modules to provide wireless RF communication for local control. The power outlet modules communicate with a base module connected to a host computer, in range of them, with internet access. The software on the host computer maintains a website where the user can go to view real-time information about the on/off status of their devices. ( en )
General Note:
Awarded Bachelor of Science in Electrical Engineering; Graduated May 3, 2011 summa cum laude. Major: Electrical Engineering
General Note:
Advisor: Haniph Latchman
General Note:
College of Engineering

Record Information

Source Institution:
University of Florida
Holding Location:
University of Florida
Rights Management:
Copyright Evan Miller. Permission granted to the University of Florida to digitize, archive and distribute this item for non-profit research and educational purposes. Any reuse of this item in excess of fair use or other copyright exemptions requires permission of the copyright holder.

Downloads

This item is only available as the following downloads:


Full Text
xml version 1.0 encoding UTF-8
REPORT xmlns http:www.fcla.edudlsmddaitss xmlns:xsi http:www.w3.org2001XMLSchema-instance xsi:schemaLocation http:www.fcla.edudlsmddaitssdaitssReport.xsd
INGEST IEID E29O5EM56_PG82DG INGEST_TIME 2017-07-11T22:12:43Z PACKAGE AA00057229_00001
AGREEMENT_INFO ACCOUNT UF PROJECT UFDC
FILES



PAGE 1

A Remote Control Application Using XBee and TCP/IP Evan Miller Department of Electrical and Computer Engineering, University of Florida Abstract — It is very common for people to leave their house and mistakenly leave an appliance or light on This is undesirable, and a waste of electricity. This pape r presents a system that allows a user to remotely monitor the s tatus of an electrical device plugged into a wall outlet, that is using a wall outlet module, and gives them the ability to p ower the device on or off. The hardware used in this system is based around the ATtiny2313 microcontroller, and uses XBe e modules to provide wireless RF communication for lo cal control. The power outlet modules communicate with a base module connected to a host computer, in range of th em, with internet access. The software on the host computer maintains a website where the user can go to view real-time i nformation about the on/off status of their devices. This pap er describes a system in which a user can remotely monitor and con trol, via the internet, devices connected to a wall outlet. Index Terms — XBee, ZigBee, AVR, power outlet contr ol I. INTRODUCTION At some point almost everybody has left their home, or office, and later realized they had left a light or appliance on, wasting power. The ability to double-check these d evices and ensure they are turned off, without having to trave l back to their location, can be quite useful. Similarly, it is common to require a device to be turned on or off at a specif ic time of day, and not be able to do this physically. This system presents a solution to both of these problems. The solution d escribed in this paper allows an individual to remotely obtain real-time information about the on/off status of their electr onic devices, as well as provides them with the ability to alter this status. The system that has been described is composed of f ive main components. These components are as follows: Wall Outlet Module (WOM) Host Computer USB Module (USBM) Remote Control Module for Local Switching (RCM) Software GUI Located on the Host Computer Website Hosting with SQL Database Access The WOM is plugged into an existing wall outlet, an d has a female receptacle allowing a device to be plugged i nto it. Each WOM has a configurable address, which is broad cast over RF along with the on/off status of the device, as soon as it’s plugged in. The USBM is connected to a host c omputer, and receives the RF packets that are being broadcas ted from each WOM. After receiving these packets, the USBM transfers them to the host computer over a USB conn ection. The Software GUI running on the host computer inter prets the data, and periodically makes appropriate changes to a SQL database. A simple website has been constructed th at obtains information from the database, and displays it in a table. As long as the Software GUI is running on the host com puter, and is connected to the internet, whenever a user visit s the website they will see real-time information about the on/of f status of each WOM. In this system the RCM provides a user w ith the ability to wirelessly switch the devices on or off locally, while in physical range of them. Fig 1. 3 Wall outlets using WOM’s II. XBEE PROTOCOL The XBee modules used in this project implement the IEEE 802.15.4 protocol, which define their physical and MAC layers. These modules operate in the 2.4GHz freque ncy band, and have a data rate of up to 250kbps, with a range of up to

PAGE 2

100ft indoors [1]. Although they can achieve a dat a rate of 250kbps, in this application only a relatively smal l bandwidth is required, so a lower rate is used. To avoid int erfering with other XBee networks, a unique Personal Area Network (PAN) ID is assigned to each system. With over 65,000 al lowable unique PAN ID’s, it is realistic that a particular network being used will not interfere with another. To provide s ecure data transmission, XBee modules provide 128-bit AES encr yption. AES is a federal government standard that was appro ved in 2002, and deemed secure enough to protect sensitive unclassified information [2]. Security is a very i mportant aspect of this system, as it is critical to prevent unwanted interference with the operation of the electrical d evices being controlled. III. SYSTEM ARCHITECTURE A. Wall Outlet Module (WOM) Each WOM is designed around an ATtiny2313 microcontroller from Atmel. This specific MCU was chosen for the project based on its small size, low cost, and abundance of peripherals. The MCU communicates with a 1mW XB ee module through its Universal Synchronous and Asynch ronous Serial Receiver and Transmitter (USART). Driven by a timer interrupt, the MCU directs the XBee module to broad cast the WOM’s physical address, along with its on/off statu s, at a given interval. When the WOM receives an “on” or “ off” command, it switches a Solid State Relay (SSR) acco rdingly [3]. The SSR allows the device to connect, or disc onnect, the appliance from the wall outlet. To provide a dynam ic address to each WOM, a 4-pin DIP switch is included in the circuitry. 3-bits of the DIP switch allow each WOM to have a p hysical address of 0-7 that may be changed at any time. If it is desired by the user, multiple WOM’s may be assigned the sam e physical address, allowing them to be controlled as a group. The fourth bit of the DIP switch is reserved for fu ture expansion. To simplify the design, a small pre-bui lt circuit from a wall transformer is used to provide the circ uit with 5V DC. Fig 2. Wall Outlet Module circuitry B. Host Computer USB Module (USBM) The USBM consists of a 1mW XBee module and an FDTI chip that is used to establish a USB connection wit h the host computer. The XBee module awaits a packet containi ng an address of a module, and its corresponding on/off s tatus. Once a packet is received, data is transmitted to the ho st computer via USB, and interpreted by the GUI software. If t he GUI software on the host computer has determined that t he state of a WOM should be changed, either from website intera ction or the user making a change to the GUI or RCM locally, it sends an instruction via USB to the USBM, which is then broadcasted by the XBee module to the WOM. Fig 3. USB Module circuitry C. Remote Control Module (RCM) Although this system primarily focuses on remote mo nitoring and switching of the WOMs, it is necessary for a us er to be able to control their devices that are connected to each WOM locally as well. The RCM gives the user this abili ty. Similar to the WOMs, the RCM is built around an ATtiny2313 that is connected by USART to the XBee module. The RCM functions in a fashion that is common for most remo te controls. There is one button for each possible ad dress location 0-7, that when pressed, will toggle the cu rrent state of the device connected to the WOM. For convenience, an additional button has been located on the RCM that will send a command to each WOM address, instructing them to al l turn off [4].

PAGE 3

Fig 4. Remote Control Module circuitry D. Software GUI/Website In this system the Software GUI is what performs th e task of maintaining the SQL database, in which information about the WOMs is stored for the website to display. Created in VB.NET, the GUI receives information from the USBM through a COM port that is opened by the FDTI chip of the USBM. The GUI keeps track of which WOMs are active locally, as well as their on/off status, and period ically performs an update on the SQL server. The .NET framework ma kes updating the SQL database simple, through the use o f built in objects. With minimal effort, VB.NET is able to ex ecute basic stored procedures on the SQL server, allowing the modification and retrieval of data fields. As an a dditional feature, the GUI offers the capability of being abl e to toggle WOMs locally, similar to the function of the RCM [5 ]. Figure 6 shows the GUI software with 2 modules connected, one turned on, and the other turned off. The website, designed in ASP.NET, interacts with the SQL server in a similar manner. The website takes advantage of objects included wit hin the .NET framework as well, and retrieves data to displ ay to the user. When the user toggles an active WOM through the website, a request to change the status of the modu le is inserted into the database. The next time the GUI software updates the database it will download a list of sta tus requests, and execute them. Fig 5. Software GUI connection menu

PAGE 4

Fig 6. Software GUI connected, displaying 2 active modules IV. COST OF PROTOTYPE Tables 1-3 contain a bill of materials for each cir cuit in the prototype. The manufacturerÂ’s part numbers have be en listed for each item. Many items such as resistors, capac itors, and headers, are interchangeable with components that h ave equivalent ratings. A prototype with 1 WOM, 1 RCM, and 1 USBM will cost just under $90.00 USD, not including the cost of enclosures or circuit board design. Additional WOMs cost approximately $38.00 USD. These prices can be sign ificantly reduced through mass production. With quantities o f 100+ purchased at a time, cost is decreased by nearly 20 % [4-5]. Remote Control Module Qty Manufacturer Part # 1mW Xbee Module 1 XB24-AUI-001 ATtiny2313 1 ATTINY2313-20PU SIP Resistor 1kOhm 1 770101102P Resistor 10kOhm 1 ERD-S1TJ103V Push Button Switch 9 FSM4JH Header 2x3 1 20021111-00006T4LF Table 1. BOM for a RCM USB Module Qty Manufacturer Part # ATtiny2313 1 ATTINY2313-20PU FDTI Chip 1 FT232RL-REEL Mini USB Connector 1 DX1R005HN2E700 Capacitor .1uF 2 K104Z15Y5VF5TL2 Capacitor 10uF 1 ECA-1CM100B Table 2. BOM for a USBM Wall Outlet Module Qty Manufacturer Part # 1mW Xbee Module 1 XB24-AUI-001 ATtiny2313 1 ATTINY2313-20PU 3V Voltage Regulator 1 MCP1825-3002E/AT Transformer/Rectifier Circuit 1 N/A Solid State Relay 1 CX240D5 4Pos DIP Switch 1 206-4ST Resistor 10kOhm 1 ERD-S1TJ103V Resistor 1.8kOhm 2 ERD-S2TJ182V Resistor 3.3kOhm 1 ERD-S2TJ182V Capacitor .1uF 1 K104Z15Y5VF5TL2 Capacitor 10uF 1 ECA-1CM100B Header 2x3 1 20021111-00006T4LF Header 1x2 1 TMM-102-01-T-S Table 3. BOM for a WOM V. FUTURE IMPROVEMENTS The system described here has implemented XBee modu les to allow the WOMs to wirelessly communicate with th e USBM, which is connected to a host computer. In th is system, the host computer must have an active connection to the internet, and be running the Software GUI. The ada ptation of Broadband over Power Lines (BPL) technology would n ot only remove the RF XBee component, but would elimin ate the dependency of using a host computer, as well as the USBM [6]. With the appropriate circuitry, each WOM woul d have a direct link with the internet, through power lines, allowing them to maintain the SQL database more efficiently. This would undoubtedly lead to a more robust system, as each WOM would be able to perform its function as a stan dalone unit, rather than sending and receiving instruction s to and from another node. The RCM currently relies on an XBee module to send commands to each WOM. In the future this component can be replaced with an IR transmitter, in conjunction wit h IR receivers being incorporated into the WOM circuitry This modification will require the user to have a line-o f-sight proximity with the WOM they wish to switch on or of f. IR transmitter/receiver pairs are significantly less c ostly than XBee modules [7-8], and each component can be small er than an XBee module. This will allow the RCM to have a much smaller design, a longer battery life, and will lik ely not affect the dimensions of a WOM. An additional benefit of using IR technology is that a user can integrate the functio nality of controlling their WOMs into a universal remote cont rol that they already use. Furthermore, integrating IR tech nology into the system would also allow the ability to interfac e with, and remotely control other devices which already use IR as a means of control.

PAGE 5

The ability to assign a dynamic address to each WOM provides the system with the flexibility of being a ble to construct groups of modules that are controlled as a single unit. Currently the system only supports addresses in the range of 0-7, as the physical address is designated by th ree bits of the four bit DIP switch. In the future, sensor modules could be integrated into the system, using the fourth reserv ed bit of the jumper to indicate whether a module is a WOM or a s ensor module. Sensor data such as temperature, humidity, or motion, could be observed remotely and displayed in real-time on the website. In addition, a larger jumper switc h should be implemented, resulting in an exponential increase i n the number of independent addresses that can be used. VI. Conclusions A system of modules has been created to control, lo cally and remotely, devices that are plugged into wall ou tlets of a home or office. This system offers support for up to 8 separate groups of WOMs that can be switched independently. The .NET framework has facilitated the integration of a website into the system for remote monitoring. Users are n ow effectively able to turn on and off lights or appli ances, whether or not they are in the vicinity of the device, prov ided they have access to the internet. REFERENCES [1] Product Manual for Xbee / XBee Pro RF Modules v1.xE x 802.15.4 Protocol. [2] Federal Information Processing Standards Publicatio n 197, November 2001. [3] E. Miller. “Code for a Wall Outlet Module”. Interne t: http://www.remotemoduleproject.com/remotemoduleproj ect/Code_MC U/WOM.c. [Nov. 6, 2010]. [4] E. Miller. “Code for a Remote Control Module”. Inte rnet: http://www.remotemoduleproject.com/remotemoduleproj ect/Code_MC U/RCM.c. [Nov. 6, 2010]. [5] E. Miller. “Software Interface for a Remote Control Project”. Internet: http://www.remotemoduleproject.com/remotemoduleproj ect/Code_GUI/ SoftwareGUI.txt. [Nov. 6, 2010]. [6] New Millennium Research Council. (2005). “Powering the Broadband Market in 2005 and Beyond: Views on the Emergence o f Broadband Over Power Line Technology (BPL)”. Available: http://www.newmillenniumresearch.org/archive/bpl_re port022405.pdf [7] Digi-Key Corporation. Internet: http://www.digikey. com. [Nov. 5, 2010]. [8] Jameco Electronics. Internet: http://www.jameco.com [Nov 5, 2010].