Cov txheej txheem:

Huab Cua Zoo Saib Nrog MQ135 thiab Sab Nraud Kub thiab Vaum Sensor Tshaj MQTT: 4 Cov Kauj Ruam
Huab Cua Zoo Saib Nrog MQ135 thiab Sab Nraud Kub thiab Vaum Sensor Tshaj MQTT: 4 Cov Kauj Ruam

Video: Huab Cua Zoo Saib Nrog MQ135 thiab Sab Nraud Kub thiab Vaum Sensor Tshaj MQTT: 4 Cov Kauj Ruam

Video: Huab Cua Zoo Saib Nrog MQ135 thiab Sab Nraud Kub thiab Vaum Sensor Tshaj MQTT: 4 Cov Kauj Ruam
Video: Sib Hawm Dhau (Time Passed) Music Video by: Deeda/Dib Xwb 2024, Hlis ntuj nqeg
Anonim
Huab Cua Zoo Saib Nrog MQ135 thiab Sab Nraud Kub thiab Vaum Sensor Tshaj MQTT
Huab Cua Zoo Saib Nrog MQ135 thiab Sab Nraud Kub thiab Vaum Sensor Tshaj MQTT

Nov yog rau lub hom phiaj sim.

Kauj ruam 1: Kev txhawb siab

Kev txhawb siab
Kev txhawb siab

Ob peb hnub dhau los ib tus phooj ywg ntawm kuv tau hla nrog Lub Tshuab Cua Txias. Siv li ob peb hnub tab sis nws tsis tuaj yeem pom zoo yog tias Lub Tshuab Ntxhua Khaub Ncaws yeej ua qee yam lossis tsis yog … yog li peb tau txiav txim siab tsav tsheb li cas qhov no. Kuv tau hla los nrog MQ135 huab cua ntsuas qhov zoo.

Nov yog kuv teeb tsa ntawm qhov system. MQTT broker (MqB), ib puag ncig tus neeg siv khoom uas xa Cov Kub/Vaum (TH) rau tus broker thiab thaum kawg peb tau ntxiv Cov Huab Cua Zoo (AQ) cov neeg siv khoom. MqB yuav xa txhua 5 feeb qhov ntsuas kub/av noo los ntawm TH rau AQ. Tau kawg qhov no nyob ntawm koj teeb tsa, koj tuaj yeem nce lossis txo lub sijhawm no, yog nyob ntawm koj. Cov hnub no yuav raug khaws cia, ua tiav thiab tshaj tawm los ntawm AQ.

Kauj ruam 2: Teeb Kho Vajtse

Kho vajtse: 1. NodeMCU V3

2. MQ135

3. Cov kab

4. Txuas lub MQ135 sensor rau NodeMCU raws li hauv qab no:

MQ135 -> NodeMCU

VCC -> VU

UA -> AO

GND -> GND

DOUT yuav tsis txuas nrog!

Kauj ruam 3: Software

Ua ntej tshaj plaws koj yuav xav tau Arduino IDE teeb tsa ntawm koj lub tshuab. Than koj yuav tsum ntxiv koj lub rooj tsavxwm, txheeb xyuas kab lus no.

Pib koj Arduino IDE thiab mus rau: Cov Cuab Yeej/Tswj Cov Tsev Qiv Ntawv lossis nias CTRL+Ua haujlwm+Kuv. Hauv hom tshawb nrhiav lim: esp8266wifi - nruab IoTtweet thiab MFUthings, dua li hom: PubSubClient - nruab PubSubClient los ntawm Nick O'Leary thiab PubSubClientTools los ntawm Simon Christmann.

Rub tawm MQ135 Library los ntawm: qhov no GitHub_Link. Hauv Arduino IDE taug kev mus rau Sketch/suav nrog Lub Tsev Qiv Ntawv/Ntxiv. ZIP Lub Tsev Qiv Ntawv, thiab thauj koj cov ntaub ntawv zauv teb tsis pub rub tawm.

Rub tawm ArduinoThread. Hauv Arduino IDE mus rau Sketch/suav nrog Lub Tsev Qiv Ntawv/Ntxiv. ZIP Library, thiab thauj khoom

rub tawm zip file.

Cov duab kos yog ua raws li qhov piv txwv muab los ntawm Arduino IDE, dab tuaj yeem pom hauv: Cov Ntaub Ntawv/Piv Txwv/PubSubClientTools/mqtt_esp8266.

Thauj cov duab kos uas tau muab hauv qhov kev qhia no. Tau kawg koj yuav tau hloov qee yam xws li:

#define WIFI_SSID "xxxxxxxx" // ntxiv koj SSID

#define WIFI_PASS "xxxxxxxx" // ntxiv koj tus Password

#define MQTT_SERVER "192.168.1.xxx" // ntxiv tus IP ntawm koj MQTT brocker#txhais MQTT_PORT 1883 // ntxiv chaw nres nkoj ntawm koj MQTT brocker

#define mqtt_user "xyz" // ntxiv lub npe siv ntawm koj MQTT Brocker

#define mqtt_password "xwz" // ntxiv tus password ntawm koj MQTT Brocker

Rau qhov seem yuav tsum ua li cas. Upload cov duab kos rau koj NodeMCU thiab qhib Serial Monitor (sab saum toj sab xis)

Kauj ruam 4: Cov lus xaus

Cov lus xaus
Cov lus xaus
Cov lus xaus
Cov lus xaus

Lub kaw lus ua haujlwm raws li qhov xav tau.

Daim duab los ntawm 13. Mar tsis muaj Lub Tshuab Cua Ua Haujlwm tab sis qhib qhov rai.

Daim duab los ntawm 15. Mar yog nrog Lub Tshuab Cua Ua Haujlwm nruab nrab ntawm 13:00 - 21:00, thiab kaw qhov rai.

Kuaj nws rau koj tus kheej thiab qhia rau kuv paub yog nws ua haujlwm rau koj.

Pom zoo: