Cov txheej txheem:

Chaw Tuav Huab Cua Handheld: 4 Kauj Ruam
Chaw Tuav Huab Cua Handheld: 4 Kauj Ruam

Video: Chaw Tuav Huab Cua Handheld: 4 Kauj Ruam

Video: Chaw Tuav Huab Cua Handheld: 4 Kauj Ruam
Video: Plab Plab Ntswg..(Pluav Pluav Ntswg) Maiv Twm New Song 2023-2024 2024, Hlis ntuj nqeg
Anonim
Qhov Chaw Nres Tsheb Handheld
Qhov Chaw Nres Tsheb Handheld
Chaw Nres Nkoj Handheld
Chaw Nres Nkoj Handheld
Chaw Nres Nkoj Handheld
Chaw Nres Nkoj Handheld

Hauv Cov Lus Qhia no peb yuav siv Arduino, cov duab tso rau pom, thiab SparkFun ib puag ncig lub ntsej muag sib xyaw nrog CCS811 thiab BME280 lub ntsuas pa ntawm lub nkoj los tsim cov cuab yeej siv tes ntsuas qhov ntsuas kub, av noo, TVOC qib, ntsuas ntsuas siab, thiab qib carbon dioxide. Koj tuaj yeem siv ib qho Arduino nrog cov lej muab, tab sis kuv siv SparkFun Qwiic pro micro. Yog tias koj yog tus pib, Kuv qhia koj siv tib seem uas kuv siv, tsuas yog ua kom yooj yim. Kuv xaiv SparkFun Qwiic pro micro board rau nws qhov loj me thiab Qwiic txuas, ua kom yooj yim txuas koj cov khoom siv. Yog tias koj siv lwm lub rooj tsav xwm sib txawv, nco ntsoov yuav lub Qwiic lub kaus mom, phat, lossis ntaub thaiv npog kom haum rau koj lub rooj tsavxwm.

Khoom siv:

  • SparkFun Environmental Combo Breakout -
  • SparkFun Micro OLED Breakout -
  • SparkFun Qwiic Pro Micro -
  • Qwiic Cable, 50mm -
  • Lub thawv ntawv, qhov loj rau koj cov khoom, Kuv siv ib ncig 3 x 2 x 1 -
  • Yeem: Yog tias koj siv Qwiic Pro Micro, koj yuav xav tau usb-c cable (yog tias koj tseem tsis tau muaj) rau lub zog thiab lub cajmeem
  • Qhov rai screen, li 1.5 x 1.5 nti
  • Screws (saib daim duab saum toj no)

Cov Cuab Yeej:

  • Cov kua nplaum kub thiab rab phom kub kub
  • Txiab
  • Rab chais hniav lossis rab riam x-acto, muaj peev xwm txiav los ntawm koj lub thawv ntawv

Kauj ruam 1: Kos thiab Txiav Qhov thiab Muab tso rau hauv Qhov rai Screen

Kos thiab Txiav Qhov thiab Muab tso rau ntawm Qhov rai Screen
Kos thiab Txiav Qhov thiab Muab tso rau ntawm Qhov rai Screen
Kos thiab Txiav Qhov thiab Muab tso rau ntawm Qhov rai Screen
Kos thiab Txiav Qhov thiab Muab tso rau ntawm Qhov rai Screen
Kos thiab Txiav Qhov thiab Muab tso rau ntawm Qhov rai Screen
Kos thiab Txiav Qhov thiab Muab tso rau ntawm Qhov rai Screen

Peb yuav kos cim thiab txiav qhov rau oled, ib puag ncig lub ntsuas pa thiab USB-C txuas rau kev ua haujlwm thiab lub zog.

  1. Kab koj cov khoom nyob qhov twg koj xav tau lawv thiab kos lub qhov ntsia hlau.
  2. Kos cov xwm txheej, rau oled, ib lub xwmfab loj ntawm lub vijtsam thiab rau ib puag ncig lub ntsej muag, ib lub xwmfab loj dua me ntsis uas 2 lub ntsuas (saib cov duab saum toj no).
  3. Kos qhov chaw rau USB-C txuas. Kuv Qwiic Pro Micro board tau headers soldered ntawm nws twb yog li kuv muab tso rau hauv ib daim ua npuas ncauj thiab cim nws. Yog tias koj tsis ua, tso nws tiaj tiaj rau hauv qab ntawm rooj plaub txhawm rau kos lub qhov.
  4. Laum cov cim qhov thiab txiav tawm USB-C txuas. Cov qhov drilled yuav tsum loj txaus kom cia cov ntsia hlau hla mus.
  5. Txiav ib lub xwmfab ntawm lub vijtsam me me loj dua lub qhov rau lub ntsuas. Txiav tawm qhov chaw ntawm lub qhov rai tshuaj ntsuam rau lub qhov ntsia hlau thiab cov ncej teeb tsa (saib cov duab saum toj no).
  6. Kub nplaum lub vijtsam rau hauv qhov chaw.

Kauj Ruam 2: Mount Oled thiab Sensor

Mount Oled thiab Sensor
Mount Oled thiab Sensor
Mount Oled thiab Sensor
Mount Oled thiab Sensor
Mount Oled thiab Sensor
Mount Oled thiab Sensor

Mount lub oled thiab ib puag ncig sensor hauv rooj plaub. Cov ntsia hlau loj mus rau hauv lub qhov uas koj tau tho thiab cov ntsia hlau me nkag mus rau hauv cov kab lus nyob rau hauv ces kaum ntawm rooj plaub hau. Siv cov tshuab ntxhua khaub ncaws rau spacers. Rau cov ntsia hlau loj dua, saib daim duab saum toj no kom pom meej. Tej zaum koj yuav tsum siv ntau dua ib lub tshuab ntxhua khaub ncaws.

Kauj Ruam 3: Mount Arduino thiab Txuas Txuas

Mount Arduino thiab Txuas Txuas
Mount Arduino thiab Txuas Txuas
Mount Arduino thiab Txuas Txuas
Mount Arduino thiab Txuas Txuas
Mount Arduino thiab Txuas Txuas
Mount Arduino thiab Txuas Txuas
  1. Kuv Qwiic Pro Micro board tau headers soldered ntawm nws twb yog li kuv muab tso rau hauv ib qho ua npuas dej thiab ua kom nws qis. Yog tias koj tsis muaj lub taub hau, lo nws rau hauv qab ntawm rooj plaub. Xyuas kom muaj chaw txaus rau Qwiic cable txuas.
  2. Txuas cov khoom siv nrog Qwiic txuas. Tsis yog qhov kev txiav txim lossis ib sab Qwiic txuas yog qhov teeb meem. Saib cov duab saum toj no kom paub meej.
  3. Tam sim no koj tuaj yeem snap koj lub npov qhov project ua ke. Ua kom Qwiic cov xov hluav taws xob tau txuas nrog nruj thiab tsis txhob pinched.

Kauj ruam 4: Code

Txhawm rau kom koj Qwiic pro micro board nce thiab khiav ua raws cov lus qhia no.

Thaum ua tiav lawm, cov cai hauv qab no koj tuaj yeem pom nws ntawm GitHub ntawm no.

#include #include #include #include #define PIN_RESET 9 #txheeb xyuas DC_JUMPER 1 #txhais CCS811_ADDR 0x5B // Default I2C AddressMicroOLED oled (PIN_RESET, DC_JUMPER); CCS811 myCCS811 (CCS811_ADDR); qeeb; Hlau.begin (); oled.begin (); // Pib ua OLED oled.clear (TXHUA); // Tshem cov zaub sab hauv nco oled.display (); // Zaub dab tsi hauv qhov tsis (splashscreen) oled.clear (PAGE); // Tshem qhov tsis. randomSeed (analogRead (A0) + analogRead (A1)); // Initialize BME280 // Rau I2C, ua raws li hauv qab no thiab lov tes taw SPI ntu myBME280.settings.commInterface = I2C_MODE; myBME280.settings. I2CAddress = 0x77; myBME280.settings.runMode = 3; // Hom qub myBME280.settings.tStandby = 0; myBME280.settings.filter = 4; myBME280.settings.tempOverSample = 5; myBME280.settings.pressOverSample = 5; myBME280.settings.humidOverSample = 5; CCS811Core:: CCS811_Status_e returnCode = myCCS811.beginWithStatus (); // Hu rau.begin () ua rau cov chaw teeb tsa mus qeeb (10); // Nco ntsoov tias lub sensor muaj sijhawm txaus los qhib. BME280 xav tau 2ms kom pib. byte id = myBME280.begin (); // Rov qab ID ntawm 0x60 yog tias ua tiav ncua (10000); } tsis muaj nuj nqis print_data () {oled.setFontType (0); oled.setCursor (0, 0); oled.print ("TMP"); oled.setCursor (25, 0); oled.print (puag ncig (myBME280.readTempF ())); oled.setCursor (0, 10); oled.print ("HWM"); oled.setCursor (25, 10); oled.print (puag ncig (myBME280.readFloatHumidity ())); oled.setCursor (0, 20); oled.print ("VOC"); oled.setCursor (25, 20); oled.print (puag ncig (myCCS811.getTVOC ())); oled.setCursor (0, 30); oled.print ("BAR"); oled.setCursor (25, 30); oled.print (puag ncig (myBME280.readFloatPressure ())); oled.setCursor (0, 40); oled.print ("CO2"); oled.setCursor (25, 40); oled.print (puag ncig (myCCS811.getCO2 ())); oled.display (); } void loop () {ncua (2000); // Txheeb xyuas seb puas muaj cov ntaub ntawv yog tias (myCCS811.dataAvailable ()) {// Hu rau txoj haujlwm no hloov kho thoob ntiaj teb tVOC thiab eCO2 hloov pauv myCCS811.readAlgorithmResults (); // printData nqa cov txiaj ntsig ntawm tVOC thiab eCO2 ntab BMEtempC = myBME280.readTempC (); ntab BMEhumid = myBME280.readFloatHumidity (); // Qhov no xa cov ntaub ntawv ntsuas kub mus rau CCS811 myCCS811.setEnvironmentalData (BMEhumid, BMEtempC); } print_data (); cov. ncua (2000); }

Muab tshuaj txhuam cov cai hauv Arduino IDE thiab muab tso ua ke. Lub vijtsam yuav tsum qhia lub cim SparkFun li ob peb feeb, thiab tom qab ntawd pib pom cov xwm txheej nyob. Cov xwm txheej hloov tshiab txhua txhua 2 vib nas this. Ua tsaug rau kev nyeem ntawv.

Tau Txais Lus Nug?

Tawm lus lossis email rau kuv ntawm no

Pom zoo: