簡易檢索 / 詳目顯示

研究生: 李亞樵
Ya-Chiao Lee
論文名稱: MQTT傳輸技術於智慧感測系統之應用
Application of smart sensing system base on MQTT transmission technology
指導教授: 蔡明忠
Ming-Jong Tsai
口試委員: 蔡明忠
邱綺文
楊振雄
吳秋松
學位類別: 碩士
Master
系所名稱: 工程學院 - 自動化及控制研究所
Graduate Institute of Automation and Control
論文出版年: 2018
畢業學年度: 106
語文別: 中文
論文頁數: 76
中文關鍵詞: 物聯網資料擷取MQTT通訊協定Android App手機應用程式智慧感測監控系統
外文關鍵詞: Internet of Things (IoT), Data acquisition, MQTT, Android App, Smart sensing monitoring system
相關次數: 點閱:641下載:5
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 隨著資通訊科技的進步,工業4.0、物聯網等名詞日趨普及,資訊不再限於本地端讀取。透過網路,許多的數據可以在世界的各個角落被查看、控制。基於這些通訊技術的進步及近年來環保意識的崛起,許多人開始利用物聯網技術試圖改善生活環境。本研究將利用輕量型通訊協定 - MQTT,設計一個遠端智慧感知監控之系統,落實物聯網概念。
    而目前市面上多數的通訊型感測器仍是透過RS-485及類比輸出的方式傳收資料,通訊方式則是常沿用工業通訊標準Modbus RTU。因此感測器至控制器及人機介面間都必須透過有線方式傳輸資料,除了佈線上的困擾外,傳輸距離也會受到限制。本研究提出了使用MQTT做為資料傳輸的方式,建立一個MQTT的代理伺服器,利用廣播的特性,可使得分佈於各個地方的感測器或致動器可透過網路將所有資訊作交流、處理,並可從遠端監看及控制。相對於傳統工業用Modbus協定一問一答的資料傳輸方式,MQTT廣播的方式可一次傳輸或接收多筆資料。使資料的傳輸更有效率,在物聯網應用上更具優勢。本研究使用Arduino搭配乙太網路線做為感測端之硬體,而伺服器軟體部分則利用微軟.NET的C#做為開發語言,最後使用者介面則是使用Android Studio做為開發軟體,撰寫一個專用的手機應用程式。
    本研究實現MQTT遠端智慧監控系統,放置於多處的感測器將收集資料後透過MQTT發佈各處資訊,如溫度、濕度、二氧化碳濃度等資料,經由伺服器分析後自行做出相對應的判斷處理。除了將所有資訊顯示於在地伺服器介面上,也可於遠端之智慧型手機開啟APP觀看數據及下達控制指令,達成智慧感測及遠端監控的概念。


    Nowadays, the terms such as “Industry 4.0”、”IoT” become popular with Information Technology(IT). Lots of data could all be searched and controlled everywhere in the world through Internet. And by the progress of IT and rising environmental-friendly consciousness, people try to improve life-being using IOT technology. The research in this thesis intends to design a remote monitoring system with smart sensing technology, which is based on MQTT.
    Most of the existing sensors send and collect data via RS-485 and analog output. Thus, sensors, controllers and interfaces all need to transmit data in a wired network, which results in wiring problem and also limits the transmission distance. By transmitting via MQTT, mentioned in this research, sensors could collect data together through Internet so that we would be able to monitor and control remotely. The MQTT protocol uses a publish/subscribe architecture in contrast to Modbus with its request/response paradigm which means MQTT can transmit or receive multiple data at one time .Thus, MQTT has an advantage in IoT applications. To get to this step, This study uses Arduino pairs with Ethernet Network as hardware of sensing-end, C# from Microsoft .Net as server developing language, and for the interface development, the Android Studio is used to develop an exclusive mobile application.
    This research implements MQTT intelligent remotely-monitoring system. Sensors anywhere can be collected and then spreaded the local data, such as temperature, humidity, CO2 concentration and all the others through MQTT. Data sent would pass through MQTT Broker to servers and user interfaces, by that, fulfill the vision: Remote Monitoring for housing environment.

    摘要 III Abstract IV 致謝 V 目錄 VI 圖目錄 IX 表目錄 XII 第一章 緒論 1 1.1 研究背景 1 1.2 研究動機與目的 3 1.3 研究方法 4 1.4 本文架構 6 第二章 文獻回顧與相關技術探討 7 2.1 物聯網簡介 7 2.2 OSI協定及TCP協定 11 2.2.1 OSI協定 11 2.2.2 TCP/IP協定 13 2.3 MQTT通訊協定 14 2.3.1 MQTT簡介 14 2.3.2 MQTT Message Type 17 2.3.3 訊息格式 18 2.4 Modbus通訊協定 19 2.4.1 Modbus通訊原理 19 2.4.2 Modbus RTU封包格式 20 2.4.3 異常回應 22 2.5 文獻探討 23 2.5.1 MQTT相關應用 23 2.5.2 Modbus通訊協定相關應用 24 2.5.2智慧感測 26 第三章 系統架構及研究方法 27 3.1 實驗方法 27 3.2 實驗系統架構 29 3.3 通訊協定 30 3.3.1 MQTT 30 3.3.2 Modbus RTU 32 3.4 硬體架構 34 3.4.1 Arduino控制板 34 3.4.2 溫濕度感測器 38 3.4.3 火焰感測器 39 3.4.4 人體紅外線感測器 41 3.4.5 二氧化碳感測器 42 3.5 系統程式設計 44 3.5.1 Arduino韌體撰寫 44 3.5.2 C#介面設計 46 3.5.3 Android Studio 50 第四章 實驗結果 53 4.1 MQTT通訊功能測試 53 4.2 Arduino功能測試 55 4.3 C#人機介面 60 4.4 手機APP介面 67 4.5 系統整合測試 69 第五章 結論與未來方向 75 5.1 結論 75 5.2 未來發展方向 76 參考文獻 77

    [1] 空氣品質資訊網。 [cited 2018 Jun 28]; Available from: https://iaq.epa.gov.tw/indoorair/page/News_6_1.aspx.
    [2] 二氧化碳的來源與健康危害。 [cited 2018 Jun 28]; Available from: http://www.homewell.tw/classroom/evn-class/e01-07.htm.
    [3] 曾奕慈 , 室內二氧化碳濃度1000ppm以上將危害人體。 [cited 2018 Jun 28]; Available from: https://news.tvbs.com.tw/warm/662916.
    [4] 內政部消防署, 住宅防火對策。 [cited 2018 Jun 28]; Available from: https://www.nfa.gov.tw/cht/index.php?code=list&ids=265.
    [5] 警政署統計室, 警政統計通報(106年第9週)。 [cited 2018 Jun 28];
    [6] 警政署統計室, 警政統計通報(105年第10週)。 [cited 2018 Jun 28];
    [7] 洪偉倫, 基於Modbus TCP之無線室內空氣品質感測器研究. 2015.
    [8] 翁書婷, 30個關鍵字讓你搞懂物聯網。2015。 [cited 2018 Jun 28]; Available from: https://www.bnext.com.tw/article/34549/bn-article-34549.
    [9] 了解物聯網。[cited 2018 Jun 28];Available from: http://design2u.me/blog/69/%E4%BA%86%E8%A7%A3%E7%89%A9%E8%81%AF%E7%B6%B2.
    [10] 鄭逸寧, 物聯網技術大剖析。 [cited 2018 Jun 28]; Available from: https://www.ithome.com.tw/news/90461.
    [11] 物聯網支付技術架構和發展趨勢。2017。 [cited 2018 Jun 28]; Available from: https://zi.media/@yidianzixun/post/CUbuko.
    [12] 簡單認識物聯網(Internet of Things). 2017。 [cited 2018 Jun 28]; Available from: https://a1.digiwin.com/essay/essay-content.php?detail=61.
    [13] 高佑嘉,下一波資訊發展浪潮:物聯網時代即將降臨。[cited 2018 Jun 28]; Available from: http://lws0820.blogspot.com/2011/12/blog-post_5894.html.
    [14] 張志勇、陳正昌, 物物相聯的龐大網路—物聯網. 2014。 [cited 2018 Jun 28]; Available from: http://scimonth.blogspot.com/2014/05/blog-post_3117.html.
    [15] OSI 協定 vs. TCP/IP 協定。 [cited 2018 Jun 28]; Available from: http://www.baud.com.tw/knowledge/knowledge_voip_02.htm.
    [16] 鳥哥的Linux 私房菜-基礎網路概念。 [cited 2018 Jun 28]; Available from: http://linux.vbird.org/linux_server/0110network_basic.php.
    [17] MQTT 通訊協議。[cited 2018 Jun 28] Available from: https://goo.gl/9LJuXs.
    [18] MQTT V3.1 Protocol Specification。 [cited 2018 Jun 28]; Available from: https://zh.scribd.com/document/306244735/MQTT-V3-1-Protocol-Specification.
    [19] 蕭凱元, 基於雙通訊協定之無線感測模組發展與其應用於物聯網之研究 , 碩士論文,自動化及控制研究所,2016,國立台灣科技大學
    [20] 關於modbus RTU的使用說明。 [cited 2018 Jun 28]; Available from: http://www.xuan.idv.tw/wordpress/?p=2427.
    [21] Modbus_Application_Protocol。 [cited 2018 Jun 28]; Available from: http://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b3.pdf.
    [22] Modbus RTU CRC-計算 Modbus RTU 檢查碼。 [cited 2018 Jun 28]; Available from: https://goo.gl/iDPhjm.
    [23] 深入了解 Modbus 協定。[cited 2018 Jun 28]; Available from: http://www.ni.com/white-paper/52134/zht/.
    [24] 程軒, 一個在車聯網中以MQTT為基礎之自適性指引與通知服務系統 , 碩士論文 , 資訊工程學系 , 2016 , 逢甲大學。
    [25] 陳昭穎, 運用能源匯流排與訊息序列遙測傳輸技術的電動自行車能源管理系統, 碩士論文 , 資訊工程學系 , 2017 , 逢甲大學。
    [26] 鄭達偉, MQTT訊息傳遞連續性研究-無限距離四軸直升機, 碩士論文 , 通訊工程碩士學位學程 , 2016 , 中原大學。
    [27] 陳是升, Modbus應用於風機通訊傳輸之研究, 碩士論文 , 工程科學及海洋工程學研究所, 2015 , 國立臺灣大學。
    [28] 張偉強,利用Modbus RTU結合遠端處理技術之監控系統設計, 碩士論文 , 數位機電科技研究所, 2009 , 中國文化大學。
    [29] 蘇哲民, 基於Modbus傳輸技術之無線路由器研究, 碩士論文,自動化及控制研究所,2018,國立台灣科技大學
    [30] 沈哲宇, 具物聯網之智慧家居空品監控系統, 碩士論文,機電整合研究所,2017,臺北城市科技大學
    [31] 溫士範, 物聯網架構下整合用電管理暨環境監測之智慧家居系統研製 , 碩士論文,電機工程學系碩博士班,2012,國立成功大學
    [32] 洪婉淇, 物聯網智慧居家安全監控系統之設計, 碩士論文,資訊科技應用研究所,2016,高苑科技大學
    [33] 雲端伺服器與MQTT Broker建置。[cited 2018 Jun 28]; Available from: https://goo.gl/388YSm.
    [34] Raspberry Pi安裝MQTT之應用 -- Android訊息推播。 [cited 2018 Jun 28]; Available from: http://cheng-min-i-taiwan.blogspot.com/2015/03/raspberry-pimqtt-android.html.
    [35] ARDUINO MEGA 2560 PRODUCT INFORMATION。[cited 2018 Jun 28];Available from: http://www.robotek.pk/product/arduino-mega-2560/.
    [36] CO2 Sensor SKU:SEN0159。[cited 2018 Jun 28]; Available from: https://media.digikey.com/pdf/Data%20Sheets/DFRobot%20PDFs/SEN0159_Web.pdf.

    QR CODE