Amazon Alexa to EV3
Lesson Objectives:
- Students will control their EV3 robot using Amazon Alexa voice capabilities
- Students will understand the relationship between
Materials:
- EV3 Lego Robotics Kit / legos
- Device with Amazon Alexa capabilities (ex. Echo, Echo Dot, Echo Spot, etc.)
- Laptop and WiFi connection
- USB
- Google account
- If This Then That (IFTTT) account
Let's get started!
This project utilizes the model seen below:
Using If This Then That (IFTTT)
*If you do not already have an IFTTT account, sign up using this link*
*If you have not already set up your Alexa device, follow the instructions here*
This project utilizes IFTTT to handle the data (your voice command) you wish to send to your EV3 robot. In a general sense, IFTTT is a service used to connect two web services using a trigger and action model. If something happens on the first service (the trigger), then do ___________ with the second service (the action).
How does IFTTT work for this project?
In this case, vocal commands to your Alexa device will trigger a word to appear in your specified Google Sheet. The phrases I say to my Alexa device (Echo Dot) specify the EV3 bot to move "forward," "back," or to "stop." These movement values will then be sent to your Google Sheet, and will eventually be pulled by LabView and handled appropriately (will discuss later).
Steps:
Test it out
*If you do not already have an IFTTT account, sign up using this link*
*If you have not already set up your Alexa device, follow the instructions here*
This project utilizes IFTTT to handle the data (your voice command) you wish to send to your EV3 robot. In a general sense, IFTTT is a service used to connect two web services using a trigger and action model. If something happens on the first service (the trigger), then do ___________ with the second service (the action).
How does IFTTT work for this project?
In this case, vocal commands to your Alexa device will trigger a word to appear in your specified Google Sheet. The phrases I say to my Alexa device (Echo Dot) specify the EV3 bot to move "forward," "back," or to "stop." These movement values will then be sent to your Google Sheet, and will eventually be pulled by LabView and handled appropriately (will discuss later).
Steps:
- Log into your IFTTT account then click on your profile at the top right corner.
- Click "New Applet"
- Click on the blue "this"
- In the device search box, type in "Amazon Alexa"
- Click the blue box that says, "Say a specific phrase." When speaking to your device, you will say "Alexa trigger" + "forward" or "back" or "stop"
- For the phrase, type in "forward." This will be your trigger word. Set the trigger by clicking "Create Trigger"
- Now it's time to create your "That" (action). Click the blue "that"
- On the "Choose Action Service" page, type "Google Sheets" into the search box
- Choose "Update cell in spreadsheet." You will be updating a single cell in your sheet with your movement word
- Once on the complete actions field, leave the "Drive folder path" blank - delete contents if not empty
- Log into your Google Drive account and create a new Google Sheet - its name does matter
- Set the Spreadsheet Name to the name you assigned your newly created Google Sheet
- For simplicity sake, assign the cell to A1 - the cell in top top left corner. The value of A1 will change depending on the trigger spoken to your alexa device.
- Since the trigger word is "forward," set the value to "forward."
- Click Create Action to complete your Applet
Test it out
- While in proximity to your Alexa device, say "Alexa trigger {directional word}"
- If your Google Sheet's A1 value contains the appropriate directional word, then your IFTTT Applets run correctly
Now that you have your Alexa device sending messages to your Google Sheet, it's time to move onto the LabView component of this project
What is LabView used for in this project?
How is this done?
Here is an example of how we connected Google Sheets to LabView and ultimately controlled our EV3 robot. However, you can structure your LabView code however you like!
What is LabView used for in this project?
- LabView acts as the bridge between the spoken commands and your EV3 robot
- LabView will query your Google Sheet's saved directional value and accordingly move your bot
How is this done?
- The primary method of extracting data from your Google Sheets is through performing a GET request
- Use an HTTP GET handler
- The URL's structure derives from Google Sheet's API.
- We will be using the Basic Reading interface, so your GET URL will look something like this: https://sheets.googleapis.com/v4/spreadsheets/spreadsheetId/values/Sheet1!A1
- Your spreadsheetId, which identifies your specific Google Sheet, is found in the URL of your Sheet. For example, if your Sheet's URL is - https://docs.google.com/spreadsheets/d/123ABC/edit#gid=0 - then your ID would be "123ABC"
- Use the URL you put together as the URL for your GET
- The last component of the URL is your Google API App Key
- Log into your Google API Console, in order to create an app key
- Click on New Project at the top left corner of APIs and Services page from the link
- Your project name is up to you and once created, click on your new project
- Click on New Project at the top left corner of APIs and Services page from the link
- On the lefthand sidebar, choose Credentials
- Under Create Credentials, choose API Key. This will be attached to the end of your GET URL from above, since it gives LabView security access to your Sheet
- Let's say your generated API key is "56BS2J"
- Your URL will now look something like this: https://docs.google.com/spreadsheets/d/123ABC/edit#gid=0?key=56BS2J
- Log into your Google API Console, in order to create an app key
- Use an HTTP GET handler
Here is an example of how we connected Google Sheets to LabView and ultimately controlled our EV3 robot. However, you can structure your LabView code however you like!

googlesheets_to_ev3.vi |
Creating your EV3 Robot
This project utilizes Lego Mindstorms. Your model's design does not need to follow ours, but we will include instructions for our EV3 car below:
This project utilizes Lego Mindstorms. Your model's design does not need to follow ours, but we will include instructions for our EV3 car below:

ev3-car-instructions.pdf |
Looking for more inspiration?
Lego Mindstorms Building Instructions and Program Descriptions
Lego Mindstorms Building Instructions and Program Descriptions