簡易檢索 / 詳目顯示

研究生: 蕭凱元
KAI-YUAN XIAO
論文名稱: 基於雙通訊協定之無線感測模組發展與其應用於物聯網之研究
Study of wireless sensor module development with dual communication protocols and its applications to IoT
指導教授: 蔡明忠
Ming-Jong Tsai
口試委員: 徐勝均
Sendren Sheng-Dong Xu
邱綺文
Che Wun Chiou
吳秋松
Chiu-Sung Wu
學位類別: 碩士
Master
系所名稱: 工程學院 - 自動化及控制研究所
Graduate Institute of Automation and Control
論文出版年: 2016
畢業學年度: 104
語文別: 英文
論文頁數: 60
中文關鍵詞: 無線感測物聯網ModbusMQTTAndroid AppThinkSpeak
外文關鍵詞: Wireless Sensor, Internet of Things (IoT), Modbus, MQTT (Message Queuing Telemetry Transport), Android App, ThinkSpeak
相關次數: 點閱:632下載:2
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 近年來,室內空氣品質的議題日漸受人重視,如PM2.5、PM10等空氣微粒之即時監控就顯得相當重要。一般室內品質監控器透過乙太網路、RS-485或類比傳輸介面傳收資料,而通訊標準協定Modbus RTU或Modbus TCP,在現今的工業應用中仍廣泛的被使用。本研究為開發無線感測模組,除沿用Modbus TCP之通訊協定以符合工業相關應用,另引入機器與機器/物聯網通訊協定MQ Telemetry Transport(MQTT)增強經由行動裝置對感測模組之訊息推播與資料儲存能力,透過本研究開發之Android App可即時同步接收由感測模組所推播出來之訊息。另為增加蒐集資料之可視度,感測模組亦將資料同步推送至ThinkSpeak雲端平台進行線上資料儲存與顯示,透過該平台之線上分析系統,可得感測資料之相關趨勢圖,最後還可以MySQL做長時間資料的蒐集。透過本研究提出無線感測模組之雙通訊協定架構,可省下佈線成本且增加系統延展性,透過互動式MQTT傳輸技術並可有效掌握感測器之連線狀態,降低無線感測器應用時之不確定性。


    In the recent years, the issue of the air quality is highly concerned in public such as the particulate matter (PM2.5 or PM10) which is required to be immediately monitored. Generally, indoor air quality sensors communicate with the control systems through Ethernet, RS-485 or other analog transmission interfaces. The Modbus RTU and Modbus TCP standard communication protocols are still popularly used for industrial applications. This paper aims to develop a wireless sensor module with dual communication protocols. The Modbus TCP is used in the sensor module to make it easily be integrated into industrial systems. Another Machine-to-Machine (M2M)/ Internet of Things (IoT) protocol, called MQ Telemetry Transport (MQTT) is utilized to enhance the abilities of the message notification and the data storage through a mobile device. The data acquisition is allowed through a developed Android App. Besides, to enhance the visibility of the sensing data, a cloud-based platform ThinkSpeak is adopted to do the online data storage / display. The data, pushed to the platform can be analyzed by the online analytics service. The trend of the uploaded data will be shown on the platform as well. Finally, MySQL database is adopted for long-term data storage with MQTT protocol. The cost of wire deployment and the system scalability can be improved with the proposed dual communication protocols architecture for a wireless sensor module. The uncertainty of wireless sensor modules applying into an industrial control system can be reduced with MQTT based interactive communication technique.

    摘要.........................................................III ABSTRACT.....................................................IV ACKNOWLEDGEMENT..............................................V TABLE OF CONTENT.............................................VI LIST OF FIGURES..............................................VIII LIST OF TABLES...............................................X CHAPTER 1 INTRODUCTION.......................................1 1.1 Background.......................................1 1.2 Research Objective...............................2 1.3 Literature Review................................2 CHAPERT 2 METHOD............................................8 2.1 System Architecture..............................8 2.1.1 Hardware architecture.......................8 2.1.2 System illustration.........................9 2.2 Hardware.........................................10 2.2.1 NodeMCU.....................................10 2.2.2 AM2302(DHT22)...............................11 2.2.3 PMS5005.....................................13 2.2.4 Flame sensor................................15 2.2.5 Raspberry PI................................16 2.3 Communication Protocols..........................17 2.3.1 Overview of Modbus Series Protocols.........17 2.3.2 Data Frame of Modbus TCP/IP.................20 2.3.3 Flow chart of Modbus TCP on the slave side..23 2.3.4 Overview of MQTT Protocol...................24 2.3.5 Data Format of MQTT.........................25 2.3.6 Fixed Header of MQTT........................26 2.3.7 PUBLISH message of MQTT Protocol............27 2.3.8 DISCONNECT Message of MQTT..................29 2.3.9 SUBSCRIBE Message of MQTT...................30 2.3.10 CONNECT Message of MQTT Protocol...........31 2.3.11 UNSUBSCRIBE Message of MQTT Protocol.......33 2.3.12 MQTT operation flow chart on the sensor module side..34 2.4 Overall flow chart on the sensor side............36 CHAPTER 3 EXPERIMENTAL RESULTS...............................38 3.1 Android App Demonstration........................38 3.1.1 Architecture................................38 3.1.2 MQTT Service on the Android App.............39 3.1.3 Modbus TCP Service on the Android App.......41 3.1.4 App HMI Demonstration.......................43 3.1.5 MQTT user interface setting.................43 3.2 Data Storage.....................................46 3.3 Website and the Database Data Demonstration......49 CHAPTER 4 CONCLUSIONS AND FUTURE WORKS.......................54 4.1 Conclusions......................................54 4.2 Future Works.....................................55 REFERENCE....................................................57

    [1] S.P. Tseng, B.R. Li, J.L. Pan and C.J. Lin, “An application of Internet of things with motion sensing on smart house,” Proc. Orange Technologies (ICOT), 2014 IEEE International Conference on, 2014, pp. 65-68.
    [2] M. Wang, G. Zhang, C. Zhang, J. Zhang and C. Li, “An IoT-based appliance control system for smart homes,” Proc. Intelligent Control and Information Processing (ICICIP), 2013 Fourth International Conference on, 2013, pp. 744-747.
    [3] C. Razafimandimby, V. Loscri and A.M. Vegni, “A Neural Network and IoT Based Scheme for Performance Assessment in Internet of Robotic Things,” Proc. 2016 IEEE First International Conference on Internet-of-Things Design and Implementation (IoTDI), 2016, pp. 241-246.
    [4] Y. Qingquan, S. Lingling, J. Jin, F. Chen, C. Juan and L. Qishengbao, “The design of quad-rotor environmental monitoring system based on Internet of Things,” Proc. 2015 IEEE 16th International Conference on Communication Technology (ICCT), 2015, pp. 97-101.
    [5] Volkan Gunes, Steffen Peter, Tony Givargis, and Frank Vahid “A Survey on Concepts, Applications, and Challenges in Cyber-Physical Systems,” KSII Transactions on Internet and Information Systems, vol. 8, no. 12, 2014; DOI 10.3837/tiis.2014.12.001.
    [6] Eric D. Knapp (2011) ,Industrial Network Security Securing Critical Infrastructure Networks for Smart Grid, SCADA, and Other Industrial Control Systems Chapter 4, Syngress pp.55-87
    [7] James Powell, Siemens(2013 Oct 13)”Profibus and Modbus:a comparison”
    [8] http://mqtt.org/ (Access 26.06.2016)
    [9] https://xmpp.org/ (Access 26.06.2016)
    [10] http://coap.technology/ (Access 26.06.2016)
    [11] http://mqtt.org/2013/12/mqtt-for-sensor-networks-mqtt-sn (Access 26.06.2016)
    [12] B. Cendo´ n, C Anton-Haro, Mischa Dohler (2014) ,Machine-to-machine (M2M) communications: Architecture, performance and applications 5fifth article, Elsevier Ltd.
    [13] G. Chunchi, Z. Hao and C. Qijun, “Design and implementation of energy data collection system using wireless fidelity (WiFi) module and current transformer,” Proc. 2014 IEEE International Conference on System Science and Engineering (ICSSE), 2014, pp. 133-137.
    [14] G. Yaguang, B.X. Du, Y. Gao, L. Xiaolong and H.B. Li, “On-line monitoring system based on MODBUS for temperature measurement in smart grid,” Proc. IEEE PES Innovative Smart Grid Technologies, 2012, pp. 1-5
    [15] C. Zhou, W. Huang, and X. Zhao, "Study on architecture of smart home management system and key devices," in Computer Science and Network Technology (ICCSNT), 2013 3rd International Conference on, 2013, pp. 1255-1258.
    [16] S. Tozlu, M. Senel, W. Mao et al., “Wi-Fi enabled sensors for internet of things: A practical approach,” IEEE Communications Magazine, vol. 50, no. 6, pp. 134-143, 2012.
    [17] J. Cao, "Flexible Data Collecting over Distributed Sensors on Enterprise Service Bus," in 2009 Fourth International Conference on Frontier of Computer Science and Technology, 2009, pp. 226-230.
    [18] N. Tongzhuang, "A research on the design of smart pressure transmitter," in Computer Science and Information Processing (CSIP), 2012 International Conference on, 2012, pp. 803-806.
    [19] J. Wei, Y. Ping, C. liting, and S. Yunzhong, "On M_bus communication protocol for intellectual heat meter in open control system," in Intelligent Control andAutomation, 2008. WCICA 2008. 7th World Congress on, 2008, pp. 6911-6916.
    [20] D. Peng, H. Zhang, K. Zhang, H. Li, and F. Xia, "Research and Development of the Remote I/O Data Acquisition System Based on Embedded ARM Platform," in Electronic Computer Technology, 2009 International Conference on, 2009, pp. 341-344.
    [21] D. Peng, H. Zhang, W. Jiannian, L. Hui, and X. Fei, "Design and development of Modbus/RTU master monitoring system based on embedded PowerPC platform", in 2009 IEEE International Symposium on Industrial Electronics, 2009, pp. 2148-2152.
    [22] N. Li, Y. Du, and G. Chen, "Survey of Cloud Messaging Push Notification Service," in Information Science and Cloud Computing Companion (ISCC-C), 2013 International Conference on, 2013, pp. 273-279.
    [23] P. Li, Y. Chen, T. Li, R. Wang, and J. Sun, "Implementation of Cloud Messaging System Based on GCM Service," in Computational and Information Sciences (ICCIS),2013 Fifth International Conference on, 2013, pp. 1509-1512.
    [24] H. W. Chen and F. J. Lin, "Converging MQTT Resources in ETSI Standards Based M2M Platform," in Internet of Things (iThings), 2014 IEEE International Conference on, and Green Computing and Communications (GreenCom), IEEE and Cyber, Physical and Social Computing(CPSCom), IEEE, 2014, pp. 292-295.
    [25] L. Durkop, B. Czybik, and J. Jasperneite, "Performance evaluation of M2M protocols over cellular networks in a lab environment," in Intelligence in Next Generation Networks (ICIN), 2015 18th International Conference on, 2015, pp. 70-75.
    [26] S. Bandyopadhyay and A. Bhattacharyya, "Lightweight Internet protocols for web enablement of sensors using constrained gateway devices," in Computing, Networking and Communications (ICNC), 2013 International Conference on, 2013, pp. 334-340.
    [27] C. Lesjak, D. Hein, M. Hofmann, M. Maritsch, A. Aldrian, P. Priller, et al., "Securing smart maintenance services: Hardware-security and TLS for MQTT," in 2015 IEEE 13th International Conference on Industrial Informatics (INDIN), 2015, pp. 1243-1250.
    [28] D. Thangavel, X. Ma, A. Valera, H. X. Tan, and C. K. Y. Tan, "Performance
    evaluation of MQTT and CoAP via a common middleware," in Intelligent Sensors,Sensor Networks and Information Processing (ISSNIP), 2014 IEEE Ninth International Conference on, 2014, pp. 1-6.
    [29] N. D. Bui, A. G. Kravets, T. A. Nguyen, and L. T. T. Nguyen, "Tracking events in mobile device management system," in Information, Intelligence, Systems and Applications (IISA), 2015 6th International Conference on, 2015, pp. 1-6.
    [30] J. M. Robinson, J. G. Frey, A. J. Stanford-Clark, A. D. Reynolds, and B. V. Bedi, "Sensor networks and grid middleware for laboratory monitoring," in First International Conference on e-Science and Grid Computing (e-Science'05), 2005, pp. 8 pp.-569.
    [31] http://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html (Access 29.06.2016)
    [32] ttps://www.acromag.com/sites/default/files/Acromag_Intro_ModbusTCP_765A.pdf (Access 29.06.2016)
    [33] https://thingspeak.com/ (Access 05.07.2016)
    [34] http://www.nodemcu.com/index_cn.html (Access 05.07.2016)
    [35] https://github.com/esp8266/Arduino (Access 05.07.2016)
    [36] https://cdn-shop.adafruit.com/datasheets/Digital+humidity+and+temperature
    +sensor+AM2302.pdf (Access 05.07.2016)
    [37] http://www.modbus.org/docs/Modbus_Messaging_Implementation_Gu
    ide_V1_0b.pdf (Accrss 05.07.2016)
    [38] http://www.protoconvert.com/TechnicalResourses/Tutorials/Modbus.aspx
    (Access 05.07.2016)
    [39] Acromag,Inc,“INTRODUCTION TO MODBUS TCP/IP https://www.acromag.com/sites/default/files/Acromag_Intro_ModbusTCP_765 A.pdf (Access 05.07.2016)
    [40] https://www.apachefriends.org/zh_tw/index.html (Access 05.07.2016)
    [41] https://mosquitto.org/ (Access 06.07.2016)
    [42] http://www.codedata.com.tw/mobile/android-tutorial-the-1st-class-1-sunwukong/ Android Tutorial(Access 23.07.2016)

    QR CODE