Title: Accessing Remote Devices Using WebMobile ARDUMI
1Accessing Remote Devices Using
Web/Mobile(ARDUM-I)
- Shailendra Bhavsar
- Department of Computer ScienceOld Dominion
University
2Overview
- Introduction
- Project Scope
- Requirements
- Technology Overview
- X-10 Protocol
- Implementation
- Advantages
- Conclusion
- Demonstration
3Introduction
- ARDUM I
-
- ARDUM I is a home automation project that
allows you to control and monitor appliances in a
home network, via a Web Portal.
4Project Scope
- The aim of ARDUM I is to develop a secure
- Web Portal that will allow users to control
- and monitor a home lighting system.
- ARDUM I consists of two main components viz -
- Administrator Console(Admin Console)
- User Console
5 Console Specification
- Admin Console
- Ability to setup new users
- Ability to add/edit/delete users
- User Console
- Ability to remotely control devices
- Ability to add/edit/delete devices
- Ability to remotely monitor devices
- Generate an event log
6Technology Research
7 What is X10
- A communication protocol for remote control of
electrical devices - Designed for communication between X10
transmitter and X10 receiver over the standard
household wiring - Transmitter sends a X10 command such as
ON/OFF/DIM preceded by the receiving unit code - Each receiver is set to a unit code and reacts to
the command addressed to it
8 X10 Transmission
110 V
Voltage signal
16.66ms
1 ms X-10 information window
60 Hz
Zero Crossing Points
9X10 Transmission Contd.
3 zero crossing points for 3 phases of AC
poweline
- Binary 1
- 1 ms burst of 120 kHz at zero crossing point
- Binary 0
- Absence of burst at zero crossing point
10X10 Advantages
- Inexpensive(Lamp module kit/Controller for 50)
- Universally available
- Flexible(Supports a large variety of devices)
- Easy to install
- No additional wiring
- Control up to 256 lights and appliances
11X10 Hardware Required
- Transceiver Module Model TM751
- Lamp Module Remote Control
12X10 Hardware Setup
Transceiver Module
- The letters are called House codes
- The numbers are called Unit codes
- The letters are from A-P, Numbers are from 1-16
- Each Module can have a unique code (house code
unit code) from 256 (16 16) possible codes - Any number of units can have the same code
House Code Dial
Lamp Module
Unit Code Dial
House Code Dial
13X10 Hardware Setup Contd.
- Plug appliance into X10 lamp module
- Plug the module into an electrical outlet
- Set the house code on the lamp module.
- Set the unit code on the lamp module.
- Plug the transceiver into any other electrical
outlet - Set the proper house code on the transceiver
14How X10 Works
- The X10 signal is sent through the Web interface
via the com port, through Firecracker Model CM17A - The CM17A communicates with the computer at 4800
baud - CM17A sends a signal to X10 transceiver (TM751)
- TM751 sends a signal to Lamp Module (LM465)
- LM465 receives the X10 signal and turns the light
on/off/Dim
15Process Flow
1.Web Server 2.Database
Lamp Module
CM17A
X10 Signal
X10 Signal
Transceiver
X10 Signal
Lamp
Web Portal
16X10 Commands
Setup
- Connect a lamp to Lamp Module
- Set Transceiver at House Code A
- Set Lamp module at House Code A and Unit Code
1 - A1 ON - Turns the lamp on
- A1 OFF - Turns the lamp off
- A1 DIM25 - Turns the lamp on, but at 25 of
the normal power
Commands
17COM Port Communication
- RTS Request to Send DTR Data Terminal Ready
- At least RTS or DTR must be High at all times to
ensure power supply to Fire Cracker - Transmission Format
(Each time interval is 0.5ms)
RTS and DTR states to send Logical 1 and
Logical 0 to interface
18COM Port communication contd.
- Each transmission consists of 40 bits
- 16 bits Header - 16 bits Data - 8 bits Footer
- Header - in Hex D5 AA
- First Byte 11010101, Second Byte10101010
- Footer - in Hex AD
- Byte 10101101
- Data (Data Byte 1) (Data Byte 2)
- A1 ON in Hex 6000 01100000 00000000
- A1 OFF in Hex 6020 01100000 00100000
19COM Port communication contd.
Data Byte 1 Data Byte 2 X1
X2 X3 X4 X5 X6 X7 X 8 X1
X2 X3 X4 X5 X6 X7 X8
- 1 one for house codes E-L
- 2 one for house code A-D I-L
- 3 one for house codes A,B,G,H,I,J,O,P
- 4 one for house codes B,D,F,H,J,L,N,P
- 5 Always 0
- 6 one for units 9-16
- 7 Always 0
- 8 Always 0
- 1 one for BRIGHT or DIM
- 2 one for unit codes 5-8 13-16
- 3 one for OFF ( zero for ON or Bright/DIM)
- 4 one for unit codes 2,4,6,8,10,12,14,16 DIM
Command - 5 one for unit codes 3,4,7,8,11,12,15,16
Bright DIM commands - 6 Always 0
- 7 Always 0
- 8 Always 0
20COM Port communication contd.
21Implementation
- The implementation will consists of the following
steps - Database Design
- Admin Console
- User Console
- Hardware and Software Integration
22Implementation DB Design
Register-
Device-
EventLog
- ID
- User_Name
- Password
- First_Name
- Last_Name
- Email_Address
- CreationDate
- UserName
- DeviceName
- DeviceDescription
- Status
- Date
- Host
- ID
- UserName
- Name (Device)
- Description (Device)
- House
- Unit
- Status
HouseCode
23Implementation Code Snippet
dbconfig.asp
- lt
- dbPath "C/Inetpub/wwwroot/msproject/ardum/DB/AR
DUM.mdb" - set Conn server.createobject("adodb.connection")
- Conn.Open "PROVIDERMICROSOFT.JET.OLEDB.4.0DATA
SOURCE" dbPath - gt
24Admin Sequence Diagram
Submit.asp
Login.asp
(Invalid user)
(valid user)
AdminMenu.asp
AllUsers.asp
AdminChgPwd.asp
AddUser.asp
InsertUser.asp
EditUser.asp
DeleteUser.asp
WelcomeAdmin.asp
Logout.asp
UpdateUser.asp
25User Sequence Diagram
Submit.asp
Login.asp
(Invalid User)
(Valid User)
UserMenu.asp
AddDevice.asp
UserChgPwd.asp
Status.asp
EventLog.asp
InsertDevice.asp
EditDevice.asp
DeleteDevice.asp
ClearLog.asp
WelcomeUser.asp
Logout.asp
ChgStatus.asp
UpdateDevice.asp
26Implementation-Port Communication
- Define required Properties and Methods
- Create a compiled VC object (dll)
- Register the dll with a computer running the Web
Server (IIS) - regsvr32 i C\ARDUM.dll,
- regsvr32 u C\ARDUM.dll
27Ardum.dll - Definition
- VC Project ARDUM Interface Iproject
- Interface Properties Interface Methods
- (Put) Port(BSTR) TurnOn()
- (Put) HouseCode(int) TurnOff()
- (Put) UnitCode(int)
- ATL Class -Project (Methods)
- SetComm() SetDTR()
- SetRTS() SendByte()
- Close() SendByte()
28Ardum.dll - Code Snippet
- STDMETHODIMP projectput_UnitCode(int newVal)
- vUnitCode newVal
- return S_OK
-
- void projectSendByte(BYTE vdata)
- for (BYTE bBit 0x80bBit gt 0bBit gtgt 1)
- if (vdata bBit)
- SetDTR(false)
- else
- SetRTS(false)
- Sleep(1)
- SetDTR(true)
- SetRTS(true)
- Sleep(1)
-
29Ardum.dll - Code Snippet
- STDMETHODIMP projectTurnOn()
-
- vRequest ON
- BYTE hc
- // Change the house code to lowercase
- // Change it to use as an index into the
housecodes array - hc houseCodes(BYTE(vHouseCode) 0x20) -
'a' - vUnitCode--
- if (vUnitCode gt 7)
- hc 0x4
- vUnitCode- 8
-
- SetDTR(false) // Reset
- SetRTS(false)
- Sleep(30)
-
30Ardum.dll - Code Snippet
- STDMETHODIMP projectTurnOn() Contd.
-
- SetDTR(true) // Put FireCracker into ready
mode - SetRTS(true)
- Sleep(30)
- SendByte(0xD5) // Send first byte of header
11010101 - SendByte(0xAA) // and then the second byte
10101010 - SendByte(hc) // Send the house code
- SendByte(unitCodesvUnitCode) // Send the
unit code - SendByte(0xAD) // Send the Footer 10101101
- Sleep(30)
- return S_OK
-
31Implementation-Ardum.dll
- set objX10server.CreateObject("ARDUM.project")
- objX10.Port "COM1
- objX10.HouseCode HouseCode
- objX10.UnitCode Unit
- objX10.TurnOn
2. set objX10server.CreateObject("ARDUM.project"
) objX10.Port "COM1 objX10.HouseCode
HouseCode objX10.UnitCode Unit objX10.TurnOff
32Implementation-Web Portal
33Implementation-Web Portal
34Technical Challenges
- Setting up home controller
- Serial port communication
- Controller and X10 Integration
35ARDUM I Benefits
- Convenience
- Safety
- Lighting control
- Energy savings
- Fun
36Conclusion
- ARDUM-I Demonstrates that the internet is no
longer just an information super-highway, but can
also be used as a medium to access remote devices - ARDUM-I is secure and easy to use
- ARDUM-I can further be extended by adding
mobility. It can also be used for motion
detection, security systems etc. - ARDUM-I has potential for commercial development
37References
- http//www.x10.com
- http//www.smarthome.com
- http//www.controlhome.net
- http//www.microsoft.com
- http//www.homeseer.com
- Introduction to X10 Home Automation
Technology(OReilly)
38Acknowledgements
- Ajay Gupta
- Project Guide,
- Old Dominion University
- Irwin Levinstein
- Assistant Professor,
- Old Dominion University
39Demonstration
- A live demonstration of the system via the
Internet.
40Questions