![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-a4b36b9e49afefe952add065c1dcc92a.jpg)
家裡在做專業的蘭花養殖,溫室栽培中溫度和亮度是很關鍵的兩個參數,套一位老業者的話:蘭花種的好沒有訣竅,只需要細心觀察,做好記錄。無意間知道有Arduino這個東西,突發奇想,決定自己做一個wireless的氣象儀,把偵測到的溫度,濕度,亮度上傳到server上,再透過網頁顯示出來,這樣不但電腦可以看,連手機都可以上網看,對於溫室的掌控度瞬間提高很多。
話不多說,直接看圖吧!
step 1. 先用solidwork設計出外殼模型,因為有光感應器,必須要曬到太陽,但是又有溫度計,照到光會使溫度上升,所以外殼做成垂直型,把光度計放在最上面,溫度計放在最下面,把受光的影響將到最低。
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-5af6bcdbf87039442ea7c740a60c3d91.jpg)
透視圖
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-0ae68c33dbb110fd841deda6988bc94a.jpg)
中間的隔板,用來放置電路板和Arduino版
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-f439c6fcbb016b02fa9229cd9d11e02e.jpg)
step 2. 備料ing,用的是松木板材
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-bd167918acda815033080d0b871b6701.jpg)
跟製材場買的料
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-898ada639bfef056985dd6ce78497d2d.jpg)
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-d04c3c9003fb5c9342ea86c88ae7ef4a.jpg)
Bosch GTS1031:嵌槽,定長都靠這台
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-a870cd59cc3ab002c319464aad26bc56.jpg)
背板嵌槽
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-2f02c2e6451c03292e10f5f0f3de8580.jpg)
側板嵌槽
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-ec6158a80305a7048748198470fcaddd.jpg)
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-91a2e7177a7da0eaf85a273411e46f58.jpg)
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-30ba34284a72cf6d585436f57c2ddffb.jpg)
面板和上檔版
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-780b9a03f0d8556f229f31818a1ddfff.jpg)
線路要穿過的洞,純手工鑿的,功力不夠好

![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-b8d1eb73d0ab3503673f8d0d4970326f.jpg)
全部備好的料
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-722f61f9aacfb8628d5cc376be23dd43.jpg)
step 3. 膠合
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-ebb0e6ff509983aa9eb077ec50671c6f.jpg)
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-c480d486f52bf8db60600b5771d7e4b8.jpg)
step 4. 等膠乾後開始上蠟
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-d01ca12a17c386d29885a18f29e8db9f.jpg)
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-1f369d033861a7c060020658e64cf712.jpg)
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-a1aa38fb77aa2c0decd3215f8ba32bb3.jpg)
step 5. 開始組裝
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-0e102044a3da2ea1dc18aff6162d936e.jpg)
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-fb534129800a27cf3687b1a0abcc7ded.jpg)
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-5449bfe014fd0ea0b4567463b56a5d06.jpg)
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-ecc5e67fc688c45dac5aa628d8624ebd.jpg)
到目前為止外殼就算是完成了
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-26dc6b70954399466b7ae8902c664681.jpg)
接著是比較偏電子的東西,全部都是google慢慢摸索,因為是和arduino相關的電子,所以很好找。
電路圖我沒有用畫圖軟體做layout,而且不複雜,直接跳過。
step 6. 準備電子材料
使用Arduino UNO板
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-48c7cc071e971dc241eae0586b3fb782.jpg)
溫溼度計和光度計
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-8640d4481b2fc72afb434362b7fa3412.jpg)
左到右:光度計,無線網路卡,溫溼度計
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-8705319e7493323e6f8e2ef5b2dd91ae.jpg)
會使用到的工具大合照

![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-75ac40cadbf75dcd81806dd98a1aea03.jpg)
step 7. 開始組裝
用螺絲鎖在木板上
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-d9aeb2e94b7745bf2656320f17d741bf.jpg)
開始接上線路
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-add258d10c94ca5e6abc5e52327185dd.jpg)
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-557ff12460d1fc21a7260c9886a9debf.jpg)
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-963f3b617fe2ef6b3dc0f7f4fe864ec5.jpg)
溫溼度計在最下面
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-54bd74db155033e8bef9023427d4382e.jpg)
最上面裝上請人裁切好的壓克力版
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-f0ae805eee9124bc90cf92e9914e24b6.jpg)
step 8. 安裝韌體
將韌體燒進去,測試各晶片功能有無問題,此時硬體部分就算完成了
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-484069de8be5c6c5bf1710a811c0956e.jpg)
當然Arduino軟體部分也是花費了一些時間在做各function的銜接,尤其是在網路卡的韌體部分花了很多時間
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-72481cee6baf6f4dbb1adcf8ed5a534b.jpg)
step 9. 架設網站
軟體部分是使用https://koding.com/這個平台
好處是裡面可以安裝各種程式語言做編輯,而且可以當server架網站用,PHP也已經內建好了
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-514d79668ef754e967259023ab6154ba.png)
架網站
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-105a4b2e96ccac4c69ad1edd54d0033f.jpg)
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-06747c911330f4b107444717f6ce7f51.jpg)
一切就緒後到現場和wifi分享器做連線測試
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-d2430ed8fdd5c91c72949bb9b904bd60.jpg)
完成!
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-7d09e5764145790ce7a1698d78b8cfea.jpg)
step 10. 現場施工,還是需要用一台無線網路分享器在農場中央,model只需要接電源線
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-3d8dbb62701e35ba0305986a8b6b058b.jpg)
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-239a5483be1cc71d25bf4391bc694c54.jpg)
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-d15a33fab01d0383693788ef76be15ac.jpg)
接下來就可以從網頁上看到搜集到的數據了
這是12月份某日的資料
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-3d116551fc1b84e8d9a3088671095ebd.jpg)
溫度表,中間橘色線條是室外溫度,可以看到為了加溫和降溫的成本非常高
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-4d67535bca67446964c40908fadca2a1.jpg)
溼度表,晚上濕度都很高,白天因為溫度上昇降低相對濕度,以及開風扇的緣故濕度下降
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-c6c6d2bc05384851bb557a5ace560670.jpg)
一日當中的日照程度,有個問題是氣象儀放的擺放位置也會有差異,需要再用光度計校正誤差
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-fe32b42df712a1032fb84f7c5421e995.png)
一日的光累積,用lux轉換成PPFD單位
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-673fdb89a65571db085ba1028a9cb70a.jpg)
12月份每日的光累積,可以和其他溫室或日期做比較
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-42a3e889083d4cda40b89d8e5c84466c.jpg)
12月的累計光累積
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-b3b78fedf2983cd1382f9322a2607bba.jpg)
每日溫差統計表,冷房加降溫的成本非常高
![[DIY]自製物聯網氣象儀分享](http://attach.mobile01.com/attach/201512/mobile01-7c8eb4bf1fb04327c49691e52261c3bd.jpg)
後記:
從一開始的idea開始到做出來前後花了快五個月,當然不是天天做,只是沒想到可以拖這麼久..。
前份工作是在某手機代工廠當工程師,寫code能力算有一定程度,所以軟體部分很快就解決了。
最花時間的應該是外殼的設計到製作。因為木工環境是從零開始做規劃,也研究了很多五金和機構該怎麼設定。
網卡:ESP8266,收訊強度非常好,相隔50m,中間有一道水泥牆和好幾層溫室的塑膠布都可以收到訊號。
溫濕度計:SHT31,精確度很高的溫溼度計,程式上的資料接收也很方便
光度計:BH1750FVI,和專業的光度計做實際比較過,誤差應該在1%上下
板子用 Adruino UNO,原本想用mini版+自己焊電路板,但礙於ESP8266太吃電和自己的焊接功力不夠所以放棄這個方案。
這個裝置做好後就要開始放著收集數據,要數個月後才能跟現場的苗做比較,透過不同的溫室管理看出效果差異。透過數據觀察也可以推理出目前溫室的狀況。
另一個好處是可以及時觀察到溫室狀況,有一次冷氣壞掉時馬上就可以從網站上看到不正常的情況。
這個專案從零開始到成品出來,結束時有一種終於搞定了的感覺

想好好做個記錄,在這邊發文分享給各位~
