Cov txheej txheem:

Temp/Humidity Data Analysis Siv Ubidots thiab Google-Sheets: 6 Cov Kauj Ruam
Temp/Humidity Data Analysis Siv Ubidots thiab Google-Sheets: 6 Cov Kauj Ruam

Video: Temp/Humidity Data Analysis Siv Ubidots thiab Google-Sheets: 6 Cov Kauj Ruam

Video: Temp/Humidity Data Analysis Siv Ubidots thiab Google-Sheets: 6 Cov Kauj Ruam
Video: Climate Data (Temperature, Precipitation, Humidity) from 1981-2022 2024, Kaum ib hlis
Anonim
Temp/Humidity Data Analysis Siv Ubidots thiab Google-Sheets
Temp/Humidity Data Analysis Siv Ubidots thiab Google-Sheets

Hauv qhov kev qhia no, peb yuav ntsuas qhov sib txawv ntawm qhov kub thiab txias cov ntaub ntawv siv qhov ntsuas kub thiab cov av noo. Koj tseem yuav kawm paub yuav xa cov ntaub ntawv no mus rau Ubidots li cas. Yog li koj tuaj yeem txheeb xyuas nws los ntawm txhua qhov chaw rau daim ntawv thov sib txawv. Tsis tas li los ntawm kev xa cov ntaub ntawv no mus rau Google nplooj ntawv, kev txheeb xyuas qhov ua ntej tuaj yeem ua tiav

Kauj ruam 1: Kho vajtse thiab Software xav tau

Yuav tsum tau kho vajtse:

  • NCD ESP32 IoT WiFi BLE Module nrog Kev Sib Txuas USB
  • NCD IoT Ntev Ntau Yam Wireless Kub thiab Vaum Sensor

Yuav tsum tau Software:

  • Arduino IDE Cov
  • Ubidots

Tsev qiv ntawv siv:

  • PubSubClient Library
  • Hlau.h

Kauj Ruam 2: Tshaj Tawm Txoj Cai rau ESP32 Siv Arduino IDE:

  • Ua ntej rub tawm cov cai koj tuaj yeem pom qhov ua haujlwm ntawm lub ntsuas cua ntawm qhov muab txuas.
  • Rub tawm thiab suav nrog PubSubClient Library thiab Wire.h Library.

#suav nrog

#ncig #ncig

#suav nrog

Koj yuav tsum muab koj tus kheej tshwj xeeb Ubidots TOKEN, MQTTCLIENTNAME, SSID (WiFi Lub Npe) thiab Lo lus zais ntawm lub network muaj

#define WIFI SSID "XYZ" // Muab koj WifiSSID ntawm no

#define PASSWORD "XYZ" // Muab koj tus password nkag mus ntawm no#txhais TOKEN "XYZ" // Muab koj cov Ubidots 'TOKEN

#define MQTT_CLIENT_NAME "XYZ" // MQTT tus thov lub npe

Txheeb xyuas qhov sib txawv thiab lub npe khoom siv uas cov ntaub ntawv yuav xa mus rau Ubidots

#define VARIABLE_LABEL "Kub" // Txheeb xyuas cov ntawv sib txawv

#define VARIABLE_LABEL2 "Roj teeb" #define VARIABLE_LABEL3 "Vaum" #define DEVICE_LABEL "esp32" // Txheeb cov ntawv ntaus ntawv

Qhov chaw khaws cov txiaj ntsig xa:

char them [100];

lub ntsiab lus [150];

char nqe 2 [150];

char topic3 [150]; // Qhov chaw khaws cov txiaj ntsig xa

char str_Temp [10];

char str_sensorbat [10];

char str_humidity [10];

Txoj cai los tshaj tawm cov ntaub ntawv rau Ubidots:

sprintf (ntsiab lus, "%s", ""); // Ntxuav cov ntsiab lus ntsiab lus sprintf (ntsiab lus, "%s%s", "/v1.6/devices/", DEVICE_LABEL);

sprintf (payload, "%s", ""); // Ntxuav cov ntsiab lus them nyiaj

sprintf (payload, "{"%s / ":", VARIABLE_LABEL); // Ntxiv cov ntawv sib txawv

sprintf (payload, " %s {" value / ": %s", payload, str_Temp); // Ntxiv tus nqi

sprintf (payload, "%s}}", payload); // Kaw cov phau ntawv txhais lus

client.publish (ntsiab lus, them nyiaj);

  • Sau thiab xa cov cai temp_humidity.ino.
  • Txhawm rau txheeb xyuas qhov kev sib txuas ntawm lub cuab yeej thiab cov ntaub ntawv xa mus, qhib cov ntawv saib xyuas. Nco ntsoov tias tus nqi baud ntawm Serial monitor tau teeb tsa rau tib qho uas tau teev tseg hauv koj tus lej 115200.

Kauj Ruam 3: Serial Monitor Output

Serial Monitor Output
Serial Monitor Output

Kauj Ruam 4: Ua Ubidot Ua Haujlwm:

Ua Ubidot Ua Haujlwm
Ua Ubidot Ua Haujlwm
Ua Ubidot Ua Haujlwm
Ua Ubidot Ua Haujlwm
Ua Ubidot Ua Haujlwm
Ua Ubidot Ua Haujlwm
Ua Ubidot Ua Haujlwm
Ua Ubidot Ua Haujlwm
  • Tsim tus as khauj ntawm Ubidots.
  • Mus rau kuv qhov profile thiab sau cia tus cim token uas yog tus yuam sij tshwj xeeb rau txhua tus as khauj thiab muab nws tso rau koj tus lej ESP32 ua ntej rub tawm.
  • Ntxiv ib lub cuab yeej tshiab rau koj lub Ubidots dashboard lub npe esp32.
  • Nyem rau ntawm cov cuab yeej thiab xaiv cov cuab yeej hauv Ubidots.
  • Tam sim no koj yuav tsum pom cov ntaub ntawv tshaj tawm hauv koj tus lej Ubidots, sab hauv lub cuab yeej hu ua "ESP32".
  • Sab hauv lub cuab yeej tsim qhov hloov pauv lub npe tshiab uas koj qhov ntsuas kub yuav pom.
  • Tam sim no koj tuaj yeem saib Qhov Kub thiab lwm yam ntaub ntawv ntsuas uas tau pom yav dhau los hauv cov ntawv saib. Qhov no tau tshwm sim vim tias tus nqi ntawm kev nyeem ntawv sib txawv tau dhau los ua txoj hlua thiab khaws cia hauv qhov sib txawv thiab tshaj tawm rau qhov sib txawv sab hauv ntaus ntawv esp32.

Kauj Ruam 5: Xa Koj Cov Ntaub Ntawv Ubidots rau Google Cov Ntawv

Export Koj Cov Ntaub Ntawv Ubidots rau Google Cov Ntawv
Export Koj Cov Ntaub Ntawv Ubidots rau Google Cov Ntawv
Export Koj Cov Ntaub Ntawv Ubidots rau Google Cov Ntawv
Export Koj Cov Ntaub Ntawv Ubidots rau Google Cov Ntawv
Export Koj Cov Ntaub Ntawv Ubidots rau Google Cov Ntawv
Export Koj Cov Ntaub Ntawv Ubidots rau Google Cov Ntawv

Hauv qhov no peb tuaj yeem rho tawm cov ntaub ntawv khaws cia hauv Ubidots huab rau kev tshuaj xyuas ntxiv. Kev muaj peev xwm loj heev; Piv txwv li, koj tuaj yeem tsim lub tshuab hluav taws xob qhia tsis siv neeg thiab xa nws mus rau koj cov neeg siv khoom txhua lub lim tiam.

Lwm daim ntawv thov yuav yog kev muab khoom siv; yog tias koj muaj ntau txhiab tus cuab yeej siv, thiab lawv cov ntaub ntawv nyob hauv Google Ntawv, koj tuaj yeem tsim tsab ntawv los nyeem daim ntawv thiab tsim Ubidots cov ntaub ntawv rau txhua kab ntawm kab ntawv.

Cov kauj ruam los ua qhov no:

Tsim Google Ntawv thiab ntxiv ob nplooj ntawv rau nws nrog cov npe no:

  1. Ntau yam
  2. Qhov muaj nqis
  • Los ntawm koj daim ntawv Google, nyem rau ntawm "Cov Cuab Yeej" tom qab ntawd "Tsab Ntawv Editor …", tom qab ntawd "Txoj Haujlwm Tsis Txaus":
  • Qhib Tsab Ntawv Editor:
  • Ntxiv cov cai hauv qab no (hauv ntu code) rau tsab ntawv Script.
  • Tsis tas li ntxiv Token Id, tus lej ntaus khoom siv los ntawm koj tus lej Ubidots rau tus lej hauv qab no.
  • Ua tiav! tam sim no qhib koj daim ntawv Google dua thiab koj yuav pom cov ntawv qhia zaub mov tshiab los ua haujlwm.

Pom zoo: