Cov txheej txheem:

Particle Powered Air Quality Monitor: 7 Kauj Ruam
Particle Powered Air Quality Monitor: 7 Kauj Ruam

Video: Particle Powered Air Quality Monitor: 7 Kauj Ruam

Video: Particle Powered Air Quality Monitor: 7 Kauj Ruam
Video: Your home's air could be making you sick. Fight back! 2024, Kaum ib hlis
Anonim
Particle Powered Air Quality Monitor
Particle Powered Air Quality Monitor

Huab cua zoo.

Tej zaum koj yuav xav txog nws ntau dua tam sim no tias peb cov huab cua huv tau hloov mus ua huab cua tas mus li thoob ntuj.

Yug.

Ib yam uas koj tau tswj hwm yog huab cua zoo hauv koj lub tsev. Hauv qhov kev qhia no, Kuv yuav qhia koj yuav tsim lub ntsuas cua zoo li cas hauv ob peb kauj ruam luv luv.

Kauj Ruam 1: Sau cov khoom

Sau cov khoom
Sau cov khoom

Tau txais txhua yam ua ke uas koj xav tau rau txoj haujlwm no.

Qhov no suav nrog:

  • Ib pawg Board Mesh (Argon, Boron, Xenon). Koj tuaj yeem tau txais lawv yuav luag txhua qhov chaw. Yuav ncaj qha ib txwm ua haujlwm ib yam nkaus.
  • Particle^2 Huab Cua Zoo Sensor.
  • Honeywell HPMA115S0 Particle Sensor.
  • Cable rau HPMA115S0 Sensor. (Peb qhov kawg koj tuaj yeem tau ntawm no.)

Kauj Ruam 2: Sib Sau Ua Ke

Sib Sau Ua Ke
Sib Sau Ua Ke
Sib Sau Ua Ke
Sib Sau Ua Ke
Sib Sau Ua Ke
Sib Sau Ua Ke
  1. Muab cov Particle tso rau hauv Particle^2 board
  2. Txuas lub HPM Particle sensor mus rau Particle^2 siv lub cable
  3. Txuas rau hauv USB!

Kauj Ruam 3: Kho Google Docs - Tsim Tsab Ntawv

Kho Google Docs - Tsim Tsab Ntawv
Kho Google Docs - Tsim Tsab Ntawv
  1. Tsim Google Daim Ntawv Tshiab
  2. Tom qab ntawv nyem rau Cov cuab yeej ntawv qhia zaub mov thiab nyem Script Editor
  3. Tsim ib tsab ntawv tshiab
  4. Ntxig cov cai hauv qab no rau hauv tsab ntawv:

// qhov no yog txoj haujlwm uas tua thaum lub webapp tau txais POST thov ua haujlwm doPost (e) {

// Rov qab yog null

yog (e == tsis tau txhais) {Logger.log (“tsis muaj cov ntaub ntawv”); rov qab HtmlService.createHtmlOutput ("xav tau cov ntaub ntawv"); }

// Txheeb cais cov ntaub ntawv JSON

var kev tshwm sim = JSON.parse (e.postData.contents); var cov ntaub ntawv = JSON.parse (event.data);

// Tau txais kab kawg yam tsis muaj cov ntaub ntawv

var ntawv = SpreadsheetApp.getActiveSheet (); var lastRow = Math.max (sheet.getLastRow (), 1); sheet.insertRowAfter (lastRow);

// Tau txais lub sijhawm tam sim no

var timestamp = Hnub Tshiab ();

// Ntxig cov ntaub ntawv rau hauv daim ntawv

sheet.getRange (lastRow + 1, 1).setValue (event.published_at); sheet.getRange (lastRow + 1, 2).setValue (data.temperature); sheet.getRange (lastRow + 1, 3).setValue (data.humidity); sheet.getRange (lastRow + 1, 4).setValue (data.pm10); sheet.getRange (lastRow + 1, 5).setValue (data.pm25); sheet.getRange (lastRow + 1, 6).setValue (data.tvoc); sheet.getRange (lastRow + 1, 7).setValue (data.c02);

SpreadsheetApp.flush ();

rov qab HtmlService.createHtmlOutput ("xa ntawv thov tau txais"); }

Kauj ruam 4: Kho Google Docs - Kho lub Webhook

Kho Google Docs - Kho lub Webhook
Kho Google Docs - Kho lub Webhook

Tom qab ntawd,

  1. Mus rau Publish thiab nyem Deploy li Web App
  2. Teem Execute app li koj tus kheej
  3. Tom qab teeb tsa Leej twg nkag mus rau lub app rau leej twg, txawm tias tsis qhia npe. (Tseem ceeb: yog tias koj tab tom ua haujlwm nrog. Lub hom phiaj tseem ceeb cov ntaub ntawv, koj yuav xav tau qhov muaj zog dua thiab kev daws teeb meem. Qhov no tso cai rau leej twg, yog tias lawv muaj koj lub vev xaib txuas txuas rau tshaj tawm cov ntaub ntawv rau nplooj ntawv ntawd!)
  4. Hloov qhov Project Version mus rau tshiab thiab xa tawm!
  5. Luam theej Tam Sim No App URL uas tso tawm.

Kauj Ruam 5: Txhim Kho Cov Huab Huab

Kho cov Particle Cloud
Kho cov Particle Cloud
  1. Hauv Particle.io console, mus rau ntu Kev Sib Koom thiab Tsim Webhook tshiab
  2. Sau lub npe ntawm qhov xwm txheej uas tau xa mus los ntawm cov cai (hauv qhov no nws yog blob)
  3. Nkag mus rau Tam Sim No App URL los ntawm cov kauj ruam kawg hauv URL Box
  4. Teem hom kev thov rau POST
  5. Teeb daim ntawv thov rau JSON
  6. Lub hom phiaj ntaus ntawv koj yuav siv (lossis tso nws zoo li yog tias koj tsuas muaj ib lub cuab yeej)
  7. Nyem tseg

Kauj Ruam 6: Ua Haujlwm Pab Pawg

Program Pawg Thawj Coj
Program Pawg Thawj Coj
  1. Teeb tsa koj tus account Particle thiab Cov Khoom Siv Mesh. Siv Quickstart yog tias koj tsis tau ua qhov no ua ntej.
  2. Rub tawm Particle Workbench thiab nruab yog tias koj tsis tau ua dua. Cov lus qhia ntawm no.
  3. Tau txais cov cai ntawm no.
  4. Thaum cov lej tau rub tawm, qhib nws nrog Visual Code (uas koj tau teeb tsa hauv Kauj Ruam 1)
  5. Nkag mus rau Particle yog tias koj tsis tau ua dua (Txoj kev nrawm tshaj plaws yog ntaus Command + Shift + P kom qhib lub qhov rai hais kom ua. Tom qab ntawd pib ntaus tus ID nkag mus)
  6. Tshaj tawm rau Huab Huab - Ib zaug ntxiv qhov no siv lub qhov rai hais kom ua. Siv tib Command + Shift + P raws li saud thiab ntaus Cloud Flash.
  7. Thaum koj tau pom qhov Cloud Flash xaiv, nyem nkag mus.
  8. Koj lub rooj tsavxwm yuav tsum tau teem sijhawm sai. Koj tuaj yeem saib cov LEDs rau kev hloov pauv lub sijhawm no. Thaum nws ci ntsa iab xiav, koj zoo mus!

Kauj Ruam 7: Kos Txhua Yam

Duab Txhua Yam
Duab Txhua Yam
Duab Txhua Yam
Duab Txhua Yam
  1. Hauv Google daim ntawv koj tuaj yeem tsim lub taub hau hauv thawj kab nrog txhua daim ntawv lo. (Saib qhov screenshot saum toj no)
  2. Koj yuav tsum pom los ntawm tam sim no cov ntaub ntawv tshiab tau tshwm sim hauv daim ntawv (yog tias koj teeb tsa txhua yam kom raug). Rov qab mus rau cov kauj ruam dhau los yog tias koj tsis pom nws.
  3. Koj tuaj yeem teeb cov ntaub ntawv los ntawm xaiv ib kab ntawv tag nrho thiab tsim daim ntawv tshiab los ntawm nws.
  4. Koj tuaj yeem teeb txhua yam hauv ib lossis cais raws li kuv tau ua tiav saum toj no.

Yog tias txhua yam ua haujlwm thiab koj muaj qee cov duab zoo nkauj, zoo siab !! Yog tias koj npaj txhij txav mus rau kauj ruam tom ntej siv IoT cov kev pabcuam zoo li Adafruit txheeb xyuas kuv phau ntawv qhia tag nrho ntawm no.

Pom zoo: