Preface
After received my Google Home Mini from Walmart, my family and I are really enjoyed and satisfied with the voice features and sound quality. Voice control lighting is always on my Arduino DIY list. After I received all the components, I went ahead and made this project during my X'mas holiday. The Google Home Mini I bought came with a Chromecast in a Smart TV kit package at price of USD$45 during holiday sales. What a bargain!
* Photo from Walmart
Here are the URL links about this tutorial, totaling 3 sections:
Goal
Simply say "Ok Google, turn Light One On or Off" to Google Home Mini and it does the job! I intended to add "One" there, so I might have the 2nd or 3rd lights that I could control in...hope not in the distant future. :)
See the demo below:
Simply say "Ok Google, turn Light One On or Off" to Google Home Mini and it does the job! I intended to add "One" there, so I might have the 2nd or 3rd lights that I could control in...hope not in the distant future. :)
See the demo below:
How does it work?
Programming Steps to show you the working flow |
- Your voice command send to IFTTT through Google Home Mini
- IFTTT Applets engage Google assistance service and inteprete the voice command into text and send to Adfruit.IO MQTT service
- MQTT service received the message(from Google home to IFTTT) and based on the Adafruit "Feeds" setting to store the received message on the MQTT server.
- Adruino ESP8266 at home was programmed to subscribe new message from Adafruit. As soon as the Adafruit MQTT server has updated message, Adafruit server push the message back to Arduino ESP8226.
- ESP8226 recevie the message and act accordingly to either trigger the relay module.
- If the messae is "ON" then, ESP8226 turn on light by swith relay module on. Otherwise, the message is "OFF", then trun off light by swith relay module off.
!!EXTRA CAUTION!!
SAFETY is first priority! This project involves 110V AC which it is quite dangerous if not handled carefully! Please turn the main power source off before all the AC related connections. Double and triple check for short and correct connections before turn back on AC! I'm just to show you how I made this project and not responsible for anything happened to you or your family and properties in case if there is an accident.
Components Needed
- NODEMCU ESP8226 * 1
- 10A 110v/250v AC Relay * 1
- Wall plug outlet * 1
- Wires for Arduino connection * 4 or 5
- Wires for Wall plug connection * 3
- NODEMCU ESP8226 * 1
- 10A 110v/250v AC Relay * 1
- Wall plug outlet * 1
- Wires for Arduino connection * 4 or 5
- Wires for Wall plug connection * 3
Schematic
I drew this illustration below to show you how did I connected all components together.
Connections:
- ESP8226 D7 to Relay IN
- ESP8226 GDN to Relay GDN
- ESP8226 3.3V to Relay VCC
- Relay NC(Normally Close) to AC Plug outlet top end (refer to above illustration)
- Relay C(Common) to AC 110V
- AC Plug outlet bottom end to AC 110V GND
- AC Plug ground (not used in this project, my old house does not have this)
That's all for this section. Next time, I will show you how to setup Adafruit and IFTTT. They are the most important parts of this project. Until next time, see you!
Please Continue to read: Setting software - Part 2 of this tutorial
- ESP8226 D7 to Relay IN
- ESP8226 GDN to Relay GDN
- ESP8226 3.3V to Relay VCC
- Relay NC(Normally Close) to AC Plug outlet top end (refer to above illustration)
- Relay C(Common) to AC 110V
- AC Plug outlet bottom end to AC 110V GND
- AC Plug ground (not used in this project, my old house does not have this)
Please Continue to read: Setting software - Part 2 of this tutorial
Arduino + Google Home Mini 語音控制電燈
前言
以下是本教學章各章節的鏈接:
專案目標
很簡單,只要對著Google Home Mini 說 “Ok Google,將Light One開啟或關閉” 即可完成任務! 我在 Light 後面加了 “One”,預留了將來的第二或第三個燈......希望很快能而成。:) P.S: Google Home Mini 目前還不能以中文提問也不能回答...
看我錄影的示範:
看我錄影的示範:
程式運作方式
程式流程 |
- 語音命令透過 Google Home Mini 傳送到 IFTTT 伺服器
- IFTTT Applet 使用Google Assistant 服務並將語音命令轉成文字並傳送到Adfruit.IO MQTT服務
- Adafruit MQTT 收到訊息後(從Google Home Mini到IFTTT),並根據 Adafruit "Feeds" 設定將收到的文字存儲在MQTT服務器上。
- 家中的Adruino ESP8266 在程式中,設為訂閱Adafruit MQTT新訊息。只要Adafruit MQTT服務器得到了更新的資料,Adafruit服務器就會將消息傳回Arduino ESP8226。
- ESP8226接收新的資料並對應地動作觸發繼電器模組。
- 如果資料為“ON”,則ESP8226透過開繼電器模塊打開燈。 若資料為“OFF”,ESP8226則關閉繼電器模紅,進而關燈。
!!注意安全!!
安全是最重要的! 這個專案項目要使用到110V 交流電,如果不小心一點,可能會造成危險! 在所有直流電要實際連接之前,請一定要關閉主電源。 在重新啟用直流電之前,請檢查是否短路及是否連接正確! 這篇文章是教你如何完成這個專案項目,如果不幸發生意外,我個人是不需要對你或你的財產家人負責的。
所需零件
- NODEMCU-12E ESP8226 WiFi 模組 * 1
- 10A 110v/250v AC 繼電器 * 1
- 插座 * 1
- 杜邦線 4 ~ 5
- 直流電專用線 * 3
- NODEMCU-12E ESP8226 WiFi 模組 * 1
- 10A 110v/250v AC 繼電器 * 1
- 插座 * 1
- 杜邦線 4 ~ 5
- 直流電專用線 * 3
接線圖
連線方式:
- ESP8226 D7 連到 繼電器 IN
- ESP8226 GDN 連到 繼電器 GDN
- ESP8226 3.3V 連到 繼電器 VCC
- 繼電器 NC(常開) 連到 綠色插座頭 上方 (參考上方圖)
- 繼電器 C(共用) 連到 110V 白線
- 綠色插插座頭 下方 連到 110V 黑線 (參考上方圖)
- 插座頭 第三支線綠色,在此沒有用到
- ESP8226 D7 連到 繼電器 IN
- ESP8226 GDN 連到 繼電器 GDN
- ESP8226 3.3V 連到 繼電器 VCC
- 繼電器 NC(常開) 連到 綠色插座頭 上方 (參考上方圖)
- 繼電器 C(共用) 連到 110V 白線
- 綠色插插座頭 下方 連到 110V 黑線 (參考上方圖)
- 插座頭 第三支線綠色,在此沒有用到
Nice information thanks for sharing | Now use these amazing extend kits to add voice control to other robots. Presenting this top educational Robot Kits for Kids that can be easily used with Hexbugs, Lego Robotics, Vex Robotics, racing cars, toys and more.
ReplyDeleteEducational robotics kit
Programming with voice control
Alexa Voice Artificial Intelligence