
IMPLEMENTATION OF IOT-BASED HOME CONTROL AND MONITORING SYSTEM USING RASPBERRY PI AND NodeMCUs KAUNG NYUNT SAN M.C.Tech. JANUARY 2019 IMPLEMENTATION OF IOT-BASED HOME CONTROL AND MONITORING SYSTEM USING RASPBERRY PI AND NodeMCUs BY KAUNG NYUNT SAN B.C.Tech. A Dissertation Submitted in Partial Fulfillment of the Requirements for the Degree of Master of Computer Technology (M.C.Tech.) University of Computer Studies, Yangon JANUARY 2019 ACKNOWLEDGEMENTS I thank all my teachers and my friends, who taught and helped me during the period of studies at the University of Computer Studies, Yangon. First of all, I would like to express my gratitude and sincere thanks to Dr. Mie Mie Thet Thwin, Rector of the University of Computer Studies, Yangon, for allowing me to develop this thesis. I would like to thank Dr. Khin Than Mya, Professor and Head of Faculty of Computer Systems and Technologies, University of Computer Studies, Yangon, for her guidance and enthusiasm throughout the progress of this work. I also wish to especially and deeply thank to my supervisor Daw Hlaing Thida Oo, Associate Professor of Faculty of Computer Systems and Technologies, University of Computer Studies, Hinthada, for her invaluable suggestion, supervision, guiding and constant encouragement all through the thesis work. I also thank to my teacher, Dr. Aung Htein Maw, Professor at University of Information Technology, Yangon, an external teacher of this thesis committee and I am gratefully indebted to his for his precious comments on this thesis. I would also like to show my gratitude to my teacher, Dr. Tweta Oo, Lecturer and Coordinator of Faculty of Computer Systems and Technologies, University of Computer Studies, Yangon, for her suggestion and help in this work. Moreover, I would like to thank Daw Nan Win Yee, Tutor of Department of Language, University of Computer Studies, Yangon, for editing my thesis from the language point of view. I really like to express my great thanks to my parents for their continuous love and support throughout my studies. Also, thanks to my family for their support during my hard time. Finally, I also thank my fellow classmates who have been with me over the past few years, their support and assistance has been key in helping me. i ABSTRACT This thesis presents the application of “Implementation of IoT-based Home Control and Monitoring System using Raspberry Pi and NodeMCUs”. The purpose of the presented application is an efficient implementation for IoT (Internet of Things) used for monitoring and controlling the home appliances via World Wide Web. Home automation system uses the portable end devices as a user interface. They can communicate with home automation network through an Internet gateway, by means of low power communication protocols like MQTT, Wi-Fi etc. The system is running with Raspberry Pi (Credit-card size computer) as a server and NodeMCU as a client node. User can easily control many appliances like light switches, electronic devices and door locks, and also can monitor home environment through a friendly web-based user interface through browser (Firefox, Chrome, Internet Explorer, etc.) from end devices. To protect from the aspect of fireplace accidents this system contains flame-detected fire alarm function which detects the flame within the event of fireplace and inform the status of event to the user as messages, e-mails and notifications. The server is directly connected with relay-hardware circuits to control the home appliances and webcam for monitoring the home environment. This system makes easier by implementing automation and security along with the Internet of Things to create a system which will enable someone to remotely monitor and control some areas of a house remotely and securely from anywhere with minimum cost. ii CONTENTS Page ACKNOWLEDGEMENTS i ABSTRACT ii CONTENTS iii LIST OF FIGURES vi LIST OF TABLES ix CHAPTER 1 INTRODUCTION 1 1.1 Objectives of the Thesis 2 1.2 Outline of the Thesis 2 1.3 Overview of the Thesis 3 CHAPTER 2 BACKGROUND THEORY 6 2.1 Automatic Control System (Automation) 7 2.1.1 Open-loop and closed-loop (feedback) control 7 2.1.2 Computer Control 8 2.2 Wireless Communication Technologies 9 2.3 Lightweight Communication Protocols 9 2.3.1 Message Queuing Telemetry Transport 11 2.3.2 Constrained Application Protocol (CoAP) 13 CHAPTER 3 ANALYSIS AND REVIEW OF IoT-BASED 15 HOME AUTOMATION SYSTEMS 3.1 Internet of Things 15 3.2 Raspberry Pi 16 iii 3.2.1 Software of Raspberry Pi 18 3.3 NodeMCU 18 3.3.1 Specification of NodeMCU 19 3.3.2 Code examples 21 3.4 Wireless Router 24 3.5 Sensors and Components of the System 25 3.5.1 Magnetic Door Sensor 25 3.5.2 DTH 11 Sensor 26 3.5.3 Flame Sensor Module 26 3.5.4 RFID Module 27 3.5.5 Relay 28 3.5.6 Buzzer 29 3.5.7 Keypad 29 3.5.8 Solenoid Electronic lock 30 3.5.9 Webcam 30 3.6 Design Implementation of IoT-based Home 31 Control and Monitoring system CHAPTER 4 HARDWARE AND SOFTWARE IMPLEMENTATION 35 4.1 Sensors and Camera Interfacing 35 4.2 Raspberry Pi and NodeMCU 36 4.3 Wi-Fi Router Configuration 38 iv 4.4 MQTT Protocol 39 4.4.1 MQTT Method and Testing 40 4.5 IFTTT, Remot3.it, Weather Underground 42 4.5.1 IFTTT 42 4.5.2 Remot3.it 44 4.5.3 Weather Underground 46 4.6 Home Assistant 47 4.7 Software Implementation of the System 57 4.8 Operation of the System 59 4.9 Comparison from other Home Automation System 62 4.10 Evaluation of the System 64 CHAPTER 5 CONCLUSION AND FURTHER EXTENSION 66 5.1 Conclusion 66 5.2 Advantages of the Thesis 67 5.3 Limitations of the Thesis 67 5.4 Further Extension 68 REFERENCES 69 PUBLICATION 71 v LIST OF FIGURES Figure Page Figure 1.1 Block Diagram of Proposed System 4 Figure 1.2 Architecture of Proposed System 4 Figure 2.1 Block Diagram of the Open Loop and Closed Loop Control System 7 Figure 2.2 State Diagram of Door System 8 Figure 2.3 M2M Architecture 10 Figure 2.4 Levels of QoS 13 Figure 2.5 Comparison of MQTT and CoAP 14 Figure 3.1 Layers of Internet of Things (IoT) 15 Figure 3.2 Series of Raspberry pi 16 Figure 3.3 Raspberry Pi 3 Model B with GPIO Pinout Diagram 17 Figure 3.4 NodeMCU 19 Figure 3.5 Pin Definition of NodeMCU 20 Figure 3.6 Sim Wireless Router 25 Figure 3.7 Magnetic Door Sensor 25 Figure 3.8 DTH11 Sensor 26 Figure 3.9 Flame Sensor Module 27 Figure 3.10 RFID Reader Module and Tag 27 Figure 3.11 Relay Module 28 Figure 3.12 Buzzers 29 vi Figure 3.13 Keypads 30 Figure 3.14 Solenoid Electronic lock 30 Figure 3.15 Webcams 31 Figure 3.16 Design Layout of Front Door Part 32 Figure 3.17 Design Layout of Back Door Part 33 Figure 3.18 Design Layout of Main Part 34 Figure 4.1 Preparation result of Raspberry Pi 37 Figure 4.2 Preparation result of NodeMCU 38 Figure 4.3 Wi-Fi configuration setting 39 Figure 4.4 MQTT Process 40 Figure 4.5 MQTT Testing 41 Figure 4.6 IFTTT Applets 43 Figure 4.7 IFTTT API key 43 Figure 4.8 Configured Services and Connections of Remot3.it 45 Figure 4.9 WUI and API key of Weather Underground Service 47 Figure 4.10 Home Assistant Platform and Some Support Components 48 Figure 4.11 Text Output of [email protected] File 51 Figure 4.12 Output of configuration.ymal File 52 Figure 4.13 Result of checking conFigure files with “hass --script check_config” 53 Figure 4.14 Result of Testing Home Assistant Webpage 54 Figure 4.15 List of Home Assistant Configuration Files for the System 55 vii Figure 4.16 Complete Web-UI of the Whole System 55 Figure 4.17 Hardware Implementation of the System 56 Figure 4.18 Prototype of the System 57 Figure 4.19 Flow Chart of the System 58 Figure 4.20 Login Page and Complete WUI of Home Assistant 60 Figure 4.21 Notifications receive from user side 61 viii LIST OF TABLES Table Page Table 2.1 Wi-Fi Protocols and their Data rates 9 Table 2.2 Quick Comparison of MQTT and CoAP 11 Table 3.1 Pin Mapping Table of NodeMCU 20 Table 4.1 Comparison with other Home Automation System 62 Table 4.2 Comparison of the Features of Commercial Home Automation System 65 ix CHAPTER 1 INTRODUCTION Today, technology play very important role in our daily lives. We cannot live without technologies such as televisions, smart phones, computers, Internet and others. Because these technologies influence as an essential part in our day-to-day lives. Communication is thus enhanced, and people can communicate more easily with each other. With the help of technologies, we can easily communicate with our friend and store personal data such as photo, documents, music and movies. To simplify daily life of people, we connect many devices to Internet. The main advantage of the Internet is its ability to connect billions of end devices from different places to create a link between them. So, we can connect from any places to get access and information of devices we need. During this progress we can saving time, energy and money. Home automation (also known as domotics) refers to control appliances, activity, and features of home.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages82 Page
-
File Size-