Cov txheej txheem:

Yuav Ua Li Cas Saib Xyuas Ultrasonic Distance Nrog ESP8266 thiab AskSensors IoT Cloud: 5 Kauj Ruam
Yuav Ua Li Cas Saib Xyuas Ultrasonic Distance Nrog ESP8266 thiab AskSensors IoT Cloud: 5 Kauj Ruam

Video: Yuav Ua Li Cas Saib Xyuas Ultrasonic Distance Nrog ESP8266 thiab AskSensors IoT Cloud: 5 Kauj Ruam

Video: Yuav Ua Li Cas Saib Xyuas Ultrasonic Distance Nrog ESP8266 thiab AskSensors IoT Cloud: 5 Kauj Ruam
Video: Prolonged Field Care Podcast 137: PFC in Ukraine 2024, Kaum ib hlis
Anonim
Yuav Ua Li Cas Saib Xyuas Ultrasonic Distance Nrog ESP8266 thiab AskSensors IoT Cloud
Yuav Ua Li Cas Saib Xyuas Ultrasonic Distance Nrog ESP8266 thiab AskSensors IoT Cloud

Cov lus qhia no nthuav qhia yuav ua li cas saib xyuas qhov nrug ntawm ib qho khoom siv ultrasonic HC-SR04 sensor thiab ESP8266 ntawm MCU txuas nrog rau AskSensors IoT huab.

Kauj Ruam 1: Cov Khoom Peb Xav Tau

Cov Khoom Peb Xav Tau
Cov Khoom Peb Xav Tau

Peb yuav xav tau cov cuab yeej hauv qab no:

  • ESP8266 Node MCU
  • Ultrasonic HC-SR04 Sensor
  • Pawg Mov Ci
  • Jumper xov hlau
  • Micro USB kab

Kauj ruam 2: Tsim Koj Cov Khoos Phis Tawj

Tsim Koj Cov Khoos Phis Tawj
Tsim Koj Cov Khoos Phis Tawj

Txuas lub ntsuas hluav taws xob ultrasonic mus rau ESP8266 ntawm MCU:

  • HC-SR01 TRIG tus pin rau ESP8266 D1 tus pin
  • HC-SR01 ECHO tus pin rau ESP8266 D2 tus pin
  • HC-SR01 VCC tus pin rau 5V (koj tseem tuaj yeem sim nrog 3.3V)
  • Av rau hauv av

Nco tseg: ESP8266 GPIOs xav tau 3V3 cov cim (tsis yog 5V sib txawv). Txhawm rau hack sai, yog tias koj siv HC-SR (5V version), peb pom zoo kom ntxiv cov tshuaj tiv thaiv kab mob nruab nrab ntawm HC-SR TRIG thiab ECHO pins thiab ESP8266 pins. Txawm li cas los xij, rau kev tsim khoom, yuav tsum tau hloov 3V3/5V qib (txheeb xyuas nplooj ntawv no).

Txwv tsis pub, ESP8266 tau sib xws nrog HC-SR 3V3 version thiab tsis muaj kev hloov pauv qib xav tau hauv qhov no.

Kauj Ruam 3: teeb tsa AskSensors

  • Tau txais tus lej pub dawb ntawm
  • Nkag mus rau hauv thiab tsim lub Sensor tshiab.
  • Luam koj li Sensor API KEY IN.

Kauj ruam 4: Rub tawm Txoj Cai

Rub tawm cov cai los ntawm AskSensors github Page.

Decompress nws thiab sau cov ntaub ntawv hauv qab no:

const char* wifi_ssid = "……………….."; // SIB

const char* wifi_password = "……………….."; // WIFI const char* apiKeyIn = "………………"; // API KEY IN

Kauj ruam 5: Khiav Code

Khiav Txoj Cai
Khiav Txoj Cai

Txuas ESP8266 rau koj lub khoos phis tawj thiab xa cov cai.

Tam sim no, Mus rau koj AskSensors dashboard.

Qhib koj lub sensor nplooj ntawv thiab ntxiv daim duab tshiab kom pom koj cov ntaub ntawv hauv lub sijhawm tiag tiag raws li qhia hauv daim duab.

Pom zoo: