Cov txheej txheem:

WiFi Txuas Hluav Taws Xob-DIY: 5 Kauj Ruam
WiFi Txuas Hluav Taws Xob-DIY: 5 Kauj Ruam

Video: WiFi Txuas Hluav Taws Xob-DIY: 5 Kauj Ruam

Video: WiFi Txuas Hluav Taws Xob-DIY: 5 Kauj Ruam
Video: Tswv Yexus lub neej thaum pib txug thaum xaus 2024, Hlis ntuj nqeg
Anonim
WiFi Txuas Hluav Taws Xob-DIY
WiFi Txuas Hluav Taws Xob-DIY
WiFi Txuas Hluav Taws Xob-DIY
WiFi Txuas Hluav Taws Xob-DIY
WiFi Txuas Hluav Taws Xob-DIY
WiFi Txuas Hluav Taws Xob-DIY
WiFi Txuas Hluav Taws Xob-DIY
WiFi Txuas Hluav Taws Xob-DIY

Tam sim no, cov khoom siv IoT uas tau sim tshaj plaws los ua cov qauv uas tsuas yog ntsaws ua ke ntau dua li cov khoom siv ib leeg. Cov neeg siv hluav taws xob tshiab, xyaum ua cov kws tshaj lij, thiab muaj kev paub tes zoo ib yam kom ntseeg tau tias cov qauv no pheej yig txaus nyiam. Hauv phau ntawv qhia no, kuv qhia koj yuav ua li cas thiaj li siv lub qhov hluav taws xob phab ntsa zoo ib yam thiab ntxiv kev txawj ntse siv cov pawg uas npaj tau yooj yim thiab siv tau yooj yim siv cov qauv ua ntej txuas. Raws li kuv tau tsim txoj haujlwm no hauv ib qho kev hloov pauv, koj tuaj yeem sim tsim tag nrho txoj haujlwm raws li nws yog lossis ib feem ntawm nws lossis tseem txuas ntxiv txoj haujlwm no nrog kev ua haujlwm ntau dua. Zoo, npaj kom ntxiv kev nkag tau yooj yim, txawj ntse, thiab txuas rau koj lub qhov hluav taws xob phab ntsa zoo ib yam.

Kauj Ruam 1: Khoos phis tawj tseem ceeb

Hardware tseem ceeb
Hardware tseem ceeb

 ESP8266 WiFi (5V/1 Channel) Relay Module x1

 Hi-Link HLK-PM01 (5V/3W) SMPS Module x1

Thawj qhov-WiFi Relay Module yog qhov tsis sib xws ntawm ESP8266 (ESP-01) WiFi SoC, onboard 3.3V tswj IC (AMS1117-3.3), STC15F104 microcontroller, thiab 5V SPDT (1C/O) relay. ESP8266 WiFi SoC yog daim npav ntsaws nrog 8-tus pin header, thiab 4-pin header ntawm ntug ntawm Wifi Relay Module ua haujlwm raws li kev sib txuas yooj yim rau teeb tsa/teeb tsa WiFi Relay Module nrog kev pab ntawm koj PC. Qhov thib ob yog qhov sib zog AC-DC lub zog hluav taws xob muab cov khoom ruaj khov 5V/600mA dc tso tawm los ntawm ib txwm AC230V tsev neeg cov khoom siv hluav taws xob. Cov khoom siv hluav taws xob kaw no (ua raws li UL, CE cov tseev kom muaj) tshwj xeeb tshaj yog tsim rau IoT cov cuab yeej/phiaj xwm.

Kauj Ruam 2: Teeb Khoom Kho Vajtse

Teeb Khoom Kho Vajtse
Teeb Khoom Kho Vajtse

Raws li tuaj yeem pom los ntawm kab duab kab lus qhia hauv qab no, kev teeb tsa kho vajtse yog yooj yim heev thiab yuav tsum tau ua haujlwm me me xwb. Ceev faj, sai li sai tau L / N (~ 230V) txuas nrog thiab lub zog hluav taws xob tau thov, tsis txhob kov lub cuab yeej liab qab!

Thov nco ntsoov tias yam tsis muaj qhov thaiv kom raug, ib qho khoom siv txuas nrog tsis muaj kev nyab xeeb siv vim muaj qhov pheej hmoo raug hluav taws xob ua rau raug mob. Yog li nws tau pom zoo kom txhim kho cov khoom sib dhos sab hauv hauv qhov pov thawj ABS/Grounded Metal enclosure, ntawm qhov muaj txaus qhov cua qhov.

Kauj ruam 3: Debugging Software

Debugging Software
Debugging Software

Ua ntej siv thawj zaug, WiFi Kev Tshawb Fawb tus qauv yuav tsum tau teeb tsa nrog kev pab ntawm '3.3V Qib USB rau TTL adapter' thiab 'USR-TCP232-Test-V1.3' cov tswv cuab kev debugging software. Txog qhov no, txuas TX-RX-GND pins ntawm USB rau TTL adapter rau RX-TX-GND pins ntawm 4-pin header (saib daim duab tom ntej). Tsis tas li nco ntsoov txhawb lub zog ntaus ntawv, thiab tsim kom muaj tus lej baud ntawm 9600. Tom ntej no, qhib Serial Debugging software (USR-TCP232-Test-V1.3) ntawm lub PC kom xa tag nrho cov lus txib AT cov lus teev tseg hauv qab no.

+AT+CWMODE = 2

+AT+RST

+AT+CIPMUX = 1

+AT+CIPSERVER = 1,8080

+AT+CIFSR

AT+CIOBAUD = 9600

Yog tias nws tsis xa rov qab OK thiab tsuas yog xa cov lus txib uas koj tau xa mus, tom qab ntawd nyem ENTER qhov tseem ceeb ua ntej xa AT cov lus txib (piv txwv li AT+RST> ENTER> Xa). Nco ntsoov, tus qauv xav tau rov teeb tsa yog tias rov pib dua piv txwv li koj yuav tsum rov kho lub module los ntawm kev debugging software los ntawm kev xa qee cov lus txib. Hauv ntej, CIPMUX thiab CIPSERVER yuav tsum tau thov dua!

Kauj ruam 4: Android App

Android App Cov
Android App Cov

Txog kev tswj chaw taws teeb siv lub xov tooj Android, koj yuav tsum rub tawm thiab teeb tsa dawb ‚EasyTCP (v4.4)‛ Android app ntawm koj lub xov tooj ntse

Tom ntej no, qhib lub app, nyem ‚Txuas‛ thiab nkag mus rau ‚IP chaw nyob‛ (192.168.4.1) thiab ‚Chaw nres nkoj‛ (8080). Nias thiab tuav khawm hloov kom nkag mus rau lub npe thiab cov ntsiab lus ntawm cov lus txib hauv hom hex (A00101A2 relay_on, A00100A1 relay_off). Thaum kawg koj tuaj yeem xa cov lus txib los ntawm lub app rau kev tswj hwm kev siv uas tau hais ua ntej khawm hloov. Ntawm no, lub teeb liab tshaj plaws ntawm cov kab ke ua haujlwm hauv AP (nkag mus rau qhov chaw) hom yog haum ze rau 400 metres hauv ib puag ncig qhib.

Kauj Ruam 5: Cov ntawv ntxiv

Cov ntawv ntxiv
Cov ntawv ntxiv

Ib yam uas kuv tsis nyiam: Thaum kuv pom Wi-Fi Relay module (LC-WM-Relay-8266-5V) ntawm eBay ua ntej, Kuv tau xav tsis thoob vim nws yooj yim/hneev taw thiab yog li xaj ob peb ntawm lawv nrawm. Txawm li cas los xij, tom qab qee qhov kev sim kuv tau poob siab heev los ntawm qhov teeb meem npau taws heev. Txij li TCP neeg rau zaub mov yuav tsis txuag rau hauv flash, nws xav tau kev teeb tsa tshiab ntawm AT cov lus txib tom qab txhua lub zog caij tsheb kauj vab/ rov pib dua/ rov pib dua. Yog li kuv tso tseg lub tswv yim ntawm kev tsim cov neeg siv khoom kawg ua tiav rau kuv tus neeg nyob ze zoo nkauj, raws li qhov uas hu rau lub xyoo tsis muaj kev cuam tshuam cov khoom siv hluav taws xob. Lwm qhov kuv yuav tsum ua cov kauj ruam los hloov cov khoom lag luam ntawm STC15F104 microcontroller (https://www.stcmcu.com/datasheet/stc/STC/STC-AD-PDF/STC15F101E-series-english.pdf) nrog lwm txoj haujlwm los xa cov lus txib ntawd los ntawm uC ntawm txhua qhov pib (raug nplua hnyav). Vam tias qee leej yuav xav txog qhov no thiab qhia rau kuv paub yog tias muaj ib qho kev daws teeb meem ua haujlwm tau.

Rau qhov kaw qhov ua txhaum Wi-Fi Relay Module, koj yuav xav tau tus programmer STC, thiab STC ISP lossis lwm tus stcgal. Nov yog qhov txuas ntawm cov tswv yim zoo sib xws: Tsis tas li ntawd, kuv tau yuav qee qhov MCU STC15F104W Kev Txhim Kho Kev Txhim Kho los ntawm tus neeg muag khoom Suav tsis ntev los no. Tsuas yog lwm qhov kev xav tsis thoob me me nyob hauv tis (tos nws)!

Pom zoo: