Cov txheej txheem:

Alexa Enabled Remote Control (siv WEMO D1 Mini): 3 Kauj Ruam
Alexa Enabled Remote Control (siv WEMO D1 Mini): 3 Kauj Ruam

Video: Alexa Enabled Remote Control (siv WEMO D1 Mini): 3 Kauj Ruam

Video: Alexa Enabled Remote Control (siv WEMO D1 Mini): 3 Kauj Ruam
Video: WLED for $3.26!! 2024, Kaum ib hlis
Anonim
Image
Image
Hlau Tshaj Cov Chaw Taws Teeb
Hlau Tshaj Cov Chaw Taws Teeb

Nov yog qhov hloov kho tshiab ntawm kab ntawv dhau los:

www.instructables.com/id/Voice-Activated-R…

Hauv cov ntawv dhau los, Kuv tau siv Geetech lub suab ntsuas los tswj lub qhov rooj qhib qhov rooj qhib qhov rooj ib txwm muaj. Hauv cov lus qhia no kuv tau hloov lub suab qauv nrog Amazon Echo. Hauv peb lub tsev, cov chaw taws teeb tswj lub qhov rooj.

Kauj Ruam 1: Xaim Cov Chaw Taws Teeb

Hlau Tshaj Cov Chaw Taws Teeb
Hlau Tshaj Cov Chaw Taws Teeb
Hlau Tshaj Cov Chaw Taws Teeb
Hlau Tshaj Cov Chaw Taws Teeb
Hlau Tshaj Cov Chaw Taws Teeb
Hlau Tshaj Cov Chaw Taws Teeb

Yog tias koj ua raws li cov lus qhia yav dhau los (https://www.instructables.com/id/Voice-Activated-R…, koj yuav pom tias kuv tshem rooj plaub tawm ntawm lub qhov rooj tsheb qhov rooj deb thiab muab ob txhais ceg khawm khawm ua ke nrog xaim me me. Tam sim no lub pob tseem ceeb ib txwm nias. Thaum koj txuas lub roj teeb - lub teeb liab raug xa thiab lub qhov rooj qhib.

Hauv cov lus qhia yav dhau los, Kuv tau siv arduino los tswj lub zog rau cov chaw taws teeb. Hauv qhov hloov tshiab no, Kuv tau siv WEMO D1 mini. Muaj qee cov kauj ruam kom tau WEMO ua haujlwm nrog arduino IDE, thiab koj tuaj yeem ua raws lawv hauv qhov kev qhia zoo no …

Qhov laj thawj rau WEMO yog tias nws tau qhib WIFI - thiab, koj tuaj yeem siv qee qhov yooj yim muaj tus lej txhawm rau ua kom nws coj zoo li wemo belkin hloov. Nov yog txoj hauv kev yooj yim los cuam tshuam nrog amazon echo.

Txhawm rau txuas cov chaw taws teeb mus rau WEMO, ua raws daim duab qhia. Koj tseem tuaj yeem ua raws cov lus qhia yav dhau los rau cov duab/kev piav qhia ntawm teeb tsa (nws zoo ib yam, tab sis hloov cov arduino nrog wemo).

Cov lus qhia no (https://www.instructables.com/id/Alexa-Controlled-Servo/) yeej ib txwm ua tib yam nkaus, ib yam nkaus, thiab yog lub hauv paus rau qhov kuv tau siv los hloov kho kuv qhov project. Hauv nws qhov haujlwm nws ntxiv lub peev xwm nruab nrab ntawm 5V thiab Pins Pins. Kuv tsis tau ua qhov ntawd, tab sis yog tias kuv pom wemo tsoo, kuv yuav ua.

Kauj ruam 2: Code

Ua ntej, mus rau:

github.com/kakopappa/arduino-esp8266-alexa…

thiab rub tawm belkin simulation code. Muab cov cai no tso rau tag nrho koj lwm cov haujlwm arduino nyob. Tom qab ntawd nqa cov ntaub ntawv wemos.ino hauv lub tswv yim arduino. Cov ntaub ntawv nkaus xwb uas yuav tsum tau hloov kho yog wemos.ino cov ntaub ntawv.

Yeej, txhua yam koj yuav tsum tau ua hauv cov ntawv no yog: 1. Teem koj tus SSID thiab tus password rau koj lub wifi2. Txhais koj qhov kev hloov pauv; (Hloov *chav ua noj = NULL;) 3. Pib koj qhov kev hloov pauv; (chav ua noj = Hloov tshiab ("chav ua noj teeb", 81, chav ua noj LightsOn, chav ua nojLightsOff); upnpBroadcastResponder.addDevice (*chav ua noj);) 4. Ntxiv rau ntu Loop; (chav ua noj-> serverLoop ();) 5. Ua koj li kev hu rov qab rau ob qho tib si On thiab Off thiab tso txhua yam koj xav tau hauv kev hu rov qab: bool kitchenLightsOn () {Serial.println ("Hloov 2 qhib rau …"); isKitchenLightstsOn = muaj tseeb; rov qab yogKitchenLightstsOn; }

Koj yuav pom txhua yam no hauv tus qauv wemos.ino code. Tsuas yog hloov Hloov-es hauv cov ntawv ntawd nrog txhua yam koj xav hloov pauv. Hauv kuv qhov xwm txheej, kuv tau hloov pauv txhua yam "qhov rooj". Kuv lub qhov rooj tawm callback tsis ua dab tsi. Kuv doorOn () hu rov qab hloov tus pin D1 rau HIGH. Saib cov cai kuv suav nrog ua piv txwv.

Kauj Ruam 3: Muab Nws Ua Ke

Thawj zaug koj suav sau/xa mus rau wemo, ua raws hauv arduino editor console window kom pom tias koj ua tiav txuas nrog wifi.

Thaum qhov ntawd ua haujlwm, koj tuaj yeem hais "Alexa nrhiav cov cuab yeej". Koj yuav tsum pom qee yam haujlwm hauv lub qhov rai console, thiab Alexa yuav tsum lees paub tias nws tau pom koj cov hloov pauv.

Tam sim no, koj tau teeb tsa tag nrho, txhua yam koj yuav tsum tau hais yog "Alexa tig lub qhov rooj rau". Qhov no yuav qhib kev hu rov qab hauv koj cov cai. Hauv kuv qhov xwm txheej, nws teeb tus pin D1 rau HIGH. Qhov no mus rau tus tswj lub cev muaj zog, uas txuas nrog lub roj teeb 9V rau lub chaw taws teeb, yog li tig nws thiab qhib lub qhov rooj. Ua tsaug !! khawv koob

Pom zoo: