Showing posts with label Google home. Show all posts
Showing posts with label Google home. Show all posts

2019/01/01

Voice control with Google Home and Arduino (1/3)

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:


How does it work?

Programming Steps to show you the working flow

  1. Your voice command send to IFTTT through Google Home Mini 
  2. IFTTT Applets engage Google assistance service and inteprete the voice command into text and send to Adfruit.IO MQTT service
  3. 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.
  4. 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.
  5. ESP8226 recevie the message and act accordingly to either trigger the relay module.
  6. 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

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