Home Automation System
Total Page:16
File Type:pdf, Size:1020Kb
Home Automation System Clayton Brutus, Computer Engineering Project Advisor and Sponsor: Mr. Mark Randall April 26, 2018 Evansville, Indiana Table of Contents I. Introduction II. Background III. Client Requirements IV. Project Design A. Initial Design Choices B. Constraints and Considerations i. Safety Considerations ii. Mechanical Constraints iii. Manufacturability C. Hardware i. Relay Control ii. Light Dimming iii. Power Monitoring iv. Thermostat D. Software i. Server ii. Touchscreen Interface iii. Amazon Skill Lambda Function V. Results VI. Conclusion VII. References VIII. Appendices A. Schematic Print B. Light Switch Bill of Materials C. Server Code D. Touchscreen GUI Code E. Amazon Skill Lambda Script List of Figures Figure 1: Digi XBee Pro S2C Development Module Figure 2: Raspberry Pi Model 3 B Figure 3: Amazon Echo Dot 2nd Edition Figure 4: Lightswitch PCB Assembly Figure 5: Hub Assembly Figure 6: Relay Toggling Circuit Figure 7: Light Dimming Circuit Figure 8: Digital Potentiometer and PWM Generator Circuit Figure 9: Diode AND Gate with Schmitt Trigger Inverter Figure 10: Current Transformer Figure 11: Power Usage Measuring Circuit Figure 12: 3D PCB Renderings (Front, Back) Figure 13: Server Request Processing Flowchart Figure 14: Touchscreen Interface List of Tables Table 1: Existing Home Automation System Table 2: Available Voice Commands I. Introduction Home automation systems are a relatively new concept which aim to make houses more intelligent and automated in order to make life easier and safer for a house’s occupants. Existing systems usually are capable of controlling the lighting, appliances, temperature, and security systems of an home by replacing the devices in the traditional ‘dumb’ devices with advanced ‘smart’ devices. These devices are usually controllable by the user through numerous communication channels such as smartphone applications, voice assistants (e.g. Amazon Alexa, Google Assistant), and pre-programmed schedules. Home automation systems not only provide a great convenience to its users, but also serve to increase the productivity and safety. The global market for home automation systems is expected to grow from $35.24 billion in 2016 to $113.82 billion by 2025 at a compound annual growth rate of 13.93% between 2017 and 2025 [1]. Soon home automation systems of some form will be in most people’s homes, which is why almost every major consumer electronics company has released devices for home automation. II. Background Existing home automation systems made by many companies are available at most electronics stores. Each home automation system typically consists of a hub of some sort which serves to connect the different communication channels to the automation system, coordinates communication to/from and between the devices, and runs tasks scheduled by the user. The devices such as a light switch, outlet, or thermostat can be purchased separately from the hub and any number of those devices may be added to the system as needed by the user. The hub typically communicates with the peripheral devices through one of these communication standards: Wi-Fi (IEEE 802.11), Z-Wave, ZigBee, and Bluetooth LE (low energy). The key differences in these standards are in range/network topography, power usage, and cost. All of these technologies have a comparable indoor range that is enough for most houses. Wi-Fi is the only one of these technologies that does not support a mesh network topography, which puts it behind the others because it may not work as well for larger houses or houses with large obstacles. The others’ mesh topography allows each device to be a repeater such that the optimal route to each device is found. Z-Wave, ZigBee, and Bluetooth LE also require much less power to operate compared to Wi-Fi. There is not a clear difference between these three technologies when only comparing their capabilities. The main difference between Z-Wave and ZigBee is that ZigBee is an open standard based on the IEEE 802.15.4 wireless-data specification while Z-Wave is a proprietary standard. Because of that, ZigBee is cheaper to utilize in devices and is less restricted in its usage. Bluetooth LE with mesh support was only released in July 2017, so it is relatively new and unused [2]. An example of a home automation system that can be built using existing components is shown in Table 1 and as follows: Samsung SmartThings ZigBee Enabled Hub ($99.99), Amazon Echo Dot ($49.99), Honeywell Touchscreen Wifi Thermostat ($206.99), GE ZigBee Wireless Smart Appliance Switch ($49.99), and GE In-Wall ZigBee Smart Lighting Control Dimmer ($54.99) for a total cost of $461.95. This system would be capable of controlling a single outlet (for any appliance or light), a single light switch, and the thermostat while also monitoring the power usage of each device controlled by the system. This relatively small initial system will cost a large amount of money and will then cost $49.99 or $54.99 for each additional outlet or light device added to the system. In order to fully automate a whole house, the cost would be unbearable for most people. On top of the large cost, this system does not allow the user to tweak the inner workings of the system, nor does it allow them to add custom devices. Table 1: Existing Home Automation System Description Cost Samsung SmartThings ZigBee Enabled Hub $99.99 Amazon Echo Dot $49.99 Honeywell Touchscreen Wifi Thermostat $206.99 GE ZigBee Wireless Smart Appliance Switch $49.99 GE In-Wall ZigBee Smart Lighting Control Dimmer $54.99 Total $461.95 This project aims to introduce a new home automation system to the market which solves the issues of high cost and low transparency / customizability of existing systems while retaining advanced features such as power monitoring, light dimming, scheduling, and ease of use. This project is a home automation system which allows the user to truly control what their automation system is doing, which should be a requirement for a system with such control over a person’s home. III. Client Requirements ● Outlet switching for lights or appliances requiring up to 15A AC current (standard home circuit breaker) [3] ● Lightswitch switching and dimming for incandescent and LED lights up to 15A AC current ● Thermostat capable of controlling a standard home HVAC (heating, ventilation, and air conditioning) system ● Power monitoring for all devices which are controlled by the system ● Compatibility with an existing voice assistant for voice control ● Touch screen interface for monitoring / controlling all of the devices connected to the system IV. Project Design A. Initial Design Choices In order for this system to be as transparent and cheap as possible, open source standards, devices, and software must be used when possible so that there are no proprietary aspects and no extra costs to the system. The best choice for wireless communication protocol for communication between devices, given this project’s requirements, is ZigBee since it is an open standard, is well established, and has many development boards and software to make testing and deployment easier. The Digi XBee Pro S2C Module (Figure 1) is the ZigBee development board used in this project because it is one of the cheapest modules and provides niceties such as its XCTU software useful for debugging and configuration of the devices, and there is also multiple open source programming APIs available for controlling the modules. These modules are relatively limited because they are not programmable, so they must be controlled remotely and themselves can not perform any autonomous tasks [4]. This is not an issue for this project since the hub will handle all of the ‘smart’ capabilities of the system while each device will only receive commands from the hub. Figure 1: Digi XBee Pro S2C Development Module The system’s hub, which functions similarly to existing home automation system hubs, serves to: bridge the gap between the ZigBee network and the user control interfaces, keep track of the devices currently in the system, track and run scheduled tasks, log the power usage of each device in the system. The hub consists of a Raspberry Pi (shown in Figure 2), chosen for its small form factor, low cost, low power usage, and features which meet the requirements of this project. Those required features are: serial port for communication with a Digi XBee module, GPIO (general purpose input/output) for controlling the relays required for HVAC system control, Wi-Fi capable for connecting the system to the internet, and touchscreen compatibility for the system’s touch screen interface [5]. Because the Raspberry Pi has the features needed for both the touch screen interface and the thermostat, it will serve as both the hub of the system and the thermostat in order to lower the overall cost of the system. Figure 2: Raspberry Pi Model 3 B The existing voice assistant chosen for compatibility with the system is the Amazon Alexa, which runs on the Amazon Echo Dot. This voice assistant was chosen because of its relatively low cost ($49.99) and the ease of adding compatibility with other services such as this system. Amazon provides its Alexa Skills kit, which allows anyone to build ‘skills’ for Alexa to be compatible with other services [6]. Figure 3: Amazon Echo Dot 2nd Edition B. Constraints and Considerations i. Safety Considerations Since this project is designed to be placed in a person’s home and meant to be running 24/7, certain safety constraints are necessary to ensure that the devices of this system are safe to use in a house. The most important safety consideration is the AC power, since the outlet and lightswitch devices are capable of handling up to 15A of AC current at 120V RMS.