Cov txheej txheem:

Tsim kom muaj Lub Tsev IoT Huab Cua Zoo Sensor Tsis Muaj Huab Cua Xav Tau: 10 Kauj Ruam
Tsim kom muaj Lub Tsev IoT Huab Cua Zoo Sensor Tsis Muaj Huab Cua Xav Tau: 10 Kauj Ruam

Video: Tsim kom muaj Lub Tsev IoT Huab Cua Zoo Sensor Tsis Muaj Huab Cua Xav Tau: 10 Kauj Ruam

Video: Tsim kom muaj Lub Tsev IoT Huab Cua Zoo Sensor Tsis Muaj Huab Cua Xav Tau: 10 Kauj Ruam
Video: Tsis Tau Txaus Koj | Kong Chue (Official Music Video) 2024, Hlis ntuj nqeg
Anonim
Tsim kom muaj Lub Tsev IoT Cua Zoo Sensor Tsis Muaj Huab Cua Xav Tau
Tsim kom muaj Lub Tsev IoT Cua Zoo Sensor Tsis Muaj Huab Cua Xav Tau
Tsim kom muaj Lub Tsev IoT Cua Zoo Sensor Tsis Muaj Huab Cua Xav Tau
Tsim kom muaj Lub Tsev IoT Cua Zoo Sensor Tsis Muaj Huab Cua Xav Tau
Tsim kom muaj Lub Tsev IoT Cua Zoo Sensor Tsis Muaj Huab Cua Xav Tau
Tsim kom muaj Lub Tsev IoT Cua Zoo Sensor Tsis Muaj Huab Cua Xav Tau
Tsim kom muaj Lub Tsev IoT Cua Zoo Sensor Tsis Muaj Huab Cua Xav Tau
Tsim kom muaj Lub Tsev IoT Cua Zoo Sensor Tsis Muaj Huab Cua Xav Tau

Qhov zoo ntawm huab cua sab hauv lossis sab nraum zoov nyob ntawm ntau qhov chaw muaj kuab paug thiab los ntawm huab cua.

Cov cuab yeej no ntes qee qhov ib txwm muaj thiab qee qhov tsis txaus ntseeg tshaj plaws los ntawm kev siv 2 lub cim ntiv tes.

  • Kub
  • Vaum
  • Siab
  • Cov Pa Roj
  • Micro-Particles

Cov cuab yeej siv ntawm no yog BME680 kom tau txais qhov kub thiab txias, siab thiab qhov tseem ceeb ntawm cov pa roj carbon monoxide thiab PMS5003 kom tau txais qhov ntom ntawm cov khoom me me.

Los ntawm kev siv HomeDing lub tsev qiv ntawv nws yooj yim los tsim cov khoom siv uas txuas nrog koj lub Tsev Network nkaus xwb thiab tuaj yeem ncav cuag thiab tswj tau los ntawm ib lub browser hauv lub network. Nws los nrog xaiv ntawm Cov ntsiab lus uas tso cai siv cov khoom siv ntau tshaj plaws, cov cuab yeej thiab lwm yam kev pabcuam.

Nws kuj tseem ua tiav qhov kev daws teeb meem rau kev tuav lub vev xaib sab hauv sab hauv lub cuab yeej siv tsis siv huab raws kev daws teeb meem los tso saib cov ntaub ntawv ntsuas thiab cuam tshuam nrog lub cuab yeej.

Khoom siv

Txhua yam koj xav tau los tsim txoj haujlwm no yog ESP8266 raws lub rooj tsavxwm zoo li nodemcu pawg thawj coj thiab teeb tsa lub ntsuas ntsuas ntsuas huab cua zoo. Tsev qiv ntawv HomeDing siv hauv txoj haujlwm no txhawb qee yam ntawm cov khoom siv sib xws rau qhov kub, av noo, siab thiab zoo. Nov yog siv BMP680 nti.

  • USB ntsaws thiab lub micro-usb cable rau lub hwj chim.
  • 1 nodemcu board nrog ESP8266 CPU.
  • 1 BME680 sensor tawg pawg thawj coj saib.
  • 1 PM2.5 huab cua particle laser sensor hom PMS5003

Nws yog qhov yooj yim los pauv lub BME680 sensor nrog DHT22 sensor vim lawv kuj tseem txhawb nqa los ntawm lub tsev qiv ntawv ntawm ntau lwm tus.

Kauj Ruam 1: Npaj Arduino Ib puag ncig rau ESP8266

Npaj Arduino Ib puag ncig rau ESP8266
Npaj Arduino Ib puag ncig rau ESP8266
  1. Txhim kho qhov tseeb version ntawm Arduino IDE (tam sim no version 1.8.2).
  2. Siv Tus Thawj Saib Xyuas Haujlwm los teeb tsa kev teeb tsa esp8266 kev txhawb nqa. Cov lus qhia ntxaws tuaj yeem nrhiav tau ntawm no:
  3. Teeb tsa pawg thawj coj xaiv rau NodeMCU 1.0 nrog 1MByte SPIFFS Cov Ntaub Ntawv Txheej Txheem raws li pom hauv lub vijtsam

Kauj Ruam 2: suav nrog Cov Tsev Qiv Ntawv Yuav Tsum Tau

Suav nrog Cov Tsev Qiv Ntawv Yuav Tsum Tau
Suav nrog Cov Tsev Qiv Ntawv Yuav Tsum Tau

Tsev Qiv Ntawv HomeDing tso siab rau qee lub tsev qiv ntawv ntxiv rau cov ntsuas thiab ntsuas kom ua haujlwm.

Thaum koj teeb tsa HomeDing lub tsev qiv ntawv koj yuav pom cov popup nrog cov tsev qiv ntawv xav tau no uas tuaj yeem teeb tsa tau ncaj qha tso rau hauv daim duab thiab nws yooj yim rau nruab lawv txhua qhov.

Qee zaum (nrog qhov laj thawj tsis paub) kev teeb tsa lub tsev qiv ntawv ua tsis tiav yog li txhua lub tsev qiv ntawv xav tau yuav tsum tau teeb tsa ntawm tus kheej.

Xav paub ntau ntxiv txog cov tsev qiv ntawv xav tau tuaj yeem nrhiav tau ntawm lub vev xaib cov ntaub ntawv ntawm

Nov yog cov npe ntawm cov tsev qiv ntawv xav tau tam sim no:

  • Adafruit NeoPixel
  • LiquidCrystal_PCF8574.h
  • ESP8266 thiab ESP32 Oled Driver rau SSD1306 zaub
  • RotaryEncoder
  • DHT sensor tsev qiv ntawv rau ESPx
  • OneWire

Lub PMS5003 huab cua huab cua ua pa laser sib txuas lus siv 9600 baud serial kab teeb liab. Lub teeb liab no tau txais los ntawm kev siv SoftwareSerial lub tsev qiv ntawv uas los nrog kev teeb tsa ESP8266 cov cuab yeej. Nco ntsoov tsis txhob muaj cov ntawv qub teeb tsa ua lub tsev qiv ntawv.

Kauj Ruam 3: Kho Tus Qauv Piv Txwv Sketch

Customize Tus Qauv Piv Txwv Sketch
Customize Tus Qauv Piv Txwv Sketch

Tus Qauv Piv txwv twb suav nrog qee qhov kev ntsuas ntau dua li cov ntsiab lus yog li tsuas yog qee qhov kev teeb tsa yuav xav tau.

Qhov no siv rau BME680 sensor uas tau txhawb los ntawm BME680 Element.

PMS5003 sensor tsis tshua muaj tshwm sim thiab xav tau qhib los ntawm suav nrog PMS Element rau hauv lub khoos phis tawj. Qhov no ua tiav los ntawm kev txhais #define HOMEDING_INCLUDE_PMS hauv ntu ntu sau npe ntawm daim duab

#define HOMEDING_INCLUDE_BME680#txhais HOMEDING_INCLUDE_PMS

Txhawm rau yooj yim ntawm kev ntxiv cov cuab yeej tshiab rau hauv lub network koj tuaj yeem ntxiv SSID thiab cov kab lus luv ntawm koj lub tsev WiFi hauv cov lus zais.h nyob ib sab ntawm tus qauv.ino kos duab. Tab sis koj kuj tseem tuaj yeem siv Tus Thawj Saib Xyuas WiFi txuas ntxiv rau lub cuab yeej rau hauv lub network yam tsis muaj qhov teeb tsa nyuaj.

Tam sim no txhua yam hais txog kev ua tiav ntawm daim duab kos tau ua tiav thiab cov firmware tuaj yeem suav ua ke thiab rub tawm.

Kauj ruam 4: Upload Web UI

Tus qauv piv txwv los nrog cov ntaub ntawv tais ceev tseg uas muaj txhua cov ntaub ntawv rau web UI.

Ua ntej koj rub cov ntawv no koj yuav xav ntxiv env.json thiab teeb tsa.json cov ntawv koj tuaj yeem pom nrog kab lus no vim qhov no yuav ua rau yooj yim dua.

Cov ntsiab lus ntawm cov ntaub ntawv no yog dab tsi ua rau IoT ntaus ntawv tshwj xeeb thiab coj tus yam ntxwv zoo li huab cua. Nws tau piav qhia ntxaws hauv zaj dab neeg no.

Kev siv ESP8266 cov ntaub ntawv tso cai tso tawm thiab tso tag nrho cov ntaub ntawv. Nws xav tau kev rov pib dua kom qhib kev teeb tsa.

Kauj Ruam 5: Ntxiv BME680 Sensor

Ntxiv rau BME680 Sensor
Ntxiv rau BME680 Sensor
Ntxiv rau BME680 Sensor
Ntxiv rau BME680 Sensor
Ntxiv rau BME680 Sensor
Ntxiv rau BME680 Sensor

BME680 Sensor tab tom sib tham nrog lub rooj tsavxwm uas siv I2C npav.

Raws li qhov no muaj peev xwm sib qhia nrog lwm qhov txuas ntxiv zoo li lwm lub ntsuas pa lossis cov lus qhia tau teeb tsa ntawm qib ntaus ntawv hauv env.json ua ke nrog lub npe network ntawm lub cuab yeej. Nov yog cov qauv rho tawm ntawm lub cuab yeej thiab I2C teeb tsa:

"ntaus ntawv": {

"0": {"name": "airding", "description": "Air Quality Sensor", … "i2c-scl": "D2", "i2c-sda": "D1"}}

Ntawm daim ntawv qhia zaub mov koj tuaj yeem pom cov kab txuas sib txuas rau lub ntsuas: 3.3V = liab, GND = dub, SCL = daj, SDA = xiav

Kev teeb tsa rau BME680 tuaj yeem siv hauv config.json:

"bme680": {

"bd": {"chaw nyob": "0x77", "sijhawm nyeem": "10s"}}

Peb yuav ntxiv qhov ua tom qab.

Txhawm rau sim teeb tsa tsuas yog siv browser thiab qhib https://airding/board.htm thiab koj yuav pom qhov txiaj ntsig tiag ntawm lub ntsuas pom thiab lawv yuav raug hloov kho tshiab txhua 10 vib nas this:

Kauj Ruam 6: Ntxiv PMS5003 Sensor

Ntxiv PMS5003 Sensor
Ntxiv PMS5003 Sensor

Kuv tsis tau txais lub ntsuas hluav taws xob nrog lub khob cij txuas tus phooj ywg yog li kuv yuav tsum txiav ib qho ntawm cov txuas ntawm kab siv kuv cov hlau txuas kom ncaj qha txuas nws mus rau pawg thawj coj saib nodemcu. Koj tuaj yeem pom nws tseem nyob ntawm cov duab kawg.

Lub zog rau lub ntsuas ntsuas no yuav tsum tau muab los ntawm Vin uas ib txwm siv los ntawm USB npav. GND zoo ib yam tab sis kuj muaj nyob ib sab ntawm Vin tus pin.

Cov ntaub ntawv los ntawm lub ntsuas hluav taws xob tau hloov pauv hauv tus qauv 9600 baud serial format yog li rx thiab tx pins thiab sijhawm nyeem ntawv yuav tsum tau teeb tsa:

"pwm": {

"pm25": {"piav qhia": "pm25 particle sensor", "pinrx": "D6", "pintx": "D5", "readtime": "10s"}}

Peb yuav ntxiv qhov ua tom qab.

Txhawm rau sim teeb tsa dua tsuas yog rov pib dua lub cuab yeej thiab siv browser thiab qhib https://airding/board.htm thiab koj yuav pom qhov tseeb pm35 tus nqi ntawm lub ntsuas pom thiab lawv yuav raug hloov kho tshiab txhua 10 vib nas this tab sis tus nqi no yog ib txwm tsis hloov ntau zaus.

Koj tuaj yeem tau txais qhov txiaj ntsig siab dua los ntawm kev tso lub tswm ciab teeb nyob ib sab ntawm lub ntsuas pa vim lub tswm ciab ua ntau yam ntawm cov khoom no.

Tam sim no koj tuaj yeem tso txhua yam rau hauv vaj tsev zoo vim tias txhua qhov kev teeb tsa thiab txawm tias hloov kho software tuaj yeem ua tiav nyob deb.

Kauj Ruam 7: Ntxiv Qee Qhov Network

Cov teeb tsa hauv qab no rho tawm hauv env.json tau ua kom zoo

  • hloov kho lub firmware dhau ntawm huab cua
  • tso cai txheeb xyuas lub network siv SSDP network raws tu qauv thiab khaws lub sijhawm tam sim no los ntawm ntp server.

{

… "Ota": {"0": {"port": 8266, "passwd": "123", "description": "Mloog rau 'dhau cua' OTA Hloov Kho tshiab"}}, "ssdp": {"0" ": {" Chaw tsim tshuaj paus ":" yourname "}}," ntptime ": {" 0 ": {" readtime ":" 36h "," zone ": 2}}}

Koj yuav tsum kho lub sijhawm sijhawm rau koj qhov chaw nyob. Yog tias koj tsis ntseeg koj tuaj yeem siv lub vev xaib https://www.timeanddate.com/ kom tau txais qhov txiaj ntsig los ntawm UTC/GMT. "2" yog txoj cai rau lub caij ntuj sov hauv tebchaws Yelemes.

Koj kuj tseem tuaj yeem kho tus lej ota tom qab nyeem cov lus qhia txog kev txuag hom hauv cov ntaub ntawv ntawm

Tom qab rov pib dua koj tuaj yeem pom lub tshuab cua txias ntawm lub network thiab tom qab tau txais lus teb los ntawm ntp server lub sijhawm muaj nyob hauv.

Kauj Ruam 8: Ntxiv Qee Qhov Logging

Tsuas yog qhov txiaj ntsig tiag tiag yuav tsis muab txaus yog li qee cov ntsiab lus tuaj yeem siv tau.

Txog zaj dab neeg no Log lub caij thiab NPTTime Element tau siv los sau keeb kwm ntawm qhov ntsuas qhov ntsuas hauv cov ntaub ntawv teev cia thiab Web UI daim npav rau lub ntsiab lus no tuaj yeem pom nws ua duab.

Cov teeb tsa hauv qab no tsim 2 lub log cav rau cov pa thiab cov khoom:

{

"log": {"pm": {"description": "Log ntawm pm25", "filename": "/pmlog.txt", "filesize": "10000"}, "aq": {"description": " Log ntawm cov pa roj zoo "," npe npe ":" /aqlog.txt "," filesize ":" 10000 "}}}

Kauj ruam 9: Kev ua

Kev ua
Kev ua

Tam sim no peb yuav tsum tau hloov qhov txiaj ntsig tiag tiag rau cov ntsiab lus cav los ntawm kev siv ua. Cov kev ua yog siv tus cim URL kom dhau tus kay thiab tus nqi rau lub hom phiaj. Ntau Cov Txheej Txheem txhawb nqa kev ua ntawm qee yam xwm txheej uas tshwm sim zoo li ntes tus nqi sensor tshiab.

Kev nqis tes ua tau teeb tsa ntawm lub hauv paus uas tso tawm cov kev ua 2 nkag yuav tsum tau:

  • Pms/p25 qhov tshwm sim muaj txiaj ntsig xa tus nqi tiag rau lub cav/teev caij siv tus nqi nqis tes ua.
  • Qhov kev tshwm sim bme680/bd ongas xa tus nqi tiag rau lub cav/teev caij siv tus nqi nqis tes ua.

{

"pms": {"pm25": {… "onvalue": "log/pm? value = $ v"}}, "bme680": {"bd": {… "ongas": "log/aq? value = $ v "}}}

Tam sim no txhua lub ntsiab lus tau teeb tsa.

Kauj Ruam 10: Cov Duab thiab Kho Cov Ntaub Ntawv

Cov Duab thiab Kho Cov Ntaub Ntawv
Cov Duab thiab Kho Cov Ntaub Ntawv
Cov Duab thiab Kho Cov Ntaub Ntawv
Cov Duab thiab Kho Cov Ntaub Ntawv
Cov Duab thiab Kho Cov Ntaub Ntawv
Cov Duab thiab Kho Cov Ntaub Ntawv

Nov yog qee cov duab ntawm kuv qhov kawg IoT Air Quality sensor.

Cov ntaub ntawv teeb tsa rau rub tawm yuav tsum tau hloov pauv mus rau *.json (tsis muaj. Txt) ua ntej rub tawm.

Txuas thiab cov neeg ua tim khawv

  • HomeDing Source Code Repository:
  • Cov ntaub ntawv:
  • Tus Qauv Piv Txwv:
  • BME680 Element:
  • PMS Element:
  • Lub cav nkag:
  • NtpTime Element:

Pom zoo: