Smart Home Systems
Total Page:16
File Type:pdf, Size:1020Kb
University of Central Florida Smart Home Systems Senior Design 1 Group 10 Vu Ha Joel LeGros Thien Luu Daniel Moody Summer Semester 2012 August 3rd, 2012 i Table of Contents 1 - Executive Summary…………………………………………………………. 1 2 - Project description…………………………………………………………… 2 2.1 - Motivation…………………………………………………………… 2 2.1.1 - General Motivations……………………………………... 2 2.1.2 - Energy Efficiency………………………………………… 4 2.1.3 - Future Implementation………………………………….. 5 2.2 - Requirements and Specs………………………………………… 7 2.3 - Objectives…………………………………………………………... 9 3 – Research……………………………………………………………………... 10 3.1 - Phone Applications………………………………………………… 10 3.1.1 - Android Application……………………………………… 10 3.1.2 - IPhone Application………………………………………. 11 3.2 - Computer application……………………………………………… 12 3.2.1 - Java Based………………………………………………. 13 3.2.2 - Visual Basic Based……………………………………… 13 3.2.3 - Web Server………………………………………………. 14 3.3 - Voice command……………………………………………………. 15 3.3.1 - CMU Sphinx……………………………………………… 15 3.3.2 - Dragon Mobile…………………………………………… 16 3.4 - Video system……………………………………………………… 17 3.4.1 - OpenCV………………………………………………….. 18 3.4.2 – Cameras…………………………………………………. 19 3.4.2.1 - Logitech Quickcam Pro 9000………………... 19 3.4.2.2 - Logitech HD Webcam C525…………………. 19 3.4.2.3 - Logitech Alert 750n…………………………… 19 3.5 - Embedded Internet Server……………………………………….. 22 3.5.1 - Atmega644a…………………………………………….. 22 3.5.2 - The Spinneret……………………………………………. 22 3.6 - PJSIP……………………………………………………………….. 23 3.6.1 - SIP………………………………………………………... 23 3.6.2 - RTP……………………………………………………….. 26 3.6.3 - SDP………………………………………………………. 29 3.6.4 - VoIP………………………………………………………. 29 3.6.5 - SMS………………………………………………………. 30 3.6.6 - NAT Addressing…………………………………………. 31 3.7 - Lighting……………………………………………………………… 31 3.8 - Motion sensing…………………………………………………….. 33 3.8.1 - Basic types of 'motion' sensors………………………... 33 3.8.2 - How PIR Operation works……………………………… 34 3.8.3 - Ultrasonic Sensor Technology…………………………. 35 3.8.4 - Sensors Choosing………………………………………. 36 3.8.5 – Connecting………………………………………………. 37 3.9 - Digital to Analog Converters……………………………………… 38 ii 3.10 – Codecs………………………………………………………........ 38 3.10.1 - Audio……………………………………………………. 38 3.10.2 - Video……………………………………………………. 38 3.11 - Main Circuit Board……………………………………………….. 40 3.11.1 - Microprocessor Considerations………………………. 40 3.11.2 - Printed Circuit Board…………………………………... 42 3.12 - Microcontrollers…………………………………………………… 43 3.13 - Home Security……………………………………………………. 45 3.13.1 - Integrating into home automation…………………….. 46 3.13.2 - The parts for home security…………………………… 48 3.13.2.1 - Wired sensors………………………………… 48 3.13.2.2 - Wireless sensors…………………………….. 50 3.13.2.3 - Passive Infrared Receiver (PIR)………….... 53 3.13.3 - RFID……………………………………………………... 55 3.13.3.1 - Security Concern…………………………….. 57 3.13.3.2 - Alternatives ………………………………….. 57 3.13.3.3 - Trade-offs ……………………………………. 58 3.13.3.4 - RFID access vs. Key access……………….. 58 3.14 - Communication Standards………………………………………. 58 3.14.1 - ZigBee…………………………………………………… 59 3.14.2 - Z-Wave………………………………………………….. 60 3.14.3 - X10………………………………………………………. 61 3.14.4 - INSTEON………………………………………………... 61 3.14.5 - Bluetooth………………………………………………… 62 3.14.6 - WiFi……………………………………………………… 62 3.14.7 - Communication summary……………………………... 66 3.15 - Air Sensors……………………………………………………….. 67 3.16 - Flood Sensors…………………………………………………….. 72 3.17 - AC thermostat…………………………………………………….. 72 3.18 - Back-up Power…………………………………………………… 75 3.18.1 - Backup Power Supply: Solar Power ………………… 83 3.19 - P2P………………………………………………………………… 83 4 - Design Summary……………………………………………………………... 84 4.1 - Software…………………………………………………………….. 84 4.1.1 - Class Diagrams………………………………………….. 87 4.1.2 - Flow Diagrams…………………………………………… 88 4.1.3 - Audio Software…………………………………………… 92 4.1.4 - Audio Flow Diagrams……………………………………. 94 4.2 – Hardware…………………………………………………………… 96 4.2.1 - Architectures……………………………………………… 96 4.2.2 - RFID………………………………………………………. 98 4.2.3 - Power Supply…………………………………………….. 100 4.2.4 - Main MCU and Processor………………………………..100 4.2.5 - JTAG connections……………………………………….. 108 4.3 - Parts List……………………………………………………………. 109 iii 5 - Prototype Construction/Testing…………………………………………….. 110 5.1 - Parts Acquisition…………………………………………………… 110 5.2 - Hardware Implementation………………………………………… 110 5.3 - Software Implementation…………………………………………. 111 5.4 - Physical Prototype Build…………………………………………... 111 6 – Testing………………………………………………………………………… 113 6.1 - Sensors and Microcontroller Testing…………………………….. 113 6.2 - System Tests………………………………………………………...115 6.3 - Hardware Tests……………………………………………………...116 6.4 - Software Tests……………………………………………………… 117 7 - Project Actualization and Implementation…………………………………118 7.1 - Android Layout………………………………………………………120 7.2 - Spinneret Web Server………………………………………………121 7.3 - Xbee Control…………………………………………………...........123 7.4 – PCB Design…………………………………………………………125 8 – Project Management ………………………………………………………...126 8.1 – Budget and Financing…………………….……………………….126 8.2 – Milestone chart……………...………………………………………128 8.3 – Work Distribution……………………………………………….......128 9 – Final Summary 9.1 – Conclusion……………………………………………………….....129 9.2 – Final Summary……………………………………………………...129 10 – Appendix Appendix A - Schematics Appendix B - Permissions Appendix C - Tables, Figures Index and Sources 1 1 - Executive Summary This project is the culmination of the UCF engineering experience. One of the major goals in this project was to apply the education that’s been received here at UCF to the project. The group spans both Electrical and Computer Engineering areas of study here at UCF, so the goal was to employ areas of both of those disciplines into the project. This project has given us the opportunity to design schematics, work on printed circuit boards, use microcontrollers, wireless communication, and all the while integrating it with an original piece of software. Our approach for the home automation is based around comfort and intuitive customization for the end user. This project’s main way of doing that is by integration of the smart phone for ease and familiarity to interface the whole design. We chose this because these days, the majority of the people in the world own a smart phone. This makes the product not only very marketable, but also very convenient. Even in your own home, you are likely to have your phone with you at all times. Even if not directly on your person, it’s probably not very far. Maybe even in the next room. Our goal is to make the phone into the tv remote of your home. Another motivation is to help with environmental impact and energy efficiency potential for the smart home. Wasted energy can be prevented through a smart home system with the automation of lighting, and power. By using low powered embedded devices in the project, this helps keep energy consumption down for the house. Texas Instruments is the main contributor to that for our main microcontroller and processor. We chose a Texas instruments microcontroller with an ARM 9 processor to give us the power we needed, but also while remaining efficient on power consumption. One of the main motivations for the project was to send audio throughout the house wirelessly. This was a difficult feat, so we knew we needed help to figure this out. We found the help in a company in Orlando called Alcorn McBride. The company has years of experience and were a big help in guiding our beginning stages to figuring out how to do this. The first step to doing wireless audio was to find a protocol stack. Through a little bit of digging we found a free open-source multimedia communication library called PJSIP. This library employed two important protocols for our project. The two protocols, RTP and SIP, allow the audio to be transmitted wirelessly from the phone to our Texas Instruments microcontroller. This requires that the user’s phone and the microcontroller be connected to the Internet. The phone will gain access to a server to control functions of the microcontroller. This will allow the user to gain access to functions when not in the home as well. The ability of this communication will allow the user to be specific to what room in the house they are sending audio to as well as the house as a whole. Volume control and room selection will be directly controlled from an app via your mobile device and the central micro controller. An intercom will also be featured in this project. Using the intercom starts with the integration of your mobile device over wifi. The mobile device will use the PJSIP protocol stack to help the phone and embedded device talk over wifi. Sensors will detect what room you are in of the house so that the nearest speakers will dim in volume to avoid feedback looping into the microphone of 2 your mobile device. Video will also be used to have surveillance of the front entrance to the house. Integrating the audio with this allows the user to communicate to that guest if they are unable to come to the door. Lights will also be controlled from the phone in the central app of the project. The ability to turn them on and off to any specific room will be available. There will also be an “all off” feature as well. This will be helpful for turning all lights off in the house when leaving for vacation or if no one will be home. The presentation for the project will be demonstrated through a scaled down version of the house. There will be two rooms. One will be acting as the living room, and one will be acting as the front door. We will also record a video presentation for later viewing upon the groups senior design website. This will go into detail on how the scalability of