Cov txheej txheem:

IoT-ThingSpeak-ESP32-Long-Range-Wireless-Vibration-And-Temp: 6 Kauj Ruam
IoT-ThingSpeak-ESP32-Long-Range-Wireless-Vibration-And-Temp: 6 Kauj Ruam

Video: IoT-ThingSpeak-ESP32-Long-Range-Wireless-Vibration-And-Temp: 6 Kauj Ruam

Video: IoT-ThingSpeak-ESP32-Long-Range-Wireless-Vibration-And-Temp: 6 Kauj Ruam
Video: Measure Temperature and Humidity WiFi with ESP32 DHT11 and DHT22 - Robojax 2024, Hlis ntuj nqeg
Anonim
IoT-ThingSpeak-ESP32-Ntev-Ntau Yam-Wireless-Kev co-Thiab-Temp
IoT-ThingSpeak-ESP32-Ntev-Ntau Yam-Wireless-Kev co-Thiab-Temp

Hauv txoj haujlwm no, peb yuav ntsuas kev co thiab ntsuas kub siv NCD kev co thiab ntsuas kub, Esp32, ThingSpeak

Kev co yog tiag tiag mus thiab txav mus los - lossis oscillation - ntawm cov tshuab thiab cov khoom siv hauv cov cuab yeej siv tshuab. Kev co hauv kev lag luam tuaj yeem yog cov tsos mob, lossis mob siab rau, tsis yooj yim, lossis nws tuaj yeem cuam tshuam nrog kev ua haujlwm niaj hnub. Piv txwv li, oscillating sanders thiab vibratory tumblers nyob ntawm qhov kev co kom muaj qhov tshwj xeeb. Sab hauv cov tshuab hluav taws xob thiab cov cuab yeej tsav, tom qab ntawd rov zoo siab kom paub qhov tseeb ntawm qhov tsis tuaj yeem ua rau muaj kev co. Kev co tuaj yeem cuam tshuam qhov teeb meem thiab yog tias tsis muaj kev tshuaj xyuas tuaj yeem ua rau raug mob lossis ua kom nrawm dua. Kev co tuaj yeem tshwm sim los ntawm ib lossis ntau yam ntxiv nyob rau txhua lub sijhawm, qhov siab tshaj plaws tsis txawv txav yog qhov tsis sib xws, ua tsis raug, muab tso rau, thiab xoob. Qhov kev puas tsuaj no tuaj yeem txo qis los ntawm kev txheeb xyuas Kub thiab Kev Ruaj Ntseg Cov Ntaub Ntawv ntawm ThingSpeak siv esp32 thiab NCD wireless kev co thiab ntsuas kub.

Kauj ruam 1: Kho vajtse thiab Software xav tau

Kho vajtse thiab Software yuav tsum tau
Kho vajtse thiab Software yuav tsum tau
Kho vajtse thiab Software yuav tsum tau
Kho vajtse thiab Software yuav tsum tau

Yuav tsum tau kho vajtse:

  • ESP-32: ESP32 ua kom yooj yim siv Arduino IDE thiab Arduino Wire Language rau IoT daim ntawv thov. Qhov ESp32 IoT Module no sib txuas Wi-nkaus, Bluetooth, thiab Bluetooth BLE rau ntau yam kev siv sib txawv. Cov qauv no tau los ua tiav nrog 2 CPU cores uas tuaj yeem tswj tau thiab siv zog ib tus zuj zus, thiab nrog lub moos hloov pauv tau ntawm 80 MHz txog 240 MHz. Qhov ESP32 IoT WiFi BLE Module nrog Kev Sib Txuas USB tau tsim los kom haum rau txhua qhov khoom ncd.io IoT.
  • IoT Long Range Wireless Vibration Thiab Kub Sensor: IoT Long Range Wireless Vibration Thiab Kub Sensor yog roj teeb ua haujlwm thiab wireless, lub ntsiab lus tias tam sim no lossis kev sib txuas xov hlau tsis xav tau rub kom nws nce thiab ua haujlwm. Nws taug qab cov ntaub ntawv kev co ntawm koj lub tshuab tas li thiab ntes thiab ua haujlwm nyob rau lub sijhawm daws teeb meem ua ke nrog lwm qhov ntsuas kub. Hauv qhov no, peb tab tom siv NCD's Long Range IoT Industrial wireless kev co thiab ntsuas kub, khav theeb txog li 2 Mais ntau yam siv cov wireless sib txuas sib txuas ua ke.
  • Ntev-Ntau Wireless Wireless Mesh Modem nrog USB Interface

Siv Software:

  • Arduino IDE Cov
  • ThigSpeak

Qiv Siv

  • PubSubClient
  • Hlau.h

Arduino Client rau MQTT

  • Lub tsev qiv ntawv no muab cov neeg siv los ua qhov yooj yim tshaj tawm/sau npe xa xov nrog lub server uas txhawb MQTT
  • Yog xav paub ntxiv txog MQTT, mus saib mqtt.org.

Rub tawm

Qhov hloov tshiab kawg ntawm lub tsev qiv ntawv tuaj yeem rub tawm los ntawm GitHub

Cov ntaub ntawv

Lub tsev qiv ntawv los nrog tus lej piv txwv piv txwv. Saib Cov Ntaub Ntawv> Piv Txwv> PubSubClient hauv Arduino daim ntawv thov. Cov ntaub ntawv API tag nrho

Kho vajtse sib xws

Lub tsev qiv ntawv siv Arduino Ethernet Client API rau kev cuam tshuam nrog cov khoom siv sib txuas hauv qab. Qhov no txhais tau tias Nws Tsuas Ua Haujlwm nrog cov naj npawb ntawm cov laug cam thiab cov tiv thaiv, suav nrog:

  1. Arduino Ethernet
  2. Arduino Ethernet Shield
  3. Arduino YUN - siv suav nrog YunClient nyob rau hauv qhov chaw ntawm EthernetClient, thiab nco ntsoov ua Bridge.begin () ua ntej
  4. Arduino WiFi Shield - yog tias koj xav xa cov ntawv ntau dua 90 bytes nrog daim thaiv no, pab kom MQTT_MAX_TRANSFER_SIZE xaiv hauv PubSubClient.h.
  5. Sparkfun WiFly Shield - thaum siv nrog lub tsev qiv ntawv no.
  6. Intel Galileo/Edison
  7. ESP8266
  8. ESP32: Tam sim no lub tsev qiv ntawv tsis tuaj yeem siv nrog kho vajtse raws li ENC28J60 nti - xws li Nanode lossis Nuelectronics Ethernet Shield. Rau cov ntawd, muaj lwm lub tsev qiv ntawv muaj.

Cov Tsev Qiv Hlau

Lub tsev qiv ntawv Hlau tso cai rau koj sib txuas lus nrog I2C cov cuab yeej, feem ntau tseem hu ua "2 xaim" lossis "TWI" (Ob Txoj Kev Siv Hluav Taws Xob), uas tuaj yeem rub tawm los ntawm Wire.h.

Kauj Ruam 2: Cov Kauj Ruam Xa Cov Ntaub Ntawv mus rau Labview Kev co thiab Kub Platform Siv IoT Long Range Wireless Kev Ruaj Ntseg thiab Kub Sensor thiab Ntev Ntau Wireless Mesh Modem Nrog USB Interface-

  • Ua ntej, peb xav tau Labview cov ntawv thov siv uas yog ncd.io Wireless Vibration thiab Kub Sensor.exe cov ntaub ntawv uas tuaj yeem saib.
  • Qhov Labview software no yuav ua haujlwm nrog ncd.io wireless Vibration Kub sensor nkaus xwb
  • Txhawm rau siv UI no, koj yuav tsum teeb tsa cov tsav tsheb hauv qab no Teeb tsa lub sijhawm ua haujlwm cav ntawm no 64 ntsis
  • 32 bit ib
  • Nruab NI Visa Tsav Tsheb
  • Nruab LabVIEW Khiav Sijhawm Cav thiab NI-Serial Runtime.
  • Pib qhia rau cov khoom no.

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

Raws li esp32 yog ib feem tseem ceeb tshaj tawm koj li kev co thiab kub cov ntaub ntawv rau ThingSpeak.

  • Rub tawm thiab suav nrog PubSubClient Library thiab Wire.h Library.
  • Rub tawm thiab suav nrog WiFiMulti.h thiab HardwareSerial.h Library.

#suav nrog

#include #include #include #include

Koj yuav tsum muab koj tus lej API tshwj xeeb muab los ntawm ThingSpeak, SSID (WiFi Lub Npe) thiab Lo lus zais ntawm lub network uas muaj

const char* ssid = "Yourssid"; // Koj SSID (Npe koj li WiFi)

const char* password = "Wifipass"; // Koj li Wifi passwordconst char* host = "api.thingspeak.com"; Txoj hlua api_key = "APIKEY"; // Koj tus lej API tau muab los ntawm yam khoom

Txheeb xyuas qhov sib txawv uas cov ntaub ntawv yuav khaws cia ua ib txoj hlua thiab xa mus rau ThingSpeak

int tus nqi; int Temp; rau Rms_x; rau Rms_y; rau Rms_z;

Txoj cai los tshaj tawm cov ntaub ntawv rau ThingSpeak:

Txoj hlua data_to_send = api_key;

data_to_send += "& field1 ="; data_to_send += Txoj hlua (Rms_x); data_to_send += "& field2 ="; data_to_send += Txoj hlua (Temp); data_to_send += "& field3 ="; data_to_send += Txoj hlua (Rms_y); data_to_send += "& field4 ="; data_to_send += Txoj hlua (Rms_z); data_to_send += "\ r / n / r / n"; client.print ("POST /hloov tshiab HTTP /1.1 / n"); client.print ("Tus tswv tsev: api.thingspeak.com / n"); client.print ("Kev sib txuas: kaw / n"); client.print ("X-THINGSPEAKAPIKEY:" + api_key + "\ n"); client.print ("Cov ntsiab lus-Hom: thov/x-www-form-urlencoded / n"); client.print ("Cov ntsiab lus-Ntev:"); client.print (data_to_send.length ()); client.print ("\ n / n"); client.print (data_to_send);

  • Sau thiab xa cov Esp32-Thingspeak.ino
  • Txhawm rau txheeb xyuas qhov kev sib txuas ntawm lub cuab yeej thiab cov ntaub ntawv xa mus, qhib lub ntsuas saib. Yog tias tsis pom cov lus teb, sim tshem koj lub ESP32 thiab tom qab ntawd txuas nws dua. 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 4: Cov Ntsiab Lus Saib Xyuas Serial:

Serial Saib Xyuas Cov Zis
Serial Saib Xyuas Cov Zis

Kauj Ruam 5: Ua Qhov ThingSpeak Ua Haujlwm:

Ua qhov ThingSpeak Ua Haujlwm
Ua qhov ThingSpeak Ua Haujlwm
Ua qhov ThingSpeak Ua Haujlwm
Ua qhov ThingSpeak Ua Haujlwm
Ua qhov ThingSpeak Ua Haujlwm
Ua qhov ThingSpeak Ua Haujlwm
  • Tsim tus as khauj ntawm ThigSpeak.
  • Tsim cov channel tshiab, los ntawm txhaj rau Channels.
  • Nyem rau ntawm My Channels.
  • Nyem Tshiab Channel.
  • Hauv New Channel, npe lub channel.
  • Npe Lub Npe Sab Hauv Hauv Channel, Teb yog qhov sib txawv uas cov ntaub ntawv tau tshaj tawm.
  • Tam sim no tseg Channel.
  • Tam sim no koj tuaj yeem pom koj tus lej API ntawm lub dashboard. Mus rau tus kais ntawm lub vev xaib thiab pom koj li 'Sau API Key' uas yuav tsum tau hloov kho tshiab ua ntej xa cov cai rau ESP32.
  • Thaum Channel tau tsim koj yuav muaj peev xwm saib koj qhov kub thiab txias cov ntaub ntawv hauv tus kheej saib nrog Fields koj tau tsim sab hauv Channel.
  • Txhawm rau phiaj xwm kab ntawm cov ntaub ntawv kev sib txawv sib txawv, koj tuaj yeem siv MATLAB Visualization.
  • Txhawm rau qhov no mus rau App, Nyem rau MATLAB Visualization.
  • Sab hauv nws xaiv Kev Cai, hauv qhov no, peb tau xaiv tsim 2-D kab phiaj nrog y-axis ntawm ob sab laug thiab sab xis. Tam sim no nyem tsim.
  • MATLAB tus lej yuav rov tsim dua tshiab raws li koj tsim kev pom tab sis koj yuav tsum hloov kho daim npav ID, nyeem tus lej ID, tuaj yeem tshawb xyuas daim duab hauv qab no.
  • Tom qab ntawd txuag thiab khiav cov cai.
  • Koj yuav pom cov phiaj xwm.

Pom zoo: