:::
PM2.5空污監測器實作

關於本次研習,大家有沒有甚麼想法或意見呢?

discuss pic 2016-07-20 20:17:11
有想到甚麼就提出來喔!^^
discuss pic 2016-07-25 08:28:08
7/22實作研習順利完成,感謝大家的幫忙,場地收拾得很乾淨,希望下次能夠有類似的課程再來一起maker一下
上完課發現講義有很多地方要補充:
0. 材料採購與前置作業
    淘寶購物方式
    材料預先分配
    杜邦母頭與排針連接時,需角度一致
    Sharp感測器杜邦母頭,壓接難度高,需預先製作
2. 各元件接腳數量與用途,可用Fritzing程式說明
3. ardublock說明
4. Sharp感測器測試、4LED、DHT22等,測試程式說明
6. 感測器final程式說明,錯誤樣態說明,除錯
    一開始出現fail,為esp8266接線錯誤
    9v電池電流不足,無法驅動整個感測器
8. 中間下課休息時間安排....sorry,有點趕,沒注意到
完成之後會再請大家幫忙看看,若還有哪些不足的地方,也請留言,感謝您。

discuss pic 2016-07-25 14:30:02
網頁的PM2.5濃度判斷程式好像有誤喔!?
比如PM2.5濃度為35.3時,依照指標對照,應該為第三級深綠色,但卻判斷為第四級黃色,可否查查看,謝謝。
discuss pic 2016-07-25 20:37:43
收到!可能設定判斷敘述有缺漏,明天修改完再跟大家報告,感謝李老師的協助。
discuss pic 2016-07-30 05:42:01
如果還有老師研習後回家無法上線的,小弟這裡分享一下方式(摸索了快一個小時才搞定)
1.安裝arduino程式
2.將下載的檔案(ardublock-beta-20140828.jar)放到arduino資料夾中 (X86),tools/ArduBlockTool/tool 的資料內即可,如果原先沒有的資料夾,要自行建立出來(大小寫要相符)-----這一步驟我有做,不過不知道要不要做,請老師解惑一下。
3.下載 DHT22的程式庫(這一部分沒有做,第三步驟arduino程式會出現錯誤)

DHT22的程式庫需另外下載,請在Arduino IDE程式的[草稿碼]→[匯入程式庫]→[管理程式庫...]

搜尋DHT22,點選,安裝

4.修改(LED4_Buzzer_DHT22_ESP8266_Relay_air2_sample)(本來以為還要插上USB修改wifi模組來更改網路設定,後來發現只要改這個sample檔就好,走了好多冤枉路)
改網路、更新時間,上傳時記得麵包版斷電
discuss pic 2016-07-30 14:18:57
彥文老師超棒的!感謝你提供寶貴經驗

真不好意思,第二步驟的Ardublock其實是可以不用做的,是想要讓老師們體驗像Scratch一樣用積木來寫程式,當然不可能整個pm2.5程式都用Ardublock,只是想帶大家寫一下Blink
執行方法如下圖


Ardublock操作畫面,自己拉出Blink範例程式


我會再把內容補充到講義上面,大家可以想想如何用在教學喔!
discuss pic 2016-08-03 22:18:11
學校經緯度座標要怎麼輸入呢?
discuss pic 2016-08-04 07:17:29
有源蜂鳴器只需要HIGH或LOW,只能叫或不叫,pitch.h可以省略
若要用pitch.h發出音階聲音應該用無源蜂鳴器
discuss pic 2016-08-04 23:08:36
宏儒老師好
請參考新錄製的「用Google Map取得GPS座標」教學影片,有字幕喔!要自行點下方的字幕按鈕。麻煩參考一下。

discuss pic 2016-08-04 23:41:03
宇男老師
真是高手,感謝您的分享,有查到一些相關資料
discuss pic 2016-08-05 00:38:09
程式已經設定好String PMgps = "23.065177, 120.197872";   //學校經緯度座標

可是出現下面狀況:

SEND: AT
RECEIVED: OK after AT Command
Data ready to sent!
Send AT+CWMODE=1
SEND: AT+CWJAP="TN-Computer-bridge","computer123"
Waiting for 15 second to connect network .....
SEND: AT+ CIPMUX=0
SEND: AT+CIPSTART="TCP","pm25.tn.edu.tw",80
SEND: AT+CIPSEND=93
>GET /xoops/api.php?schoolcode=213634&no=0&pm25=6.84&t=30.50&h=32.40&gps=23.065156120.197861
RECEIVED: OK

怎麼還是23.065156120.197861
逗號不見了

回檢測網看學校數值~經緯度也沒出現
discuss pic 2016-08-05 00:48:16
確定一下,有沒有真的改到,有沒有確實上傳,會不會前面有兩條斜線// ?
discuss pic 2016-08-05 01:38:38
修改成功了!!謝謝盛南老師^_^

搜尋

錯誤訊息
未知: Array and string offset access syntax with curly braces is deprecated 在檔案中的第 /include/functions.encoding.php 列 40
未知: Array and string offset access syntax with curly braces is deprecated 在檔案中的第 /include/functions.encoding.php 列 40
未知: Array and string offset access syntax with curly braces is deprecated 在檔案中的第 /include/functions.encoding.php 列 73
通知: Undefined index: theme_kind 在檔案中的第 /modules/tad_discuss/header.php 列 8
未知: Function get_magic_quotes_gpc() is deprecated 在檔案中的第 /class/libraries/vendor/xoops/xmf/src/Request.php 列 119
未知: Function get_magic_quotes_gpc() is deprecated 在檔案中的第 /class/libraries/vendor/xoops/xmf/src/Request.php 列 119
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 57
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 63
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 57
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 63
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 57
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 63
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 57
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 63
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 57
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 63
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 57
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 63
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 57
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 63
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 57
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 63
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 57
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 63
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 57
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 63
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 57
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 63
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 57
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 63
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 57
通知: Undefined index: op 在檔案中的第 /modules/tad_discuss/function.php 列 63
通知: Undefined index: bootstrap 在檔案中的第 /modules/tadtools/preloads/core.php 列 68
已棄用
資料庫語法
0.000096 - SET SQL_BIG_SELECTS = 1
0.000775 - SELECT * FROM config WHERE (`conf_modid` = '0' AND `conf_catid` = '1') ORDER BY conf_order ASC
0.000263 - SELECT sess_data, sess_ip FROM session WHERE sess_id = 'sqlvd4bhnttuvvcbakt437eui1'
0.000288 - SELECT * FROM modules WHERE dirname = 'tad_discuss'
0.000595 - SELECT COUNT(*) FROM group_permission WHERE (`gperm_modid` = '1' AND (`gperm_groupid` = '3') AND `gperm_name` = 'module_read' AND `gperm_itemid` = '13')
0.000390 - SELECT * FROM config WHERE (`conf_modid` = '13') ORDER BY conf_order ASC
0.000530 - SELECT * FROM config WHERE (`conf_modid` = '0' AND `conf_catid` = '5') ORDER BY conf_order ASC
0.000269 - SELECT COUNT(*) FROM banner
0.000223 - SELECT * FROM banner LIMIT 0, 1
0.005662 - UPDATE banner SET impmade = 1277668 WHERE bid = 1
0.000313 - SELECT * FROM config WHERE (`conf_modid` = '0' AND `conf_catid` = '3') ORDER BY conf_order ASC
0.001402 - SELECT DISTINCT gperm_itemid FROM group_permission WHERE gperm_name = 'block_read' AND gperm_modid = 1 AND gperm_groupid IN (3)
0.001048 - SELECT b.* FROM newblocks b, block_module_link m WHERE m.block_id=b.bid AND b.isactive=1 AND b.visible=1 AND m.module_id IN (0,13) AND b.bid IN (1,2,3,4,5,6,7,8,9,10,11,18,15,16,20,19,58,60,61,73,72,74,71,76,75,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,111,109,110,112,113,114,115,116,117,118,119,120,121,122,123) ORDER BY b.weight, m.block_id
0.000598 - SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (`tpl_tplset` = 'default' AND `tpl_file` = 'system_block_search.tpl') ORDER BY tpl_refid
0.000410 - SELECT * FROM modules WHERE dirname = 'tadtools'
0.000444 - SELECT * FROM config WHERE (`conf_modid` = '4') ORDER BY conf_order ASC
0.000366 - select * from tad_discuss where DiscussID='1'
0.000429 - SELECT COUNT(*) FROM group_permission WHERE (`gperm_modid` = '13' AND (`gperm_groupid` = '3') AND `gperm_name` = 'forum_read' AND `gperm_itemid` = '1')
0.005634 - update tad_discuss set `Counter`=`Counter`+1 where `DiscussID`='1'
0.000375 - select * from `tad_discuss_board` where `BoardID` = '1'
0.000532 - select * from tad_discuss where DiscussID='1' or ReDiscussID='1' order by ReDiscussID , DiscussDate
0.000379 - select * from tad_discuss where DiscussID='1' or ReDiscussID='1' order by ReDiscussID , DiscussDate LIMIT 0, 20
0.000281 - SELECT * FROM smiles
0.000372 - SELECT * FROM users WHERE uid = '2'
0.000367 - select * from `tad_discuss_files_center` where `col_name`='DiscussID' and `col_sn`='1' order by sort
0.000278 - select * from `tad_discuss_files_center` where `col_name`='DiscussID' and `col_sn`='2' order by sort
0.000263 - SELECT * FROM users WHERE uid = '5'
0.000229 - select * from `tad_discuss_files_center` where `col_name`='DiscussID' and `col_sn`='3' order by sort
0.000283 - select * from `tad_discuss_files_center` where `col_name`='DiscussID' and `col_sn`='4' order by sort
0.000234 - SELECT * FROM users WHERE uid = '7'
0.000293 - select * from `tad_discuss_files_center` where `col_name`='DiscussID' and `col_sn`='9' order by sort
0.000240 - select * from `tad_discuss_files_center` where `col_name`='DiscussID' and `col_sn`='10' order by sort
0.000235 - SELECT * FROM users WHERE uid = '11'
0.000221 - select * from `tad_discuss_files_center` where `col_name`='DiscussID' and `col_sn`='16' order by sort
0.000343 - SELECT * FROM users WHERE uid = '12'
0.000229 - select * from `tad_discuss_files_center` where `col_name`='DiscussID' and `col_sn`='17' order by sort
0.000228 - select * from `tad_discuss_files_center` where `col_name`='DiscussID' and `col_sn`='23' order by sort
0.000232 - select * from `tad_discuss_files_center` where `col_name`='DiscussID' and `col_sn`='25' order by sort
0.000240 - select * from `tad_discuss_files_center` where `col_name`='DiscussID' and `col_sn`='26' order by sort
0.000460 - select * from `tad_discuss_files_center` where `col_name`='DiscussID' and `col_sn`='28' order by sort
0.000267 - select * from `tad_discuss_files_center` where `col_name`='DiscussID' and `col_sn`='30' order by sort
0.000432 - SELECT COUNT(*) FROM group_permission WHERE (`gperm_modid` = '13' AND (`gperm_groupid` = '3') AND `gperm_name` = 'forum_post' AND `gperm_itemid` = '1')
0.000358 - select `tt_theme`,`tt_use_bootstrap`,`tt_bootstrap_color`,`tt_theme_kind` from `tadtools_setup` where `tt_theme`='school2015'
0.000652 - SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (`tpl_tplset` = 'default' AND `tpl_file` = 'tad_discuss_discuss.tpl') ORDER BY tpl_refid
0.000522 - SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (`tpl_tplset` = 'default' AND `tpl_file` = 'tad_discuss_bootstrap.tpl') ORDER BY tpl_refid
0.000543 - SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (`tpl_tplset` = 'default' AND `tpl_file` = 'system_notification_select.tpl') ORDER BY tpl_refid
0.000245 - SELECT * FROM modules WHERE dirname = 'tad_themes'
0.000293 - SELECT * FROM config WHERE (`conf_modid` = '3') ORDER BY conf_order ASC
0.000186 - select `tt_bootstrap_color` from tadtools_setup where `tt_theme`='school2015'
0.000308 - select * from tad_themes where `theme_name`='school2015'
0.000281 - select conf_value from config where conf_title ='_MD_AM_DEBUGMODE'
0.000242 - select * from tad_themes_blocks where `theme_id`='7'
0.000236 - select mid from modules where dirname='tad_themes'
0.000455 - desc `tad_themes_data_center` `sort`
0.000144 - select `col_sn`,`data_name`,`data_sort`, `data_value` from `tad_themes_data_center` where `mid`= '3' and `col_name`='theme_id' and `col_sn`='7' order by `sort` , `data_sort`
0.000186 - select conf_value from config where conf_name ='allow_register'
0.000313 - select `mid`, `name`, `dirname` from modules where isactive='1' and hasmain='1' and weight!=0 order by weight
0.000171 - SELECT * FROM modules WHERE dirname = 'tad_blocks'
0.000213 - select conf_value from config where conf_title ='_MD_AM_DEBUGMODE'
0.000191 - select count(*) from priv_msgs where `to_userid` ='0' and `read_msg`=0 group by `to_userid`
0.000401 - select `menuid`, `itemname`, `itemurl`, `target`, `icon`, `link_cate_name`, `link_cate_sn`, `read_group` from tad_themes_menu where of_level='0' and status='1' order by position
0.000173 - select `menuid`, `itemname`, `itemurl`, `target`, `icon`, `link_cate_name`, `link_cate_sn`, `read_group` from tad_themes_menu where of_level='11' and status='1' order by position
0.000152 - select `menuid`, `itemname`, `itemurl`, `target`, `icon`, `link_cate_name`, `link_cate_sn`, `read_group` from tad_themes_menu where of_level='14' and status='1' order by position
0.000142 - select `menuid`, `itemname`, `itemurl`, `target`, `icon`, `link_cate_name`, `link_cate_sn`, `read_group` from tad_themes_menu where of_level='15' and status='1' order by position
0.000162 - select `menuid`, `itemname`, `itemurl`, `target`, `icon`, `link_cate_name`, `link_cate_sn`, `read_group` from tad_themes_menu where of_level='17' and status='1' order by position
0.000142 - select `menuid`, `itemname`, `itemurl`, `target`, `icon`, `link_cate_name`, `link_cate_sn`, `read_group` from tad_themes_menu where of_level='16' and status='1' order by position
0.000137 - select `menuid`, `itemname`, `itemurl`, `target`, `icon`, `link_cate_name`, `link_cate_sn`, `read_group` from tad_themes_menu where of_level='18' and status='1' order by position
0.000432 - select a.* from tad_themes_files_center as a left join tad_themes as b on a.col_sn=b.theme_id where a.`col_name`='slide' and b.`theme_name`='school2015'
0.000219 - SELECT * FROM modules WHERE dirname = 'tad_login'
0.000338 - SELECT * FROM config WHERE (`conf_modid` = '14') ORDER BY conf_order ASC
總計: 70
區塊
搜尋: 沒有快取
總計: 1
額外資訊
包含檔案: 216 檔案
使用記憶體: 7211760 bytes
計時
XOOPS 使用 0.167 秒來載入。
XOOPS Boot 使用 0.033 秒來載入。
Module init 使用 0.011 秒來載入。
XOOPS output init 使用 0.037 秒來載入。
Module display 使用 0.047 秒來載入。
Page rendering 使用 0.038 秒來載入。