本文是利用Arduino系列的NodeMCU Lua (Esp8266) wifi 模組來製作簡單的App Inventor 手機程式,並用按鈕(Button)和語音辨識的方式來控制LED或電燈開關。 更令人興奮的是硬體材料費不到 NT200 !! 以下整理3 hr上課內容給各位參考,以搭配您的課程需要。

This image has an empty alt attribute; its file name is 1112.jpg

(for 3 hr in class only)

This image has an empty alt attribute; its file name is image-15-1024x768.png

成果展示 (智慧語音小禮盒)

1. 步驟說明

課程規劃如下 :
  1. 第一小時 : AIoT、Arduino與App Inventor 簡介與程式環境設定
  2. 第二小時 : 快速瀏覽Arduino程式並進入App Inventor開發
  3. 第三小時 : App Inventor程式編輯與上傳自己製作的App
第一小時課程 : AIoT介紹 AIoT 即AI (Artificial Intelligence)+ IoT (Internet of Things) 的簡稱,指人工智慧技術(AI)與物聯網(IoT)在實際應用中的落地融合 。本課程是將AIoT實際應用在智慧家庭(Smart Home)的情境中,如下圖

智慧家庭應用系列
以下影帶看完後,會對智慧家庭的應用有很清楚的概念
https://www.youtube.com/watch?v=NjYTzvAVozo
AI (人工智慧)則是現今科技界的響叮噹的學習標的,目前應用在生活中常見的AI應用 包括影像辨識 (人臉辨識)和語音辨識,本課程以語音辨識的開發應用作為主題之一。

相關圖片

人臉辨識案例
以上學習體驗可參考

微軟(Microsoft face API)人臉辨識A應用網站

。 至於語音辨識的應用,我們是連結google 雲端的免費語音服務系統,結合App Invemtor的程式去開發自己的功能。

常用的google 雲端語音服務

「google voice recognition api」的圖片搜尋結果

google 語音服務與程式開發的介面 vs 本文最上方的系統架構圖
Arduino 簡介 發展至今約10年的時間,已是現今所有領域的研究者、開發者和學習者的最常用工具之一,可以快速地開發物聯網、感測器、馬達控制、生醫訊號等等。 本文選用的是Arduino + Wifi 的非常廣泛的ESP8266系列之NodeMCU控制器。

Arduino Board

標準Arduino UNO板

「nodemcu」的圖片搜尋結果

NodeMCU (Esp8266)晶片控制器
Arduino 環境 安裝與設定,請參考

前一篇文章

,但是本次課程僅3Hr 所以學習目標先放在App Inventor的編輯與製作。既然時間有限,我們採用倒吃甘蔗的作法,先體驗一下程式執 第二小時課程 : 安裝與設定
  1. 接上LED與確認NodeMCU連上電腦 : 請用雙母頭的杜邦線,一端接在NodeMCU的G (接地)角,另一端接在D1 腳位。LED接角要特別注意長腳接(D1),短腳接 (G)

LED長腳接(D1),短腳接 (G) ; 我們省略了電阻串接在長腳端
上述接線仔細檢查無誤後,取出 micro USB傳輸線,一端接上電腦,一端接上NodeMCU控制器。
2. 燒錄Arduino程式 : 這個步驟這裡先不做,開課必須先將程式燒錄進去Arduino。 燒錄方法可

參考

3. 設定 NodeMCU wifi : 這個步驟這裡先不做我們的目的是讓每位學員的NodeMCU都能正確連上自己的手機熱點。開課前須先將每一個NodeMCU設定好wifi 的內容,包括欲連線的SSID和密碼。詳細動作

可參閱

4. 安卓手機程式APK(安裝執行檔,

下載連結

),或用以下QR code得到網址並下載

下載後請打開手機的外部應用程式安裝的權限,進行安裝。成功後會得到以下畫面。

手機App 截圖
5. 連線使用 : 當手機熱點打開後(熱點設定需同前面步驟3. ),按下APP的 “掃瞄”按鈕,若是在 “遠端IP”有出現另一組 192.168.xx.xx 的IP,那麼代表設定都正確,NodeMCU連上你自己的手機熱點了。 6. 操作說明 : 按下 “廚房燈開”, “廚房燈關” 等按鈕,會看到LED亮或滅。此外,按下”語音辨識”按鈕後,說出與上面 “廚房燈開”, “廚房燈關” 等按鈕一樣的文字,也可達到同樣的效果。 第三小時課程 : App Inventor程式講解
  1. 註冊google
  2. 進入App Inventor 2 編輯環境 。 文字閱讀不如看影帶教學,可參考 YouTube “MIT App Inventor 入門教學 – 按鈕文字及安裝執行” 。
  3. 如何手機安裝MIT AI2 Companion程式 ,進行編譯與APK製作,可參考YouTube “手機安裝MIT AI2 Companion程式
  4. 下載並匯入範例專案。

點選右上角的全部下載符號

再到自己的硬碟選取剛剛下載的 .aia檔案並匯入
5. 程式編輯、編譯與打包apk的體驗
5-1. 畫面編排練習 – 底圖更新和應用程式名稱修改

設計自己的背景圖片並更換,同時,選擇 “標題”修改App的名稱
5-2. 修改好後,準備編譯你的程式 :

選擇,連線 – AI Companion

畫面會出現QR code,準備用手機的App來掃描
打開手機的 “MIT AI2 Companion” app應用程式

相關圖片

選取 “scan QR code” ,並進入程式編譯與載入手機的階段
5-3. 程式設計練習 – 修改按鈕、語音辨識命令更動

更改上述按鈕的名稱與語音辨識指令,例如改成 “客廳開燈”

進入 “程式設計”,修改圖示圈選的對應文字
重複 5-2動作,編譯體的程式看看結果如何 ? 5-4. 製作一個新的開關按鈕 (這部分依據時間保留是否進行) 首先修改畫面新增按鈕

在畫面編排中,先安插新的一行,以便放入新的按鈕功能
進入程式設計,複製積木 ,然後修改傳送到Arduino程式的命令

進入Arduino程式,新增對應的程式碼,並燒入新的程式

以上動作,Happy Ending ~ 。

10,589 thoughts on “ESP8266 (NodeMCU) 與 App Inventor的語音辨識和開關控制

  1. У нас двенадцать топовых сериалов для подлинных любителей драмы.
    Чики смотреть онлайн дата выхода,
    новых серий. Закачивайте по рейтингу кинопоиска, Сериалы жанра “Фэнтези”.
    Аналогично тут мы выдает программу телеканалов Киносерия, HD Футбол 1, 4K Дом кино, прямой эфир НТВ,
    трансляция ТВ Центр.

  2. Снова для Вас семнадцать новых
    сериалов для фанатов драмы.

    Тайсон Фьюри – Деонтей Уайлдер прямая трансляция. все серии, сериал,
    сезон. Смотрите по жанру, Сериалы жанра “Триллер”.
    Также тут мы готов предоставить меню телеканалов Мега,
    HD Канал Disney, 4K FOX Россия, прямой эфир Eurosport 1, трансляция ТНТ4.

  3. Приготовили для Вас четырнадцать свежих сериалов для настоящих фанатов ужасов.
    Когда выйдет новый сезон полицейского с Рублевки дата выхода, новых серий.
    Смотрите по рейтингу IMDB, Сериалы жанра
    “Боевик”. Помимо прочего мы вам помогает каталог каналов
    Культура, HD Ю, 4K FOX Россия, прямой эфир CNN, трансляция ПлюсПлюс.

  4. Опять для вас восемь свежих
    сериалов для фанатов хорора.
    Бумажный дом 5 сезон 7 серия смотреть онлайн новый сезон.
    Смотрите по жанру, Сериалы жанра “Триллер”.
    Да и мы готов предоставить список различных каналов Пятый канал, HD НТН,
    4K Киносерия, прямой эфир 2х2, трансляция ICTV.

  5. Thank you for every other great post. Where else could anybody get that type of
    info in such an ideal approach of writing? I have a presentation next week, and I am on the search for such information.

  6. Oh my goodness! Amazing article dude! Thank you so much, However I am having troubles with your RSS.
    I don’t know why I can’t subscribe to it. Is there anybody else getting
    similar RSS issues? Anybody who knows the answer can you kindly respond?
    Thanx!!

  7. Thank you for every other informative web site. The place else could I am getting that type of info written in such an ideal way?
    I’ve a project that I’m just now running on, and I’ve been on the glance out
    for such info.

  8. I have been surfing on-line greater than three hours these days, yet I by no means found any attention-grabbing article like yours.
    It is lovely value sufficient for me. In my view, if
    all webmasters and bloggers made excellent content as you probably did, the
    web will be a lot more useful than ever before.

  9. Призвание может быть разным.
    Найти его — это понять, каким именно способом мы сможем наиболее продуктивно и с удовольствием приносить пользу другим людям.

    Как понять призвание и предназначение.
    Дизайн человека или желание
    и свобода и опытность?

  10. Cмотреть все серии и сезоны онлайн, Озвучка – Перевод Amedia, лостфильм, AlexFilm, HDrezka Studio Украинский Игра в кальмара 2 сезон 1 серия Рик и Морти, Нормальные люди, Половое воспитание / Сексуальное просвещение, Вампиры средней полосы, Триггер, Миллиарды – все серии, все сезоны.

  11. Excellent post. I was checking continuously this weblog and
    I’m inspired! Very helpful info specifically the remaining phase 🙂 I maintain such
    info much. I used to be seeking this certain information for a very long time.
    Thank you and best of luck.

  12. Undeniably believe that which you said. Your favorite justification appeared to be on the internet the easiest
    thing to be aware of. I say to you, I definitely get irked while people consider worries that they just don’t know about.
    You managed to hit the nail upon the top and also defined out the whole thing
    without having side effect , people can take a signal.
    Will likely be back to get more. Thanks

  13. Fantastic beat ! I wish to apprentice whilst you amend your web site, how can i subscribe for
    a weblog website? The account aided me a appropriate deal.
    I have been tiny bit familiar of this your broadcast provided shiny clear concept

  14. Takipçi Satın Almak Nedir?

    Pek çok kişinin takipçi sayın alma hizmetinden haberi
    olmadığını düşünerek bu yazıyı kaleme
    almak istedik. Özellikle sosyal medya hesapları üzerinden gerek satış
    yaparak gerekse de reklam gelirleri ile para kazanmak isteyen kişiler
    için takipçi sayısı oldukça önemlidir.
    Takipçi sayısı düşük olan bir hesabı takip etmek
    ister misiniz?
    Pek çok kişi bu soruya yanıt olarak hayır demektedir.

    Takipçi sayısı yüksek olan sosyal medya hesaplarının takip
    edilme şansı çok daha yüksektir. Bu nedenle oluşturduğunuz sosyal
    medya hesabınız
    için takipçi satın al hizmetleri sunulmaktadır.

    https://rebrand.ly/takipci-satin-al

  15. I’ve been browsing online more than 2 hours today, yet I never found any interesting article like yours.
    It is pretty worth enough for me. In my view, if all
    site owners and bloggers made good content as you did, the internet will be much more useful than ever before.

  16. Wow that was unusual. I just wrote an really long comment but after I clicked submit my comment didn’t show up.
    Grrrr… well I’m not writing all that over again. Anyhow,
    just wanted to say superb blog!

  17. Terrific article! That is the kind of info that should be shared around the net.
    Shame on Google for not positioning this publish upper!
    Come on over and consult with my site . Thank you =)

  18. Hi there! I could have sworn I’ve been to this website before but after browsing through some of the post I realized it’s new to me.

    Anyhow, I’m definitely happy I found it and I’ll be bookmarking and checking back often!

  19. Pingback: meritroyalbet
  20. excellent issues altogether, you just gained a brand new reader.
    What would you recommend about your put up that you just
    made some days in the past? Any positive?

  21. Hmm is anyone else encountering problems with the pictures on this blog
    loading? I’m trying to determine if its a problem
    on my end or if it’s the blog. Any feed-back would be greatly
    appreciated.

  22. Its like you read my mind! You seem to know a lot about this,
    like you wrote the book in it or something. I think that you
    can do with some pics to drive the message home a little bit, but other than that, this is great blog.
    An excellent read. I will certainly be back.

  23. Thanks for the good writeup. It in fact was a amusement
    account it. Look complex to far delivered agreeable
    from you! By the way, how can we keep up a correspondence?

  24. Its like you read my thoughts! You appear to understand a lot about this,
    such as you wrote the book in it or something. I think that you
    just can do with a few percent to power the message home a little bit, however other
    than that, this is great blog. A great read. I will definitely be back.

  25. Pingback: meritroyalbet