Cov txheej txheem:

Tswj Tsev Teeb Nrog Google Assistant Siv Arduino: 7 Cov Kauj Ruam
Tswj Tsev Teeb Nrog Google Assistant Siv Arduino: 7 Cov Kauj Ruam

Video: Tswj Tsev Teeb Nrog Google Assistant Siv Arduino: 7 Cov Kauj Ruam

Video: Tswj Tsev Teeb Nrog Google Assistant Siv Arduino: 7 Cov Kauj Ruam
Video: $600 NYIAJ PAB CA * $3600 CHILD TAX * BIDEN SPEECH * INDIA KAB MOB HNYAV * TOP NEWS+ 04/29/2021 2024, Hlis ntuj nqeg
Anonim
Tswj Tsev Teeb Nrog Google Assistant Siv Arduino
Tswj Tsev Teeb Nrog Google Assistant Siv Arduino
Tswj Tsev Teeb Nrog Google Assistant Siv Arduino
Tswj Tsev Teeb Nrog Google Assistant Siv Arduino
Tswj Tsev Teeb Nrog Google Assistant Siv Arduino
Tswj Tsev Teeb Nrog Google Assistant Siv Arduino
Tswj Tsev Teeb Nrog Google Assistant Siv Arduino
Tswj Tsev Teeb Nrog Google Assistant Siv Arduino

(Hloov kho raws li 22 Lub Yim Hli 2020: Cov lus qhia no muaj 2 xyoos thiab tso siab rau qee cov apps thib peb. Ib qho kev hloov pauv ntawm lawv ib sab yuav ua rau txoj haujlwm no tsis ua haujlwm. Nws yuav lossis tsis ua haujlwm tam sim no tab sis koj tuaj yeem ua raws li kev siv thiab hloov kho kom haum.)

Nyob zoo! Nov yog thawj qhov kev qhia uas kuv yuav qhia yuav ua li cas peb tuaj yeem tswj lub teeb ntawm peb lub tsev nrog peb lub suab los ntawm Google lub suab pab siv Arduino. Tsis yog nws lub suab txias los hloov thiab teeb lub tsev tsuas yog los ntawm kev hais kom Google lub suab pab uas tej zaum peb txhua tus muaj hauv peb lub xov tooj.

Yog li cia pib nrog Cov Lus Qhia. Instrucable no tsis txwv rau lub teeb nkaus xwb tab sis koj tuaj yeem tswj hwm cov khoom siv hauv koj lub tsev. Peb yuav siv qhov "relay module" hauv txoj haujlwm no vim tias peb tab tom cuam tshuam nrog AC tam sim no.

Nco tseg: Ua kom koj muaj kev nyab xeeb ua ntej thiab ua raws li koj tus kheej txoj kev pheej hmoo raws li AC tam sim no hauv peb lub tsev ua haujlwm ntawm qhov hluav taws xob siab ntawm 100V txog 250V (sib txawv rau ntau lub tebchaws).

Kauj ruam 1: Yam yuavtsum tau kawm uantej

Nws yuav muaj txiaj ntsig yog tias koj ua tiav cov hauv qab no ua ntej pib:

1) IFTTT tus lej (Koj tuaj yeem tso npe rau tus lej pub dawb ntawm lawv lub vev xaib lossis app)

Nco tseg: Sau npe nrog tib tus E-mail id uas cuam tshuam nrog Google Assistant

2) Blynk tus lej (Koj tuaj yeem tso npe rau tus as khauj dawb los ntawm rub tawm blynk app)

3) Android ntaus nrog Google Assistant (Khiav Marshmallow 6.0 lossis siab dua, kuv yog 6.0)

Nco tseg: IOS ntaus ntawv tuaj yeem siv nrog Google Assistant hauv nws tab sis kuv tus kheej tsis tau sim nws.

4) Windows PC nrog 'Arduino IDE' teeb tsa

Ua siab zoo saib cov npe ntawm cov khoom xav tau hauv qib tom ntej.

Kauj Ruam 2: Cov Cheeb Tsam Xav Tau (nrog Cov Lus Qhia Tshwj Xeeb)

Cov Cheeb Tsam Yuav Tsum Tau (nrog Cov Lus Qhia Ceev)
Cov Cheeb Tsam Yuav Tsum Tau (nrog Cov Lus Qhia Ceev)
Cov Cheeb Tsam Yuav Tsum Tau (nrog Cov Lus Qhia Ceev)
Cov Cheeb Tsam Yuav Tsum Tau (nrog Cov Lus Qhia Ceev)
Cov Cheeb Tsam Yuav Tsum Tau (nrog Cov Lus Qhia Ceev)
Cov Cheeb Tsam Yuav Tsum Tau (nrog Cov Lus Qhia Ceev)

Cov npe ntawm cov khoom siv xav tau:

1) Arduino Uno R3 micro-controller board (Quantity: 1)

2) ESP8266 ESP-01 WiFi module (Quantity: 1)

3) Relay module (Tib Channel 5V) (Quantity: 1)

4) Jumper Wires (Quantity: Raws li qhov xav tau)

5) AC Bulb, Lub qhov (socket) lub teeb thiab cov xov hluav taws xob (Quantity: 1 Bulb, 1 lub qhov (socket), Hluav taws xob xaim ntawm qhov ntev raws li xav tau.)

1) Arduino Uno R3 micro-controller board: Feem ntau tej zaum koj yuav paub nrog Arduino micro-controllers. Rau cov uas tsis yog, koj tuaj yeem xav tias nws yog ib qho tseem ceeb hauv feem ntau ntawm koj li IoT (Internet ntawm Yam) cov haujlwm. Hauv qhov haujlwm no kuv tau siv "Arduino Uno". ATmega328 raws MCU. Nws muaj 14 digital I/O pins (ntawm uas 6 tus pin tuaj yeem siv rau PWM cov zis), 6 analog input pins, ua haujlwm ntawm 5V thiab cov khoom siv hluav taws xob sib txawv ntawm 7V-20V, 20 MHz moos nrawm nrog 32 kb flash nco.

Peb tuaj yeem txuas ntau yam kev ntsuas rau nws thiab tso peb cov laj thawj hauv tus lej kom tau txais kev ua haujlwm tau zoo los ntawm cov ntsuas hluav taws xob thiab xa daim duab kawg rau Arduino los ntawm 'Arduino IDE'.

2) ESP8266 ESP-01 WiFi module: ESP8266 ESP-01 yog tus qauv WiFi uas pheej yig tshaj plaws thiab peb siv nws los txuas peb lub micro-controller mus rau WiFi network thiab ua TCP/IP sib txuas me me. Nws muaj 8 tus pin ntawm Chip uas yog Av, TX, GPIO-2 (Lub hom phiaj dav I/O), CH_EN (Chip Enable), GPIO-0, Reset, RX, Vcc. Nws ua haujlwm ntawm +3.3v fais fab mov.

3) Relay module: Kuv tau siv tib channel 5V relay module ntawm no. Nws muaj 3 tus pin rau kev txuas nrog Arduino thiab 3 chaw nres nkoj los txuas cov khoom siv. Vcc tus pin tau siv los txuas lub zog txuas nrog 5V, tus pin hauv av, IN tus pin rau cov tswv yim digital. 3 cov chaw nres nkoj yog COM (ib txwm muaj), TSIS YOG (ib txwm qhib), NC (ib txwm kaw) kom muaj zog rau cov khoom siv (piv txwv li lub teeb).

4) Jumper Wires: Rau kev txuas nrog Arduino. Koj tuaj yeem yuav cov txiv neej rau txiv neej, poj niam rau poj niam, txiv neej rau poj niam jumper xov hlau los ntawm amazon lossis lwm qhov kev lag luam ntawm koj tus chioce.

5) AC Bulb, Lub qhov hluav taws xob qhov hluav taws xob thiab cov xov hluav taws xob: Rau kev txuas ntawm lub qhov (socket) nrog cov qauv xa tawm. Koj tuaj yeem nrhiav cov khoom no tau yooj yim hauv koj lub tsev lossis cov khw nyob ze.

Kauj Ruam 3: Kho Blynk App

1) Qhib thiab nkag mus rau Blynk app.

Koj yuav tau txais 2000 lub zog tshuav uas yuav siv los ntxiv cov khoom siv. Lub zog no tuaj yeem txuas ntxiv tau ntawm kev tshem tawm cov cuab yeej tab sis koj yuav tsis tau txais nws rov qab yog tias koj qhia nws. Yog li siv nws ntse.

2) Tsim 'Txoj Haujlwm Tshiab' thiab npe nws txhua yam koj xav tau.

3) Xaiv 'Arduino Uno' los ntawm cov npe khoom thiab txuas hom li 'WiFi', xaiv koj lub ntsiab lus thiab nyem rau 'Tsim'.

4) Koj yuav tau txais E-mail nrog koj daim ntawv tso cai. Ua siab zoo sau cia.

5) Tam sim no nyem rau + kos npe rau saum thiab ntxiv ib lub khawm.

6) Nyem rau khawm thiab teeb tus pin rau 'Digital' thiab 'D7'. Teeb tus lej tus lej rau 1 thiab 0 feem. (Cov lus nug yuav tshwm sim hauv koj lub siab ntawm no yog vim li cas kuv thiaj teeb tsa nws rau (1, 0) tsis yog (0, 1)? Teeb hom hloov mus rau 'Laub' thiab npe txhua daim ntawv raws li koj nyiam.

7) Ib zaug ntxiv nyem rau + kos npe thiab ntxiv cov ntawv nkag.

8) Nyem rau ntawm Cov ntawv nkag thiab teeb 'Output' tus pin rau V0, 'Tus lej txwv' mus rau 5 thiab koj tuaj yeem sau npe lwm cov teb raws li koj nyiam.

9) Qhib cov lus txib tam sim ntawm koj lub PC nrog siv Internet txuas thiab ntaus cov lus txib hauv qab no:

ping blynk-cloud.com

Nco tseg tus IP chaw nyob uas zoo ib yam li qhov no

188.166.206.43

Nws yog IP chaw nyob ntawm blynk server rau koj lub tebchaws.

Tam sim no txav mus rau kauj ruam tom ntej rau tsim IFTTT applet.

Kauj Ruam 4: Tsim IFTTT Applet

Tej zaum koj twb tau tsim koj tus lej nyiaj hauv IFTTT.com lossis ntawm IFTTT app. Yog tsis yog, thov koj tsim nws.

Cov kauj ruam rau tsim IFTTT applet rau Google Assistant:

1) Ua raws cov lus qhia hauv qab txuas nrog rau cov kauj ruam uas kuv hais txog ntawm no:

Yuav Ua Li Cas Tsim IFTTT applet?

2) Tsim kom muaj:

i) Tshawb nrhiav Google Assistant hauv kab ntawv tshawb nrhiav thaum tsim qhov tshwm sim.

ii) Xaiv 'Hais ib kab lus nrog cov ntawv sau'

iii) Koj tuaj yeem nkag mus rau peb txoj hauv kev los hais koj cov kab lus. Sau koj cov kab lus nrog cov ntawv sau. Piv txwv li kuv tau nkag mus 'tig $ teeb'. Ntawm no, xijpeem kuv yuav hais qhov chaw ntawm $ yuav yog cov ntawv sau. Kuj sau cov kab lus koj xav mloog los ntawm koj tus Google Assistant.

iv) Xaiv cov lus thiab nyem rau ntawm Tsim kom muaj txiaj ntsig.

3) Xaiv Kev Ua:

i) Tshawb rau Webhooks hauv kab tshawb nrhiav thaum xaiv qhov kev nqis tes ua.

ii) Nyem rau 'Ua lub vev xaib thov'.

iii) Muab cov hauv qab no hauv URL teb:

"ip chaw nyob los ntawm kauj ruam dhau los"/"Koj tus cim token"/tus pin/"Tus lej Tus lej ntawm blynk cov ntawv nkag"

Ntxig koj tus IP chaw nyob, tus lej cim thiab tus lej tus lej (piv txwv li V0 lossis tus lej tus lej twg koj teeb rau cov ntawv nkag hauv blynk app) yam tsis muaj nqe lus ob.

iv) Teem 'Txoj Kev' rau PUT, 'Hom ntsiab lus' rau daim ntawv thov/json thiab luam cov hauv qab no rau hauv 'Lub Cev'

["{{TextField}}"]

4) Nyem rau Finish thiab txav mus rau kauj ruam tom ntej.

Kauj ruam 5: Ua haujlwm

Ua hauj lwm
Ua hauj lwm

Kev ua haujlwm yog qhov yooj yim heev raws li koj tuaj yeem pom hauv daim duab, thaum peb hais "OK Google" thiab muab cov lus txib rau Google Assistant "qhib teeb", IFTTT applet yuav tshwm sim thiab "ntawm" yuav dhau los ua cov ntawv sau rau blynk app. Blynk app tau txais nws hauv cov lus nkag teb thiab peb tau txais nws hauv arduino code siv blynk lub tsev qiv ntawv txoj kev param.asStr (); Thaum "ntawm" tau txais ces tus lej digital D7 ntawm arduino board yuav raug teeb tsa rau 0 thiab teeb yuav qhib thiab thaum "tawm" tau txais tom qab ntawd tus lej digital D7 ntawm arduino board yuav raug teeb tsa rau 1 thiab teeb yuav raug muab tua (ib yam ntxiv tsis meej pem los ntawm theem 3…. txoj cai! Tsis txhob txhawj kuv tau piav qhia nws hauv cov kauj ruam tom ntej.)

Kauj Ruam 6: Kev Sib Txuas

Kev sib txuas
Kev sib txuas
Kev sib txuas
Kev sib txuas

Cov lus nug yuav tshwm sim hauv koj lub siab tias "vim li cas kuv thiaj teeb tus pin 7 ntawm Arduino pawg thawj coj mus rau 0 rau cov tswv yim siab thiab 1 rau cov tswv yim qis ntawm kev xa xov qauv?"

Cov lus teb yog yooj yim vim tias cov qauv siv uas kuv tab tom siv yog qis qis uas txhais tau hais tias kev xa tawm tau ua haujlwm thaum cov tswv yim yog 0 thiab tsis ua haujlwm thaum cov tswv yim yog 1. Tab sis vim li cas nws thiaj li yog li no? Qhov no yog vim thaum Arduino khau looj plab hlaub tom qab ntawd tag nrho cov pins ntawm Arduino tau teeb tsa siab los ntawm lub neej ntawd uas yuav teeb tsa kev sib txuas kom ua haujlwm thaum pib. Yog li, txhawm rau teeb tsa kev xa mus rau qhov tsis ua haujlwm thaum pib, nws tau ua rau qis qis.

Tam sim no cia saib cov kev sib txuas.

Kuv tau ua qhov kev sib txuas ntawm tus pin ntawm Arduino, ESP8266 thiab Relay module hauv daim duab saum toj no. Kuv kuj tau hais txog kev sib txuas hauv qab no vim tias kuv paub tias kuv sau tau zoo npaum li cas:(Pin daim duab ntawm ESP8266 ESP-01 tau qhia hauv qib 2.

Kev sib txuas ntawm Arduino, ESP8266 thiab kev xa xov module:

Arduino ESP/Tshaj Tawm

Pin 7 ------------------------------------------------------ ------- IN ntawm relay

Pin 2 ------------------------------------------------------ - RX tus pin ntawm ESP

Pin 3 ------------------------------------------------------ - TX pin ESP

RESET -------------------------------------------- RESET tus pin ntawm ESP

GND 1 -------------------------------------------- Av pin ntawm ESP

GND 2 -------------------------------------------- Hauv av tus pin ntawm kev xa tawm

+3.3V ------------------------------------------------------- ------- Vcc ntawm ESP

+5V ------------------------------------------------ ------ Vcc ntawm kev xa tawm

Kev sib txuas ntawm qhov kawg zaum thib ob ntawm kev xa xov module thiab teeb AC:

TSIS YOG (ib txwm qhib) ntawm kev xa rov qab -------------------- ib qho kawg ntawm lub qhov (socket)

COM (ib txwm muaj) ntawm kev xa tawm ------------------------- +tau kawg ntawm AC khoom siv

tshuav qhov kawg ntawm AC khoom ---------------------- tshuav qhov kawg ntawm lub qhov (socket).

NC (ib txwm kaw) --------- tawm raws li nws yog.

(Thov saib daim duab saum toj no kom nkag siab zoo dua)

Kauj Ruam 7: Tso Cai thiab Xeem Nrog Google Assistant

1) Qhib 'Arduino IDE' ntawm koj lub PC

2) Qhib hauv qab daim duab hauv IDE

3) Hloov daim ntawv lees paub, WiFi ssid thiab koj tus lej zais nrog koj daim ntawv pov thawj.

4) Tshaj tawm cov cai rau Arduino board. (Nws ib txwm yog qhov ua tau zoo tshaj plaws txhawm rau xa cov cai rau tsis ua haujlwm Arduino board thiab txuas cov cim tom qab ua tiav kev tshaj tawm)

5) Qhib Blynk app thiab qhib koj li WiFi hotspot.

6) Nyem rau khawm ua si nyob rau sab xis saum toj ntawm Blynk app kom ua txoj haujlwm.

7) Koj yuav raug ceeb toom sai li sai tau thaum tsim kev sib txuas.

8) Tam sim no nws yog lub sijhawm rau qhov tiag. Hais "OK Google" hauv koj lub xov tooj, tos kom Google Assistant qhib thiab tam sim no hais koj cov lus zoo li "qhib teeb", hauv ob peb feeb Google Assistant yuav teb koj nrog kab lus koj nkag mus mloog los ntawm Google Assistant hauv IFTTT xws li zoo li hauv kuv rooj plaub yog "teeb tau qhib"

9) Hais tias "tua teeb" kom tua lawv. Koj tseem tuaj yeem tswj koj lub teeb ntawm Khawm hauv Blynk app.

Nrog koj zoo siab! Koj lub teeb tam sim no ua haujlwm nrog koj lub suab.

Pom zoo: