Cov txheej txheem:

Kev cuam tshuam kev nkag siab, SPS-30, Particulate Matter Sensor Nrog Arduino Duemilanove Siv I2C Hom: 5 Kauj Ruam
Kev cuam tshuam kev nkag siab, SPS-30, Particulate Matter Sensor Nrog Arduino Duemilanove Siv I2C Hom: 5 Kauj Ruam

Video: Kev cuam tshuam kev nkag siab, SPS-30, Particulate Matter Sensor Nrog Arduino Duemilanove Siv I2C Hom: 5 Kauj Ruam

Video: Kev cuam tshuam kev nkag siab, SPS-30, Particulate Matter Sensor Nrog Arduino Duemilanove Siv I2C Hom: 5 Kauj Ruam
Video: DAILY TOP NEWS UPDATE - * - NYIAJ $1400, P-EBT-FOOD STAMP - XOV XWM HNUB HNUB 02/22/2021 2024, Hlis ntuj nqeg
Anonim
Kev cuam tshuam kev nkag siab, SPS-30, Particulate Matter Sensor Nrog Arduino Duemilanove Siv I2C Hom
Kev cuam tshuam kev nkag siab, SPS-30, Particulate Matter Sensor Nrog Arduino Duemilanove Siv I2C Hom
Kev cuam tshuam kev nkag siab, SPS-30, Particulate Matter Sensor Nrog Arduino Duemilanove Siv I2C Hom
Kev cuam tshuam kev nkag siab, SPS-30, Particulate Matter Sensor Nrog Arduino Duemilanove Siv I2C Hom

Thaum kuv tab tom saib mus rau cuam tshuam nrog SPS30 cov cim, kuv pom tau tias feem ntau cov peev txheej yog rau Raspberry Pi tab sis tsis ntau rau Arduino. Kuv siv sijhawm me ntsis los ua lub sensor ua haujlwm nrog Arduino thiab kuv txiav txim siab tshaj tawm kuv qhov kev paub ntawm no kom nws tuaj yeem muaj txiaj ntsig zoo rau lwm tus neeg siv. Lub interface yog ib qho yooj yim heev, tsis tas yuav siv cov laug yog tias koj muaj kab ntawv raug. Koj tsuas yog ntsaws hauv tsib tus coj mus rau Arduino pawg thawj coj los ua kom lub sensor ua haujlwm. Tsis tas li cov tsev qiv ntawv twb muaj lawm.

Tom qab koj sau cov khoom sib xyaw, ua tib zoo tshuaj xyuas thiab saib seb cov kab hluav taws xob, txuas txuas, thiab lwm yam koj muaj. Hauv qhov haujlwm no kuv ua raws I2C hom kev sib txuas.

Khoom siv

  • SPS30 Sensirion Particulate Matter Sensor thiab cov txuas txuas Kuv tau txais kuv ntawm no.
  • Arduino Duemilanove (txhua hom Arduino yuav tsum ua haujlwm tsuav koj txiav txim siab SCL thiab SDA pins)
  • USB cable rau Arduino

Kauj Ruam 1: Txuas Koj Lub Sensor mus rau Arduino rau I2C Hom

Txuas koj lub Sensor rau Arduino rau I2C Hom
Txuas koj lub Sensor rau Arduino rau I2C Hom
Txuas koj lub Sensor rau Arduino rau I2C Hom
Txuas koj lub Sensor rau Arduino rau I2C Hom
Txuas koj lub Sensor rau Arduino rau I2C Hom
Txuas koj lub Sensor rau Arduino rau I2C Hom
Txuas koj lub Sensor rau Arduino rau I2C Hom
Txuas koj lub Sensor rau Arduino rau I2C Hom

Txhua Arduino yuav muaj kev sib txuas sib txawv. Raws li kuv tau hais ua ntej, Kuv siv hom I2C (tsis yog UART). Lub sensor tuaj yeem ncaj qha los ntawm Arduino's 5V tus pin.

Ua cov kev sib txuas raws li qhia hauv kab lus. Rau Duemilanove tus pin yog (raws li qhia hauv daim duab):

SDA ADC 4

ADL SCL 5

Nco ntsoov tias SPS30's Pin 4 ("Interface select") txuas nrog GND, ntawm lub zog-nce ntawm lub sensor, txwv tsis pub lub sensor ua haujlwm hauv UART hloov I2C hom thiab tus tsav tsheb no yuav tsis pom lub ntsuas.

Kauj Ruam 2: Nruab Tsev Qiv Ntawv rau Koj Arduino IDE

Kuv ua raws cov lus qhia ntawm no:

Cov lus qhia teeb tsa tsev qiv ntawv

Kauj Ruam 3: Txoj Haujlwm

Ib zaug ntxiv tsuas yog ua raws cov lus qhia rau kev siv:

Pab

Txoj haujlwm siv yog sps30.ino cov ntaub ntawv los ntawm Github site.

Kauj Ruam 4: Plotting Output

Yog tias koj tsis ua dab tsi, qhov kev zov me nyuam tuaj yeem pom tso tawm hauv cov ntawv xov xwm.

Kuv sim npaj nws thawj zaug, los ntawm kev kho qhov program yooj yim ua rau cov kab hais tseg.

Kauj Ruam 5: Txheeb Xyuas Qhov Teeb Meem

Tsuas yog hloov kab thiab teeb nws rov qab rau cov saib. Tau kawg, txhua lub sijhawm koj xav tau xa koj cov cai nrog hloov tshiab.

Pom zoo: