Cov txheej txheem:

Android Tsev (tswj Koj Lub Tsev Los Ntawm Koj Lub Xov Tooj): 4 Cov Kauj Ruam
Android Tsev (tswj Koj Lub Tsev Los Ntawm Koj Lub Xov Tooj): 4 Cov Kauj Ruam

Video: Android Tsev (tswj Koj Lub Tsev Los Ntawm Koj Lub Xov Tooj): 4 Cov Kauj Ruam

Video: Android Tsev (tswj Koj Lub Tsev Los Ntawm Koj Lub Xov Tooj): 4 Cov Kauj Ruam
Video: Plab Plab Ntswg..(Pluav Pluav Ntswg) Maiv Twm New Song 2023-2024 2024, Kaum ib hlis
Anonim
Image
Image
Android Tsev (tswj Koj Lub Tsev Los Ntawm Koj Lub Xov Tooj)
Android Tsev (tswj Koj Lub Tsev Los Ntawm Koj Lub Xov Tooj)
Android Tsev (tswj Koj Lub Tsev Los Ntawm Koj Lub Xov Tooj)
Android Tsev (tswj Koj Lub Tsev Los Ntawm Koj Lub Xov Tooj)

Kuv txoj kev npaj zaum kawg yog kom muaj kuv lub tsev nyob ntawm kuv lub hnab ris, nws cov hloov pauv, lub ntsuas pa thiab kev nyab xeeb. thiab tom qab ntawd pib sib koom nws

Taw qhia: Nyob zoo Ich bin zakriya thiab "Android tsev" no yog kuv txoj haujlwm, txoj haujlwm no yog thawj zaug los ntawm plaub qhov kev qhia ua ntej, Hauv qhov no Qhia Peb yuav kawm paub siv Mqtt nrog rau ntawm Mcu Esp 8266 los tswj thiab saib xyuas qee qhov hloov pauv los ntawm txhua qhov chaw thoob ntiaj teb. rau tus tswj hwm peb yuav tsim ib qho app hauv MIT app inventor. Hauv cov phiaj xwm tom ntej peb yuav ntxiv cov ntsuas ntsuas, lub koob yees duab thiab tom qab ntawd thaum kawg siv lub tshuab.

Yuav muaj peb theem pib rau DIY nws.

kauj ruam 1: Txhim kho Android daim ntawv thov: Peb yuav koj qhib qhov online software MIT tus neeg tsim khoom los tsim lub app.

Kauj Ruam 2: Teeb tsa ntawm MCU Esp 8266: nws suav nrog ob ntu, ib qho yog teeb tsa kho vajtse thiab lwm qhov yog ua haujlwm ntawm lub node.

kauj ruam 3: Nkag siab Mqtt thiab ua haujlwm nrog nws: hauv theem no peb yuav nkag siab cov txheej txheem yooj yim thiab kawm paub siv teeb tsa.

Lub sijhawm ntau tshaj los hloov tus coj yog kwv yees li 0.68 sec.

Khoom siv:

1-one node Mcu esp 8266: https://www.ebay.com/itm/Node-MCU-V3-2-Arduino-ESP8266-ESP-12-E-Lua-CH340-WiFI-WLan-IoT-Lolin- Micro-flYfE/174098423523? Hash = item2889131ee3: g: xKQAAOSwHu5cHIhE

2-ib yim channel relay module: https://www.ebay.com/itm/5V-eight-8-Channel-Relay-Module-For-PIC-AVR-DSP-ARM-Arduino-CAPT2011/223308111375?hash= item33fe335e0f: g: ZTsAAOSwbc5augET

3- lub zog sab nraud 5v (2A)

Kauj ruam 1: Txhim Kho Android Daim Ntawv Thov

Txhim Kho Daim Ntawv Thov Android
Txhim Kho Daim Ntawv Thov Android
Txhim Kho Daim Ntawv Thov Android
Txhim Kho Daim Ntawv Thov Android

Tsim daim ntawv thov hauv MIT app tus tsim tawm yog yooj yim heev. koj tsuas yog yuav tsum ntsaws thiab ua si. cov duab kab lus txuas nrog.

Ua hauj lwm:

1- Thaum twg los xij lub app tau pib, tau xa xov mus rau Node Mcu Esp8266 "data_request"

2- Thaum twg nws tau txais qee cov lus (Hauv daim ntawv "1-0" uas txhais tau tias ib qho tawm), APP sib piv nws thiab teeb Cov Xim ntawm cov nyees khawm kom raug.

3- thaum twg lub pob raug nias yog nws xa xov los hloov lub xeev ntawm lub pob ntawd hauv node mcu "xeev " npe.

thiab tig khawm grey. (nws tau txais tam sim no xim los ntawm cov lus mcu lus)

Kho cov ntaub ntawv Aia:

Kauj Ruam 2: Kauj Ruam 2 (a): Teeb Node Mcu Esp2866

Kauj Ruam 2 (a): Teeb Node Mcu Esp2866
Kauj Ruam 2 (a): Teeb Node Mcu Esp2866
Kauj Ruam 2 (a): Teeb Node Mcu Esp2866
Kauj Ruam 2 (a): Teeb Node Mcu Esp2866

TSHOOJ 1: Tshooj Kho Vajtse

kho vajtse yog ncaj ncaj rau pem hauv ntej ua raws li cov txheej txheem thiab koj zoo mus tab sis koj zoo mus.

Nco tseg: ntawm mcu cov lej pin tso tawm 3.3v qib kev xav, uas tsis txaus rau lub rooj xa xov, yog li koj xav tau lub zog hluav taws xob sab nraud, uas yuav ua rau lub zog txuas ntxiv nrog rau lub node. Lub zog hluav taws xob sab nraud yuav tsum muaj tsawg kawg yog (5v, 2A)

tus pin txuas tau hais hauv daim duab.

Kauj Ruam 3: Kauj Ruam 2 (b): teeb tsa lub Node Mcu

Kauj Ruam 2 (b): kev teeb tsa Node Mcu
Kauj Ruam 2 (b): kev teeb tsa Node Mcu
Kauj Ruam 2 (b): kev teeb tsa Node Mcu
Kauj Ruam 2 (b): kev teeb tsa Node Mcu

step1: teeb tsa esp 8266 board hauv arduino ide

Step2: xaiv txoj cai com pin.

kauj ruam 3: rub tawm "Relay_control.ino thiab khiav nws"

kauj ruam 4: teeb tsa cov tsev qiv ntawv muab rau arduino lub tswv yim. "Adafruit_MQTT.h"

kauj ruam 5: hlawv nws rau hauv koj lub node mcu

nco tseg: tsis txhob hnov qab ntxiv koj li issd, password, topic_cmd thiab topic_state hauv qhov program.

nco tseg: txoj haujlwm tau hais tawm zoo thiab vam tias nws yuav yooj yim, tab sis yog tias koj tsis meej pem txhua qhov chaw qhia rau kuv paub

Kauj Ruam 4: Kauj Ruam 3: nkag siab Mqtt

Kauj Ruam 3: nkag siab Mqtt
Kauj Ruam 3: nkag siab Mqtt

Mqtt (Message Queuing Telemetry Transport) yog lub teeb yuag xa xov txheej txheem rau cov cuab yeej los sib tham, nws muaj peb ntu tseem ceeb.

1. Subscriber: Subscriber yog tus ntaus ntawv uas koom nrog mqtt server kom tau txais cov ntaub ntawv thiab lus los ntawm server

2.publisher: Publisher yog lub cuab yeej uas koom nrog mqtt server kom xa cov lus lossis cov ntaub ntawv ntawm server

3.broker: broker yog tus server, uas khaws thiab saib xyuas cov lus los ntawm cov tshaj tawm rau cov neeg siv khoom.

tshaj tawm, cov neeg rau npe tseem paub tias yog tus neeg siv khoom ntawm lub server ntawd

tus broker tuaj yeem muaj ntau tus neeg rau npe thiab tshaj tawm

QHIA LI CAS:

ib tus tswv lag luam yuav muaj ntau txhiab qhov kev zaws, txhawm rau kom hloov pauv cov lus, tus tshaj tawm yuav xa cov ntaub ntawv nws cov lus mus rau qhov chaw nyob tshwj xeeb, ntawm tib qhov chaw nyob tus neeg siv yuav tau txais cov lus ntawd. qhov chaw nyob ntawd hu ua ntsiab lus. Hauv peb txoj haujlwm wi yuav tsum muaj cov ncauj lus, 1 lub xeev rau node mcu tshaj tawm thiab txawb rau npe thiab ib qho rau cmds

rau androids tshaj tawm thiab node rau npe.

Thaum kawg: rub tawm.apk cov ntaub ntawv (uas tseem tsis tau tso cai rub tawm) koj yuav mus rau "MIT APP INVENTOR". tsim tus account, thauj khoom.aia hom thiab tom qab ntawd rub tawm.apk los ntawm "tsim"

Yog tias koj muaj hom lus nug lossis lus nug qhia rau kuv paub, thiab kuv xav paub yog tias koj xav kom kuv ua haujlwm rau koj ntawm koj qhov project.

Pom zoo: