How to Build an Amazon Echo with Raspberry Pi | Computing

Many people today are using assistant software in their homes and offices to help with everyday tasks. There are many different models to purchase, but did you know you can your own? Amazon Developer allows you to use the Alexa software to create your own Amazon Echo with Pi.

For this project, you'll need:

  • The Raspberry Pi 3 or Pi 2 Model B and Micro-USB power cable
  • Micro SD Card (Minimum 8 GB) – If you don't have an operating system installed, there's an easy-to-use operating system called NOOBS (New Out of the Box Software). The simplest way to get NOOBS is to buy an SD card with NOOBS pre-loaded.
  • USB 2.0 Mini Microphone
  • External speaker and 3.5mm audio cable
  • USB Keyboard and Mouse and external HDMI Monitor
  • Internet connection (Ethernet or WiFi)
  • For a Pi 2 to connect to the Internet wirelessly, you need a WiFi Wireless Adapter. The Pi 3 has built-in WiFi.

If you need an Amazon Developer account, create a free one on their page. Read the AVS (Alexa Voice Service) Terms and Agreements here.


Complete your profile information.


Read and accept the App Distribution Agreement.


Select whether you are choosing to monetize your apps.


After registering your Amazon Developer account, create an Alexa device and Security profile. Make careful note of the following parameters as you go through the setup – ProductID, ClientID, and ClientSecret, because you need to enter these again later.

From the top menu, select “Alexa Voice Service.”


The “Welcome to Developer” screen will appear.


The first screen asks about the product you are building.

1. First, name your device.


2. Next, type a Product ID with no spaces or special characters.

Note: You need this later. Record it somewhere.


3. Select Alexa-Enabled Device for the product type.


4. Alexa needs a companion app. Select yes for this question.


5. Wireless Speakers from the dropdown menu.

6. Enter “Raspberry Pi Project on Github” into the description box. This is information for AVS and isn't visible to others.

7. Check both the “Touch-initiated” and “Hands-free” options.


8. You can upload an image for your device, but let's skip this step for now.

9. Check “no” for commercial distribution and children's product questions.


10. Click “Next.”

On this page, you create a new LWA (Login with Amazon) security profile to identify the user data and security credentials with this project.

1. Click “Create new profile.”


2. Create a name for the profile. It could be something like, “Alexa Security Profile.”


3. Type a description for the profile. You can choose “Alexa Security Profile Description.”


4. Click “Next.”

5. Amazon generates a Client ID and Client Secret for you. These are the other two values you need later. Keep them nearby.


6. Enter your Allowed origins and Allowed return URLs. We're setting up http and https routes for this project, so type the following into your “Allowed Origins” field — “http://localhost:3000.”

7. Click “Add.”

8. Type “https://localhost:3000” into the same box where you typed the first one.


9. Click “Add” again.

10. Do the same thing to the Allowed Return URLs, except enter the following two URLs:

11. The page should look like this before you click Finish. Make sure none of your URLs are still in the field where you typed them. They are displayed on a grey background after you add them.


12. Once you click “Finish,” this screen appears. Your project has been created and is ready to install.


1. Open Terminal.


2. Type the following:

Before you run the install script, update the script with the credentials that you recorded from Amazon — ProductID, ClientID, ClientSecret.

1. Type the following in Terminal:

2. When it runs, this screen appears. Use the arrows on your keyboard to navigate, and replace the fields for ProductID, ClientID, and ClientSecret with your values.


The changes should look like this:

3. Type Ctrl + X to exit the script. Type Y and then Enter to save your changes.

To run the script, open Terminal and run the following commands.

While this script is running, you will be asked to answer some simple questions. These are to make sure you've completed all of the necessary setup on Amazon before you install the program.


The installation is about thirty minutes, so go grab a snack.

When installed correctly, your terminal window will look like the following image.


You must complete three steps to run the Alexa app. Each of them must run in a separate Terminal window, and you must do them in the correct order.

There were some programs that I needed but didn't have. I installed these programs as I went. In case you have the same problem, I included a side note about this in each step.

Terminal 1

This window runs the web service to authorize your app with AVS (Alexa Voice Service)

Open Terminal and type in the following commands:

Note: npm is a package manager for the JavaScript programming language. If it is not available when you run the command, you can get it here.

When the scripts finish, the window looks like this, showing that Pi is listening on port 3000.


Don't close this window. It needs to remain open while completing the next steps.

Terminal 2

This window communicates with AVS.

Type the following into another Terminal window.

Note: mvn is short for Apache Maven. If you don't have it, click here to get started.

When you run the client, a dialog box appears saying, “Please register your device by …”

Click Yes.


With some browsers, you'll get a warning that the connection is not safe. Dismiss this by clicking the “advanced” button. Then on the next screen, click on “Proceed to localhost (unsafe).”

Now, log into Amazon using your developer credentials.

The next screen asks for permission to use the security profile you created earlier for the device you are registering. Click Okay.


You will be redirected to a URL beginning with “https://localhost:3000/authresponse” that looks like the following image.


Go back to the open dialog box and click the OK button. The client is now able to accept requests from your Alexa device.

Keep the terminal open as well as the Voice Service Dialog box.


Terminal 3

This window installs the application that wakes up Alexa by using her wake word. Skip this if you don't want to use voice to initiate Alexa.

Open a new terminal window and use one of the following commands to bring up a wake word engine using Sensory or KITT.AI.

To use the Sensory wake word engine, type:

To use KITT.AI's wake word engine, type:

Test it out

Talk to Alexa by saying the wake word, “Alexa.” Wait for the beep before giving your command. For example, try it by saying, “Alexa.” Wait for the beep, and then ask, “What's the time?”

If she responds correctly, you have a working Alexa device!

Check out Amazon's Alexa webpage for more ideas. This Alexa can do everything an Echo can do!

You might also like
Leave A Reply

Your email address will not be published.