Cov txheej txheem:
Video: Wireless Serial (UART) rau Arduino/STM32/thiab lwm yam: 3 Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Vam tias txhua tus yuav pom zoo nrog kuv tias Arduino Serial yog lub cuab yeej zoo rau kev debug koj cov haujlwm. Zoo, nws yog qhov kev xaiv nkaus xwb rau kev debug Arduino. Tab sis qee zaum, nws tsis tuaj yeem ua tau lossis siv tau los siv USB cable los ntawm Arduino lossis lwm yam microcontroller rau hauv koj lub computer.
Yog li kuv tau ua UART-WiFi pawg thawj coj no, raws li ESP8266-01, uas yog cov av pheej yig niaj hnub no. Cov laug cam me me, koj tuaj yeem ntsaws nws rau hauv lub khob cij, txuas lub zog, RX, TX thiab hauv av thiab nws yuav xa txhua yam nws tau txais los ntawm UART rau koj lub khoos phis tawj ntawm WiFi thiab hloov pauv.
Nta:
- baudrates txog 115200 (raws li kev xav txawm tias mus txog 921600, tab sis qhov no tsis tau sim)
- tau txais/xa cov ntaub ntawv los ntawm UART thiab xa/tau txais cov ntaub ntawv ntawm WiFi ncaj qha rau koj lub computer siv chaw nres nkoj 23 (Telnet)
- 18 cov khoom, cov khoom raug nqi txog USD 3.50
- 20 x 45 hli ob tog PCB, daim ntawv qhia tau sib xws
- 5 V kam rau RX tus pin
- voltage input los ntawm 12 V rau 3.3 V, tam sim no kos txog 80 mA ntawm qhov nruab nrab
Kuv tau siv cov laug cam no txog ib nrab xyoo tam sim no thiab kuv pom lawv muaj txiaj ntsig heev. Kuv tseem nyiam lawv rau USB-UART txuas hniav, vim tias nrog kuv lub rooj tsavxwm, kuv tsuas yog ntsaws ib qho ntawm lawv mus rau hauv lub khob cij thiab kuv tsis tas yuav txhawj xeeb txog kev siv cov xov hluav taws xob hla kuv lub rooj. Koj kuj tsis muaj lwm yam kho vajtse, tsis muaj chaw nres nkoj USB dawb thiab cov laug cam no muab kev sib cais tag nrho los ntawm koj lub khoos phis tawj, uas yog kev tiv thaiv kev nyab xeeb zoo thiab koj tsis tas yuav txhawj xeeb txog qhov peev txheej hauv av.
Kauj Ruam 1: Nws Ua Haujlwm Li Cas
Thaum lub zog siv rau tus qauv, nws pib sim txuas mus rau WiFi ua ntej ua ntej. Lub sijhawm ntawd, lub teeb daj daj yog ntsais muag. Thaum nws txuas, lub teeb daj daj nyob twj ywm. Tom qab ntawd, tus qauv tau tos kom muaj kev sib txuas los ntawm Telnet tus neeg siv khoom (saib cov kauj ruam tom ntej) thiab LED ntsuab tab tom ntsais muag. Tom qab kev sib txuas tau ua tiav tiav, Telnet lub davhlau ya nyob twg qhia koj tam sim, nug txog qhov xav tau baudrate. Koj nkag mus rau baudrate rau hauv lub davhlau ya nyob twg thiab koj ua tiav! Tam sim no txhua yam uas koj ntaus rau hauv lub davhlau ya nyob twg tau xa hla WiFi thiab tom qab ntawd nws tau tawm los ntawm TX tus pin ntawm ESP8266. Ib yam nkaus, txhua yam uas tshwm ntawm RX tus pin raug xa mus rau lub davhlau ya nyob twg. Yeej, koj tsis tuaj yeem qhia qhov sib txawv ntawm cov lej thiab telnet console.
LEDs:
- daj (sab laug) - Wifi xwm txheej, ntsais muag - sim txuas, teeb - txuas nrog
- ntsuab (thib ob ntawm sab laug) - Telnet xwm txheej. ntsais muag - tos kev txuas, ntsuab - txuas
- xiav (ob sab xis) - RX thiab TX
Kauj Ruam 2: Yuav Teeb Li Cas
Kev sib txuas
Tsuas yog qhov nyuaj me ntsis yog tias koj xav tau qee yam ntawm tus cim rau txhua lub Telnet ntaus ntawv (zoo ib yam rau txhua qhov chaw nres nkoj uas muaj tus lej). Hauv kuv qhov project kuv siv Static IP. Feem ntau, thaum lub cuab yeej txuas rau WiFi, nws tau txais tus IP chaw nyob los ntawm DHCP server. Qhov no hu ua IP chaw nyob, tab sis qhov teeb meem ntawm no yog qhov IP chaw nyob yuav hloov. Yog li kuv tau teeb tsa pawg thawj coj hauv txoj hauv kev uas nws ib txwm tau txais tus IP chaw nyob ua ntej, hauv kuv qhov xwm txheej 192.168.2.20x, qhov x yog tus lej xov tooj. Qhov no hu ua Static IP addressing. Tom qab ntawd koj tsuas yog txuas Telnet console rau 192.168.2.20x: 23 thiab koj npaj txhij mus.
Raws li lub console koj tuaj yeem siv ntau yam apps, ob qhov paub zoo tshaj yog tej zaum PuTTY lossis YAT (Tseem Muaj Lwm Qhov Chaw). Kuv siv qhov kawg thiab hauv daim duab koj tuaj yeem pom yuav teeb tsa nws li cas - koj tsuas yog xav paub qhov chaw nyob IP zoo li qub.
Firmware
Lub firmware tau sau hauv Arduino IDE thiab koj tuaj yeem pom nws ntawm kuv GitHub. Yog tias koj xav ua haujlwm rau koj li ESP8266, koj yuav tsum tau saib rau hauv lub taub hau thiab hloov qee qhov hloov pauv muaj, uas yog:
- ssid - lub npe ntawm WiFi koj xav kom pawg thawj coj saib txuas
- hla - tus password rau qhov WiFi ntawd
- ip - IP zoo li qub uas koj xav kom pawg thawj coj muaj; xaiv qee yam sab nraum ntawm DHCP pas dej (lossis tsuas yog xaiv qee yam ntawm 200 - 250, uas feem ntau yog pub dawb)
- rooj vag - tus IP ntawm koj lub router
- subnet
Koj tuaj yeem tau txais ob yam ntaub ntawv kawg los ntawm kab hais kom ua, los ntawm nias Win + R, ntaus hauv "cmd" thiab tom qab ntawv ntaus "ipconfig". Saib cov duab.
Tau kawg koj xav tau Arduino IDE, esp8266 toolchain thiab lwm yam, tab sis muaj ntau lwm yam kev qhia txog qhov ntawd.
Pawg Thawj Coj
Koj kuj yuav tsum tsim cov PCB. Thaum nws tsis nyuaj thiab koj tuaj yeem ua haujlwm raws li kev xav hauv tsev, Kuv pom zoo kom koj siv qee qhov chaw tsim khoom PCB Suav. Nws yog pheej yig thiab ua haujlwm zoo. Kuv siv ALLPCB thiab txaus siab.
Fais fab
Koj yuav tsum tau muab lub zog rau pawg thawj coj saib. Koj tuaj yeem yog lub zog ncaj qha nrog 3.3 V (jumper JP1 hauv 3.3 V txoj haujlwm) lossis pub qhov hluav taws xob hla 3.3 V tus tswj hwm (jumper hauv lwm txoj haujlwm). Tus tswj hwm tuaj yeem lees txais qhov hluav taws xob mus txog 12 V. Txhua lub capacitors twb tau koom ua ke hauv nkoj.
Kauj Ruam 3: Xaus
Raws li kuv tau hais ua ntej, Kuv pom cov laug cam no muaj txiaj ntsig zoo rau kev tsim qauv, tsis yog nrog Arduino, tab sis nrog ib qho MCU feem ntau. Thiab kuv tau siv lawv li ntawm ib nrab xyoo tam sim no thiab kuv tsis muaj teeb meem nrog lawv.
Cov peev txheej, cov ntaub ntawv Dav dawb hau thiab qee cov duab tuaj yeem pom ntawm kuv GitHub lossis hauv cov ntawv zip hauv qab no. Tab sis kuv pom zoo GitHub, vim tias tej zaum yuav muaj qhov hloov tshiab.
Yog tias koj muaj lus nug, lus pom lossis tswv yim, tsis txhob tso lawv hauv qab no.
Pom zoo:
Tus Nqi ESP8266 WiFi Shield rau Arduino thiab Lwm Yam Me Me: 6 Cov Kauj Ruam (nrog Duab)
Tus Nqi ESP8266 WiFi Shield rau Arduino thiab Lwm Yam Me Me: Hloov Kho: 29th Oct 2020Tested nrog ESP8266 board library V2.7.4 - worksUpdate: 23rd Sept 2016Do Not use the Arduino ESP board library V2.3.0 for this project. V2.2.0 worksUpdate: 19th May 2016Rev 14 ntawm qhov haujlwm no kho kho cov tsev qiv ntawv thiab cov cai kom ua haujlwm w
Tsis siv neeg Catapult rau Pov Cov Khoom Noj (dev, miv, Qaib, thiab lwm yam), Pov Pob thiab Ntau Ntxiv!: 4 Cov Kauj Ruam (nrog Duab)
Tsis siv neeg Catapult rau Zaub Zaub Tsiaj (dev, Miv, Qaib, Etc), Pov Pob thiab Ntau Ntxiv!: Nyob zoo thiab txais tos rau kuv thawj Qhov Kev Qhia! Kuv tau tsim txoj hauv kev kom qeeb qhov no, los ntawm cov npas nrog cov zaub mov sab hauv los pov nws thoob plaws lub tiaj nraum qaum tsev. Amazingly, nws yog
Tsim Arduino Rau Hauv Nissan Qashqai rau Automate Wing Mirror Folding lossis Lwm Yam Ntxiv: 9 Cov Kauj Ruam (nrog Duab)
Tsim Arduino Rau Hauv Nissan Qashqai rau Automate Wing Mirror Folding lossis Lwm Yam Ntxiv: Nissan Qashqai J10 muaj ob peb yam me me cuam tshuam txog kev tswj hwm uas tuaj yeem yooj yim dua. Ib ntawm lawv yog yuav tsum nco ntsoov thawb lub iav qhib/kaw hloov ua ntej coj tus yuam sij tawm ntawm qhov hluav taws. Lwm qhov me me teeb tsa
DIY Pheej Yig thiab Lwm Yam Rau Flex Sensor Hnab looj tes: 8 Kauj Ruam (nrog Duab)
DIY Pheej Yig thiab Lwm Yam Rau Flex Hnab looj tes: Nyob Zoo Txhua Tus, Nov yog kuv thawj zaug qhia thiab hauv qhov kev qhia no kuv yuav qhia koj kom ua kom pheej yig thiab raug qhov tseeb flex sensor hnab looj tes. Kuv tau siv ntau txoj hauv kev los hloov lub sensor, tab sis tsis muaj leej twg ua haujlwm rau kuv. Yog li, kuv tau tshawb nrhiav thiab pom qhov tshiab
Tes Thib Peb ++: Kev Siv Tes Siv Ntau Rau Cov Khoom Siv Hluav Taws Xob thiab Lwm Yam Ua Haujlwm Zoo: 14 Kauj Ruam (nrog Duab)
Tes Thib Peb ++: Kev Siv Tes Siv Ntau Rau Cov Khoom Siv Hluav Taws Xob thiab Lwm Yam Ua Haujlwm Tsis Zoo: Yav dhau los Kuv tau siv tes thib peb/pab txhais tes muaj nyob ntawm cov khw muag khoom hluav taws xob thiab tau poob siab nrog lawv qhov siv tau. Kuv tsis tuaj yeem tau txais cov yeeb yaj kiab raws qhov kuv xav tau lossis nws siv sijhawm ntau dua qhov nws yuav tsum tau teeb tsa