Cov txheej txheem:

HiFive1 Arduino Intruder Detection With MQTT Alerts Siv ESP32 lossis ESP8266: 6 Cov Kauj Ruam
HiFive1 Arduino Intruder Detection With MQTT Alerts Siv ESP32 lossis ESP8266: 6 Cov Kauj Ruam

Video: HiFive1 Arduino Intruder Detection With MQTT Alerts Siv ESP32 lossis ESP8266: 6 Cov Kauj Ruam

Video: HiFive1 Arduino Intruder Detection With MQTT Alerts Siv ESP32 lossis ESP8266: 6 Cov Kauj Ruam
Video: HiFive1: An open source, Arduino-compatible RISC-V dev kit 2024, Kaum ib hlis
Anonim
HiFive1 Arduino Intruder Detection With MQTT Alerts Siv ESP32 lossis ESP8266
HiFive1 Arduino Intruder Detection With MQTT Alerts Siv ESP32 lossis ESP8266

HiFive1 yog thawj Arduino-tshaj RISC-V raws lub rooj tsavxwm ua nrog FE310 CPU los ntawm SiFive. Lub rooj tsavxwm yog kwv yees li 20 zaug sai dua li Arduino UNO tseem tsis tau zoo li UNO pawg thawj coj, nws tsis muaj kev sib txuas wireless.

Hmoov zoo, muaj ntau qhov qauv tsis kim ntawm kev ua lag luam txhawm rau txo qhov kev txwv no. Hauv qhov kev qhia no kuv siv ESP32 lossis ESP8266 txhawm rau kom tau txais kev sib txuas wireless. Txawm hais tias pheej yig npaum li cas ESP-01 yog, vim xav tau los teeb tsa nws nrog Arduino kos duab, ESP-01 yog qhov daws tau yooj yim dua. Txhawm rau ua haujlwm ESP-01, nws xav tau USB sab nraud rau ESP-01 adapter uas kuv tsis muaj thaum lub sijhawm ua qhov kev qhia no. (Yog tias koj xav siv HiFive1 nrog ESP-01 ua raws qhov txuas no) Kuv kuj xav txog kev siv Arduino Shield tab sis tau xaus nrog ESP8266/32 vim tias tus nqi kim dua tus nqi feem ntau cov ntaub thaiv npog.

Txoj haujlwm no yuav tsom mus rau tsim Kev Tshawb Fawb Kev Tshawb Fawb uas yuav ua haujlwm los ntawm kev xa ntawv ceeb toom mus rau MQTT Broker txhua lub sijhawm Ultrasonic sensor (SRF05) pom cov khoom hla nws txoj kab kev pom.

Cov ntaub ntawv xav tau rau txoj haujlwm no:

  • HiFive1 board (Yuav tuaj yeem yuav ntawm no)
  • ESP32 Dev Module lossis ESP8266 NodeMCU 1.0
  • 10 k resistor x2
  • 1 k resistor
  • Cov qhob cij
  • kab x6
  • SRF05 Ultrasonic module
  • Txawb ntaus ntawv

Kauj Ruam 1: Teeb Ib puag ncig

Teem Ib puag ncig
Teem Ib puag ncig

Nruab Arduino IDE

1. Ua raws cov lus qhia txhawm rau teeb tsa HiFive1 board Arduino pob thiab USB tsav tsheb.

2. Nruab ESP32 lossis ESP8266 pawg pob los ntawm kev ntxiv qhov URL tsim nyog rau "File-> Preferences-> Tus Thawj Saib Xyuas Ntxiv":

  • ESP8266 -
  • ESP32 -

Kauj Ruam 2: Txuas ESP32

Txuas ESP32
Txuas ESP32
Txuas ESP32
Txuas ESP32

Yog tias koj siv ESP8266 hla mus rau qib 3.

Ib qho tseem ceeb: SRF05 los rau hauv 2 tus pinout versions uas yog mirrored versions ntawm txhua lwm yam, kom paub tseeb tias koj muaj tib lub module zoo li kuv siv qhov txuas hauv qab no.

Yog xav paub ntau ntxiv ntawm SRF05 ua raws qhov txuas no.

GND (HiFive1) -> GND (SRF05) 5v (HiFive1) -> VCC (SRF05) DI/O 11 (HiFive1) -> Trigger Pin (SRF05) DI/O 12 (HiFive1) -> Echo Pin (SRF05) DI/ O 5 (HiFive1) -> Tx (ESP32) DI/O 6 (HiFive1) -> Rx (ESP32)

Nco tseg: Nco ntsoov tias IOREF jumper tau teeb tsa ntawm 3.3v.

Kauj Ruam 3: Txuas ESP8266

Txuas ESP8266
Txuas ESP8266
Txuas ESP8266
Txuas ESP8266

Ib qho tseem ceeb: SRF05 los rau hauv 2 tus pinout versions uas yog mirrored versions ntawm txhua lwm yam, kom paub tseeb tias koj muaj tib lub module zoo li kuv siv qhov txuas hauv qab no.

Yog xav paub ntau ntxiv ntawm SRF05 ua raws qhov txuas no

GND (HiFive1) -> GND (SRF05) 5v (HiFive1) -> VCC (SRF05) DI/O 11 (HiFive1) -> Trigger Pin (SRF05) DI/O 12 (HiFive1) -> Echo Pin (SRF05) DI/ O 5 (HiFive1) -> Tx (ESP8266) DI/O 6 (HiFive1) -> Rx (ESP8266)

Nco tseg: Nco ntsoov tias IOREF jumper tau teeb tsa rau 3.3v.

Kauj ruam 4: Programming

Txoj Cai HiFive1:

Ua ntej kev teeb tsa teeb tsa "Cov Cuab Yeej-> Pawg Thawj Coj" rau HiFive1 pawg thawj coj, "Cuab Yeej-> CPU Clock Zaus" rau "256MHz PLL", "Cuab Yeej-> Tus Kws Ua Haujlwm" rau "SiFive OpenOCD" thiab qhov chaw nres nkoj raug xaiv raug xaiv.

Koj kuj tseem yuav tsum rub lub tsev qiv ntawv Ultrasonic no, thiab PubSubClient no thiab rho tawm lawv rau hauv koj li Arduino Libraries nplaub tshev pom hauv "Tus Neeg Siv-> Cov Ntaub Ntawv-> Arduino-> Tsev Qhua".

ESP32/8266 Txoj Cai:

Thaum lub khoos phis tawj, ESP pawg thawj coj yuav tsum muaj kho vajtse Rx thiab Tx pins txuas.

Rau ESP32-Teeb tsa "Tools-> Board" rau "ESP32 Dev Module", "Tools-> Programmer" mus rau "AVRISP mkll" thiab xaiv qhov tseeb Serial Port.

Rau ESP8266-Teeb tsa "Tools-> Board" mus rau "NodeMCU 1.0 (ESP-12E Module)", "Tools-> Programmer" mus rau "AVRISP mkll" thiab xaiv qhov tseeb Serial Port.

Cov duab kos tau qiv los ntawm no nrog kev hloov kho kom hloov nws mus rau hauv kev nkag mus rau cov neeg nkag mus.

Kauj Ruam 5: Teeb Tus Neeg Siv Khoom

Teeb Tus Neeg Siv Khoom
Teeb Tus Neeg Siv Khoom
Teeb Tus Neeg Siv Khoom
Teeb Tus Neeg Siv Khoom
Teeb Tus Neeg Siv Khoom
Teeb Tus Neeg Siv Khoom
Teeb Tus Neeg Siv Khoom
Teeb Tus Neeg Siv Khoom

Kuv siv huab-based MQTT Broker (qhov no) thiab Android Phone nrog rau daim ntawv thov no.

Txhawm rau teeb tsa txhua yam, koj yuav tsum qhib tus account.

Siv cov screenshots uas tau muab los ntawm kev teeb tsa CloudMQTT thiab App.

Kauj Ruam 6: Qhov Kawg

Zaum Kawg
Zaum Kawg
Zaum Kawg
Zaum Kawg
Zaum Kawg
Zaum Kawg
Zaum Kawg
Zaum Kawg

Nco tseg: Koj yuav tsum teeb tsa koj li Serial Monitor tus nqi baud rau 115200 vim tias yog tus nqi baud peb siv hauv peb daim duab.

Koj qhov txiaj ntsig kawg yuav tsum zoo ib yam li cov screenshots zaum kawg

Pom zoo: