Voice Control Chip-E With Google Home

Introduction: Voice Control Chip-E With Google Home

Want to control a robot with your voice? Here's a great place to start! With a combination of Google Home, IFTTT, a WiFi enabled microcontroller, and an Arduino based robot, we're going to make a robot that can be controlled entirely by voice command!

Step 2: Assemble Your Chip-E

Once you have your Chip-E built and tested with the IR Gamepad controller, we can remove the IR Receiver and find a nice spot to mount the ESP8266 Thing Dev Board. Leave the ESP8266 Thing Dev Board unplugged for now. Neither the ESP8266 Thing Dev Board nor the Geekduino can be programmed with a device attached to the UART RX/TX pins.

Step 3: Program Your Chip-E and SparkFun ESP8266 Thing Dev

You should have downloaded the libraries and Sketches for Chip-E during the getting started and assembly process. In case you skipped that for some inconceivable reason, here's the link again.

You will also need the hardware/libraries for the SparkFun ESP8266 Thing Dev. Follow the Arduino IDE setup guide for that HERE.

Once you have the libraries installed, open File → Examples → Chip-E → Chip-E_ESP8266 and load it onto your Geekduino. Tuning the servos is handled in the same way as it was in the Getting Started Guide.

Once that is loaded onto your Chip-E, open File → Examples → Chip-E → ESP_Pass_String and add in your network credentials on lines 6 and 7.

Step 4: Poke a Neat Little Hole in Your Router

This is done slightly differently on every model of router, but you will need to set up Port Forwarding so that IFTTT can pass a message to your ESP8266. NOTE: Any open port on your router is a security risk. Be advised, this should not be done on a network with sensitive information on it.

Find the IP Address of your ESP8266. There are a ton of ways to do this. My favorite way is to use Fing to scan the network for devices and take the IP address from there. (it's listed as "ESP_###### - Espressif")

Once you have your IP, log into your router as an administrator, go to your WAN settings, and find Port Forwarding. Enable Port Forwarding, Set up a service with a name you can remember, set the port range to 80, set your Local IP to the ESP's IP address, set your local port to 82, and allow for both TCP and UDP protocols. Save that, wait for your router to restart, and ask google what your IP is. What it shows is your WAN IP. Write that down, we'll need it.

Step 5: Set Up IFTTT With Google Assistant and Maker

Go to IFTTT.com and if you haven't set up an account, set one up now and link it to the same Google account your Google Home is attached to.

Select New Applet

Click "+this" and search for Google Assistant

Click Google Assistant and select from the options presented: "Say a phrase with a text ingredient"

Where it says "What do you want to say?" Type in the command you'd like to activate Chip-E with, such as "Can chippy $" Notice that we spell it chippy instead of Chip-E for phonetic understanding from google's speech to text engine. The dollar sign signifies the different actions we can ask Chip-E to do.

You can optionally add up to 2 other ways to say it.

In the "What do you want the Assistant to say in response?" section, you can have Google Home confirm what you asked Chip-E to do by having it say something like: "Hey Chippy, can you $"

Click "Create trigger" then click "+that"

Search for Maker, click on Maker, and select "Make a web request"

In the URL field, type in http://YOURIPADDRESS/{{TextField}} Replacing YOURIPADDRESS with your WAN IP we found in the last step.

Set the Method to GET

Set the Content Type to text/plain

Leave the Body field blank

Hit Create Action

Step 6: Test It Out!

First things first, make sure that your Chip-E can respond to commands in the first place. In your browser, type in your ESP8266's Local IP Address followed by :82 (such as: http://192.168.0.69:82). It should load a webpage that says "hello from esp8266!" This tells you that it's running. In the address bar, after your IP put in a slash and any of the following commands:

Now we can test it out with the Google Home by saying the command we set up in the last step! If you set your command phrase to "Can chippy $", then you would say "Ok Google, can Chip-E whistle?"

The Google Home should respond, and shortly thereafter, Chip-E should follow the command! WOWIE.

Step 7: Going Further

Now that we've got a Chip-E following pre-programmed commands, you can mess around in the Chip-E_ESP8266 sketch to add more! Maybe you'd rather not control a Chip-E? You can borrow some code, follow the basics of this guide, and with a little creativity, you can essentially control any arduino compatible device with a voice command! Heck, we're probably going to be messing around with this a lot and getting all of our robots to talk to us. We're lonely, Valentine's day was hard on us, and you shouldn't be so judgmental. If we wanna have conversations with robots, just let it happen.