新人資訊
技術-開發板 #12-自製PM2.5監測器,精確實用可攜帶
藉由第一個應用「土壤濕度感測器」開啟我的萬物聯網想像,除了搭建雲端協作模式以外,也不斷在尋找第二個應用。sensor 的種類似乎很多,但要找到有價值的應用還是不易。便宜的感測器如溫濕度,一氧化碳,人體,超音波測距,亮度,震動,聲音,傾斜度等等,在網路可找到的絕大多數經驗分享,都是「測通」就結束了,鮮少有人會分享「產品化」的案例,摸到邊都沒有!是的,這本來就是極為困難的工作,沒有絞盡腦汁,費時費工投入資源,怎能做出價值?我甚至覺得,政府和學校推的案子,也沒甚麼實用性,大多是虛張聲勢,真正有價值的應該都是賺錢公司的商業機密吧!要創造價值只有靠自己一點一滴的嘗試錯誤,慢慢累積經驗和實力。
空氣吧,人每時每刻都需要呼吸。一氧化碳和瓦斯不行,這不是我的菜,因為 sensor 可能長年都不會觸發動作,一觸發就是大事;二氧化碳可以,在聚會場合中監控二氧化碳和通風,可以避免與會者昏昏欲睡或精神不濟,只可惜「貴」,兩三千的單價不大適合當入門的實驗題目;PM 2.5?雖然氣象資訊已經很多,也有廠商廣泛佈點,但想起自己要出門跑步時,光看遙遠的觀測點還是不大安心,真的會想要自己測一下周遭環境的空氣狀況!曾經跑一跑覺得不舒服被迫提早結束回家…。對,就是它了,要不要出外運動,在自家陽台的觀測還是最準的,就往這個方向探索吧。
便宜沒好貨是真的,我首先嘗試了兩三百元的 LED 光源型的 sensor,雖然規格上說可以測到 0.8 微米讓我懷抱希望,很辛苦的接線,找程式寫法,輸出的電壓值還要自行轉換為灰塵量,其中還要調參數,搞了好久之後終於完成,結果 0, 0, 0, 0, …,參數難調又不精確已經很不妙了,連門檻值都很難達到,可能要火災或沙塵暴才會感應吧!只好宣告失敗,以下設備也成為電子垃圾 :(
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
接著找到「雷射激光散射原理」的機型,用甚麼米式理論算法原理我並未深究,只知很顯然精確度高多了,提高預算到接近千元,可以輸出區分 PM 1, 2.5, 10 等數據,實測後效果良好,市面上也有許多消費級產品價位大約會在 2000 以上,代表此研究具有一定的市場價值,找到原廠連結如下:http://www.plantower.com/content/?97.html
先搞定接線問題,這產品看起來的第一印象非常輕薄短小頗有好感,無奈為了接線讓我傷透腦筋,實在不懂為何不把接頭設計的通用一點,或是直接拉出線來,畢竟一個測量空氣的 sensor 不可能鎖在裝置盒子裡面,一定要拉出來接觸空氣,那麼一個轉接版到底要怎麼用!難道設計產品的人只想著在實驗室裡用嗎?網路搜尋這種接頭也無結果,真是超白癡的。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
接線算簡單,兩條接地和 5V 電源是基本的,再接一條 Sensor 的 TX 端到主板的任何一個 Digital In,我是接 D1,此端點將用軟體模擬成 Serial Receive。程式也非常簡單,這函式庫是專為此廠牌製作的非常好用。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
感測資料已經正確產生,那該如何檢視呢?可以用我的儲備技術:透過主機板本身的小型 Web,或是丟到雲端再從網頁顯示!但問題來了,這些顯示方式是適用在「長期監控,觀察趨勢」的情境下,若使用者準備出去運動時需要即時檢測一下周邊環境,還要開網頁那豈不很煩?所以我需要設計一個顯示裝置。先前試過的 1602 I2C LCD 實在是太大太笨重很難看,所以我又去找到這個嵌在主板的小巧可愛的 OLED 顯示器;只是廠商很壞心沒有焊接腳,我也首度拿起電烙鐵硬著頭皮做下去,果然每個焊點都跟狗啃的一樣醜到爆!唉,手工藝還是不及格。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
接下來又一陣尋尋覓覓 OLED 的用法,細節就不多說了,參考這篇大概就夠了:https://www.twblogs.net/a/5d0b252ebd9eee1ede0409b9 最後發揮創意運用手邊資源創造出還可以看的最終產品。看到這個接線應該就能體會我前面罵的原因吧,我被迫把外殼開一個大洞。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
插個一般手機用的行動電源,擺在家裡或帶到戶外都很方便。我準備帶著去騎腳踏車,了解哪些路段或何時的空氣不好,可以因應調整自己運動的習慣。你說,是不是很有用?
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
此裝置可以攜帶也可以固定放在家中陽台或庭院長期監控,除了每五秒更新資訊在這個小 OLED 以外,也可在有聯網能力時每小時保留一筆數據在雲端,長期關心自己的居住環境,真是超棒的,差不多就是一個產品了啦,哈哈。可知目前已經一生二了,再來就是二生三,三就要生萬物了!
By Newman Chen 2022/5/19
後記,2022/6/5 小改款,PMS 7003 改成 PMS 5003,因接線較穩固;另外 LED 改成外接 SSD1306。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
參考資料
https://www.twblogs.net/a/5d0b252ebd9eee1ede0409b9