Presentation is loading. Please wait.

Presentation is loading. Please wait.

家電控制系統-WSN+ARM mbed

Similar presentations


Presentation on theme: "家電控制系統-WSN+ARM mbed"— Presentation transcript:

1 雲端家電控制系統 joseph

2 Outline Motivation IoT System Architecture Hardware & Software specification Demo Q&A

3 Motivation 節能議題與物聯網 結合無線感測網路 (WSN) 與 IoT, 進行遠端家 電控制與能源監測 WSN : Application

4 IoT 系統架構 A D C B IoT Gateway GPIO ARM mbed device connector 110V Wi-Fi RESTful API/ HTTP MQTT GPIO

5 Hardware & Software specification Hardware 1)FCM2401 Module (802.15.4)x4 Relay & Switch Module Lamp (110V) 2)Raspberry Pi 3 for IoT Gateway x1 Pi Shield for buzzer Software 1)Routing protocol in FCM2401Module 2)mbed Client for mDS server 3)Node.js for Cloud Server ( between mDS server and browser) 4)Web APP

6 Multi-hop in WSN A D C B IoT Gateway Switch State Relay 110V Wi-Fi Switch Relay Control send_DATA(NORMAL) send_DATA_ACK (ACK) GPIO

7 My data Format Dest ID Seq No. Relay on/off Src MAC Src ID for Routing

8 send_DATA() TypeDest IDDest MACSrc IDSrc MACLenData[10] 0x10'B'0x0002'A'0x00017 for Routing 'D'0 state Dest ID 'A' 0x0001 Seq No. Relay on/off Src MAC Src ID Example: 'A'-->'D'

9 send_DATA_ACK() TypeDest IDDest MACSrc IDSrc MACLenData[10] 0x11'C'0x0003'D'0x00043 for Routing 'A' 0 state Seq No. Switch on/off Example: 'D'-->'A' Dest ID

10 Structure of routing table dest_id dest_macnext_id next_mac B0x0002B D0x0004D example: C's (MAC addr=0x003) routing table

11 dest_id dest_macnext_id next_mac B0x0002B D0x0004D find_next_hop() r =find_next_hop('B',tbl); r TypeDest IDDest MACSrc IDSrc MACLenData[10] 0x11'B'0x0002'C'0x0003 'C'-->'B'

12 Routing table 建構方式 用 Broadcast WHOAMI/WHOAMI_REPLY 建立一條 reverse path 沒有人回應時, 自己就是 A 用 unicast 建立一條 forward path (A 可以到 D) D0x0004D Relay Switch C0x0003C A B C D A0x0001A B0x0002B D0x0004C D B0x0002 假設

13 PART 2 ARM MBED CLOUD

14

15 mbed Device Connector Free to IoT developers Free tier is limited to 100 devices, 10,000 events per hours and two API keys.

16

17

18 Resource Path for RESTful API GPIO/ 0/ 1)STATE 1/ 1)BUTTON1 2)BUTTON2 3)Zigbee 4)….. 可以將 GPIO 註冊成為一種資源來進行讀 / 寫 / 執行函式 利用 HTTP GET 讀取 Zigbee 裝置的狀態 利用 HTTP POST 控制 Zigbee 裝置動作 ( 執行特定函式 ) 1) 函式參數可由 POST Payload 取出 Example: HTTP POST GPIO/1/Zigbee with payload "relay=on"

19 註冊 Resource

20 HTTP long Polling HTTP Get GPIO/1/Zigbee Resource Path: GPIO/1/Zigbee

21 HTPP Response

22 HTTP POST "relay=on" or "relay=off" curl -v -H 'Authorization: Bearer ' -H Content-Type:text/plain -X POST --data-raw 'relay=off' https://api.connector.mbed.com/endpoints/da3c152f- 5e48-4f89-8eb6-e9fae4b32a14/GPIO/1/Zigbee/

23 WebAPP Socket.io Express node.js HTTP mbed-connector-api mbed DS HTML JQuery Socket.io JavaScript CSS web Socket https://api.connector.mbed.com HTTPS RESTful Web interfaces with Access Key

24

25 Demo

26 問題 Pi 必須提供電源端的 3.3V 及 5V 才能使 MCU 的 GPIO 看到 1, 其他 Pi 的輸出接腳, 即使 >3.3V 能然使得 MCU GPIO=1 電流問題, Pi 的 GPIO 腳輸出電流太小 (~30mA).. 不足以驅動 MCU 上的電晶體使得 MCU 無法看見 GPIO 變化 1) 必須輸入電流 >=400mA 才能看見變化

27 解法方案 (1) 接一顆電晶體 (2) 用 Relay 解決 Raspberry PiMCU MCU' 5V MCU' GPIO Pi GPIO

28 THANK YOU


Download ppt "家電控制系統-WSN+ARM mbed"

Similar presentations


Ads by Google