Cov txheej txheem:

VoiceLantern - Lub Suab Tswj Lub Teeb!: 6 Cov Kauj Ruam
VoiceLantern - Lub Suab Tswj Lub Teeb!: 6 Cov Kauj Ruam

Video: VoiceLantern - Lub Suab Tswj Lub Teeb!: 6 Cov Kauj Ruam

Video: VoiceLantern - Lub Suab Tswj Lub Teeb!: 6 Cov Kauj Ruam
Video: Plab Plab Ntswg..(Pluav Pluav Ntswg) Maiv Twm New Song 2023-2024 2024, Kaum ib hlis
Anonim
VoiceLantern - Lub Teeb Tswj Lub Suab!
VoiceLantern - Lub Teeb Tswj Lub Suab!
VoiceLantern - Lub Teeb Tswj Lub Suab!
VoiceLantern - Lub Teeb Tswj Lub Suab!
VoiceLantern - Lub Teeb Tswj Lub Suab!
VoiceLantern - Lub Teeb Tswj Lub Suab!

Lub miniDSP UMA-8 microphone array, nrog onboard qhia kom paub, echo tshem tawm, thiab txo suab nrov, muaj ntau yam kev siv. Hauv cov lus qhia no peb yuav ua haujlwm dhau los ntawm kev siv nrog IBM Watson Kev Hais Lus-rau-Ntawv kev pabcuam los tswj lub teeb LED.

Vim li cas thiaj siv UMA-8?

Txhua lub suab tswj cov cuab yeej xav tau lub microphone kom kaw lub suab thiab ib tus tuaj yeem hais tias koj tuaj yeem siv tus lej 2 duas las tsis zoo. Qhov no zoo yog tias koj tau zaum ntawm lub khoos phis tawj, ncaj qha rau ntawm lub microphone, tab sis rau "thaj chaw deb", tsis muaj tes tuav tswj lub microphone uas xav tau ntau dua. UMA-8 muaj:

  • Beam-forming khiav hla kab ntawm 7 lub microphone kom txhim kho lub suab nrhiav pom thiab tshem tawm cov suab nrov.
  • Kev tshem tawm ncha thiab txo suab nrov kom txo qhov cuam tshuam ntawm lub suab tsis zoo (zoo li kev ua suab paj nruag) thiab suab nrov (tsheb, suab nrov hauv chav ua noj thiab lwm yam).

UMA-8 yog "ntsaws thiab ua si"-koj tsis tas yuav teeb tsa ib yam dab tsi kom nws ua haujlwm nrog RPi. Yog tias koj xav tau, txawm li cas los xij, koj tuaj yeem siv lub miniDSP plugin los hloov kho qhov ua tsis tau ntawm lub microphone array (pom zoo rau cov neeg siv qib siab nkaus xwb!)

Kauj Ruam 1: Yam Koj Xav Tau

Yam Koj Xav Tau
Yam Koj Xav Tau

Yam koj yuav tsum muaj

  • 1 x Raspberry Pi 2 lossis 3 nrog rau USB fais fab mov rau koj Pi
  • 1 x Keyboard
  • 1 x HDMI Zaub
  • Kev sib txuas hauv is taws nem
  • 1 x Me Teeb LED (~ $ 10)

    • eBay Link
    • AliExpress Txuas
  • Qee Cov Poj Niam-Poj niam jumper cables (~ $ 3)

    • eBay Link
    • AliExpress Txuas
  • 1 x 2n2222 NPN Transistor (~ $ 3)

    • eBay Link
    • AliExpress Txuas
  • 1 x Soldering Iron (nrog cov laug thiab cov cua sov ua kom sov) txuas cov xov hlau
  • 1 x miniDSP UMA-8 USB Microphone Array

    Yuav ncaj qha los ntawm MiniDSP Lub Vev Xaib

  • IBM BlueMix Account (saib cov ntsiab lus hauv qab no rau npe)

Yam koj yuav tsum paub

  • Qee qhov kev paub pib nrog Raspberry Pi platform
  • Qee qhov txuj ci Bash yooj yim (cd, ls, thiab lwm yam)
  • Kev txawj sau ntawv yooj yim Nano (qhib thiab txuag)
  • Lub siab xav, npaj los kawm yuav ua li cas thiaj tswj lub suab teeb!

Kauj Ruam 2: Txuas Txhua Yam Ntxiv

Txuas Txhua Yam Ntxiv
Txuas Txhua Yam Ntxiv
Txuas Txhua Yam Ntxiv
Txuas Txhua Yam Ntxiv
Txuas Txhua Yam Ntxiv
Txuas Txhua Yam Ntxiv

Ua ntej tshaj, cia li xaim peb qhov kev tiv thaiv! Coj koj lub Raspberry Pi thiab txuas cov keyboard thiab HDMI zaub.

Tam sim no peb yuav tsum nqa lub teeb sib nrug los qhia nws cov xov hluav taws xob. Raws li koj tuaj yeem pom, tom qab tshem 4 tus ntsia hlau ntawm lub hauv paus tuav lub roj teeb, peb nkag mus rau RED (5v) thiab XEEB (GND) xov hlau. Txhawm rau tig lossis teeb lub teeb, txhua yam peb yuav tsum tau ua yog xa 5v nqes cov xov no!

Peb yuav siv lub transistor xa qhov hluav taws xob no thiab tig lub teeb rau thiab tua. Vim li cas tsis tsuas yog txuas lub tswv yim ntawm lub teeb ncaj rau RPi, koj nug? Zoo, qhov no yog vim RPi tus tswj hwm tus pin (tseem hu ua "GPIOs") tsis tuaj yeem tso lub zog peb yuav xav tau los teeb lub teeb. Lub transistor ua haujlwm zoo ib yam rau kev xa tawm, zoo li kev hloov hluav taws xob uas dhau tam sim no los ntawm nws thaum siv qhov hluav taws xob.

Peb yuav toggle tus pin uas txuas nrog rau cov xov paj liab HIGH thiab LOW los tswj cov transistor uas yuav, tig rov xa 5v nqes kab rau lub teeb. Lub transistor yuav tsum tau txuas nrog txhawm rau txhawm rau xaim (GND) xaim kom ua haujlwm raug.

Ua tib zoo saib cov duab kos thiab cov duab hauv qab no thaum txuas lub teeb.

Peb tau muag cov poj niam lub taub hau rau lub teeb lub xov hlau kom yooj yim los txuas qhov no. Yog tias koj tsis tau soldered ua ntej, saib cov lus qhia no uas muab cov lus piav qhia zoo.

Thaum kawg, koj yuav tsum tau ntsaws lub hwj chim thiab lub miniDSP UMA-8 USB Microphone Array, yooj yim ntsaws rau hauv USB chaw nres nkoj! Qhov ntawd yog txhua yam rau nws raws li UMA-8 yog ntsaws & ua si nrog RPi.

Kauj ruam 3: Npaj Pi

Ua ntej lub zog ntawm Pi, koj yuav tsum rub Raspbian Stretch LITE los ntawm Raspberry Pi Foundation. Xyuas kom koj tau txais LITE version uas tsis suav nrog lub desktop. Hlawv cov duab rub tawm mus rau daim npav micro-SD. Txuas lub micro-SD daim npav rau hauv Pi thiab ntsaws lub zog. Koj yuav pom koj lub monitor lossis TV tuaj nrog tus ID nkag mus sai.

Txhawm rau nkag mus, siv lub hauv paus Raspberry Pi nkag mus paub meej.

Username: piPassword: raspberry

Yog tias koj muaj Ethernet (txuas) internet txuas nrog, koj tau teeb tsa. Txwv tsis pub, koj yuav tsum teeb tsa Wifi. Ua raws li phau ntawv qhia no teeb tsa Wifi ntawm koj tus Pi.

Rub tawm thiab Txhim Kho NodeJS

Ua ntej, nruab NodeJS siv tus tswj hwm pob. Nov yog phau ntawv qhia yooj yim uas piav qhia cov lus txib tam sim no xav tau. Thaum lub sijhawm sau ntawv, cov no yog cov lus txib kuv siv:

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -sudo apt -tau nruab -y nodejs

Ntxiv mus, peb yuav tsum teeb tsa daim ntawv thov uas NodeJS yuav khiav los tso cai rau peb lub teeb pom kev hnov (ntawm UMA-8) thiab tswj lub teeb (ntawm GPIO headers). Ua ntej rub tawm lub chaw cia khoom uas muaj cov cai: (tau txais los ntawm kev luam qhov URL ntawm cov ntawv zip uas txuas rau cov theem no)

wget https://cdn.instructables.com/ORIG/FBU/XWAG/J86HJLO9/FBUXWAGJ86HJLO9.zipunzip suab-teeb.zipcd suab-teeb

Tam sim no, cia nruab tag nrho cov khoom ntxiv thiab bobs daim ntawv thov no xav kom khiav:

npm nruab

Thaum qhov kev teeb tsa tiav, koj yuav npaj txhij dhia mus rau IBM Watson.

Kauj Ruam 4: Kho IBM Watson

Configuring IBM Watson
Configuring IBM Watson
Configuring IBM Watson
Configuring IBM Watson
Configuring IBM Watson
Configuring IBM Watson

Tam sim no tias peb lub teeb yog txhua yam txuas, peb tuaj yeem pib ua haujlwm ntawm kev paub lub suab! Yog tias koj tseem tsis tau muaj, sau npe rau IBM BlueMix. Thaum koj tau nkag mus, nkag mus rau BlueMix Services Dashboard.

Nyem rau qhov loj "Tsim Watson kev pabcuam" khawm nyob nruab nrab ntawm lub vijtsam. Saib duab 1.

Tom ntej no, koj yuav raug nthuav qhia nrog cov npe ntawm txhua qhov kev pabcuam IBM BlueMix tau muab rau. Cia peb hla mus rau ntu "Watson" hauv kab ntawv sab. Saib duab 2.

Tam sim no peb yuav tsum ntxiv qhov "Hais Lus-rau-Ntawv" kev pabcuam. Qhov no yuav tso cai rau peb xa cov kwj suab hais lus rau WATSON, thiab kom nws rov qab cov ntawv (hloov pauv los ntawm lub suab tuaj). Saib daim duab 3.

Txhawm rau ua qhov no, nyem lub pobzeb (piav qhia hauv liab saum toj no). Thaum nplooj ntawv tau thauj khoom, peb tuaj yeem tawm qhov kev teeb tsa ua ntej thiab xaiv lub pob "Tsim" nyob rau hauv qab kaum sab laug. Saib daim duab 4.

Thaum kawg, peb yuav tsum tau txais "Cov ntawv pov thawj kev pabcuam". Cov ntsiab lus no tau siv los ntawm peb lub app yuav txuas rau Watson. Saib daim duab 5.

Nyem rau “Saib daim ntawv pov thawj” txhawm rau nthuav cov pobzeb thiab tom qab ntawd theej cov kab uas muaj “tus username” thiab “password” rau hauv cov ntawv sau ntawm koj lub computer. Peb yuav xav tau cov no tom qab, yog li nco ntsoov tias lawv tau hais meej meej tias "WATSON Creds" lossis zoo sib xws. Saib duab 6.

Kauj Ruam 5: Ntxiv Peb Cov Ntawv Pov Thawj WATSON rau hauv App

Tam sim no peb tau ua tiav cov txheej txheem rov ua peb daim ntawv pov thawj Watson, peb yuav tsum qhia peb lub teeb kom paub nkag mus rau Watson. Dhia rov qab rau pem hauv ntej ntawm koj Pi thiab xyuas kom koj nyob hauv lub suab-lub teeb phau ntawv uas muaj lub app. Peb yuav tsum tau kho cov ntawv "settings.js" kom suav nrog cov ntsiab lus no. Qhib cov ntawv nrog cov lus txib no:

nano settings.js

Tam sim no, hloov txhua qhov kev teeb tsa uas tau hais tseg hauv cov ntawv no, nrog cov teeb tsa uas koj tau sau ua ntej.

Kauj Ruam 6: Khiav Peb Lub Suab Tswj Lub Teeb

Thaum koj lub app tau teeb tsa, nws tau npaj los khiav!

Txhawm rau teeb lub teeb, hais tias "Cia kom muaj lub teeb!", Txhawm rau tua nws hais tias "Cia qhov tsaus ntuj!" Khaws qhov muag ntawm Raspberry Pi lub console tso tawm kom pom tias WATSON txhais li cas koj tab tom hais.

sudo app app.js

Pom zoo: