Rasberry Pi Alexa

Introduction: Rasberry Pi Alexa

This project is meant to turn your $35 computer into a voice assistant with Amazon's Alexa voice service. Like Google Now and Siri, Alexa will answer questions about weather, your schedule, and more. Unfortunately due to the terms of service, you are required to use a button, but it is still a very cool project to complete. I will be using a Python Client from HERE. It shouldn't be to hard to complete, but if you have any questions, feel free to ask in the comments below. Now let's get started! (THIS video may help if you don't understand something; many of the steps are similar.)

What Parts You Need:

  1. A Raspberry Pi (Any model should work.)(I will be using a model 2)
  2. Micro SD Card (Recommended 8 gigabytes or more.)
  3. USB Microphone (Make sure it is compatible with linux.)
  4. Speaker that connects to Raspberry Pi (Most speakers will work.)(Needs Aux input.)
  5. Keyboard and Mouse
  6. HDMI TV or Monitor
  7. A Button

What Cables You Need

  1. HDMI Cable
  2. Micro USB Cable
  3. Two cables to connect button to Raspberry Pi
  4. AUX cable

Optional Parts (Make it somewhat portable)

  1. USB Wifi adapter (Make sure it is compatible with linux.)
  2. External Battery

Step 1: Installing NOOBS

We will be using a version of Jessie called Raspian. NOOBS is the easiest way to install it. Using a computer that has access to the internet:

  1. Head to the official Rasberry Pi wesite, (Or just click here) and head to the downloads tab. Hit the NOOBS box and download the NON-LITE one.
  2. Once the download is complete, insert your micro SD card, format it (link to program to format it), and unzip the contents of the zip file you just downloaded onto your formatted SD card.
  3. Eject the Micro SD card and insert it into the Rasberry Pi.
  4. Power on the Raspberry Pi, plug it into an HDMI monitor or TV, and go through the setup process of installing Raspian.
  5. Once you are on the Desktop, (see pictures) move on to the next step.

Step 2: Changing Permissions.

We will be making it much easier to work with the root directory.

  1. While on the desktop of your raspberry pi, launch terminal.
  2. Type into the terminal "sudo pcmanfm".
  3. Click on the root folder.
  4. Right click inside the application (see pictures), and click "Folder Properties".
  5. Navigate to the "Permissions" tab and change "View Content" and "Access Content" to Anyone.
  6. Make sure your Raspberry Pi is connected to the internet.
  7. You may close the pcmanfm application.
  8. Move on to the next step.

Step 3: Installing the Python Client

  1. Open Terminal and type in "cd /root".
  2. Then "git clone https://github.com/sammachin/AlexaPi.git" "
  3. Move on to next step.

Step 4: Registering As an Amazon Developer.

  1. Go to developer.amazon.com and create an account.
  2. Navigate to the Alexa tab and click on the Alexa Voice Service box.
  3. Navigate to "Register a Product Device>Device" and enter the following:
    1. Device Type ID = "RaspberryPi"
    2. Display Name = "RaspberryPi"
    3. Under the Security Profile Tab, create a new security profile.
    4. Security Profile Name = "Raspberry Pi"
    5. Security Profile Description = "RaspberryPi"
    6. Open another terminal window and enter "Hostname -I" That is your IP address.
    7. Go to the "Web Settings" and hit edit.
    8. Add 2 things to the allowed orgins:
    9. "http:localhost:5000"
    10. "http: Your IP Address :5000" EXAMPLE "http:"
    11. Add 2 things to the allowed return URLs:
    12. "http:localhost:5000/code"
    13. "http: Your IP Address :5000/code"
  4. Continue on with the setup until you get to "How many devices are you planning to commercialize?" and enter 0."
  5. Finish entering the rest of the information out.
  6. In the terminal used in the previous step, enter "./setup.sh"
  7. Use the the information you entered into the Amazon Website and the generated keys from the website to complete the setup in the terminal.
  8. Move on to last step.

Step 5: Testing It Out.

  1. You may close out of everything but a terminal window.
  2. Type "cd /root/AlexaPi"
  3. Plug in your speaker and microphone.
  4. Then type "python main.ph" into the terminal.
  5. You should hear "Hello!"
  6. Connect a button to pin 17 and a ground pin on the Raspberry Pi and go wild! (Picture shows GPIO pins for model B/B+) Picture of this can be found in AlexaPi folder on Raspberry Pi.
  7. The voice service should automatically start when you plug in the Rasberry Pi, so you can unplug the monitor, keyboard, and mouse.
  8. The app for Amazon does work and can be found on the Google Play Store and Apple's App Store for iOS.
  9. If you liked this project or want to give me constructive criticism, feel free to drop a comment below!

Step 6: IFTTT

Another cool use of the Alexa Voice Service is through If This Than That. Click Here to check it out! You can set up a custom trigger word and automate the world around you with only your voice.

First Time Author Contest 2016

Participated in the
First Time Author Contest 2016

Sensors Contest 2016

Participated in the
Sensors Contest 2016

Be the First to Share


    • Pocket-Sized Speed Challenge

      Pocket-Sized Speed Challenge
    • Super-Size Speed Challenge

      Super-Size Speed Challenge
    • Audio Challenge 2020

      Audio Challenge 2020

    4 Discussions


    1 year ago

    What is the limitations for this project? I mean until what extent can you ask this project?


    4 years ago

    its a good project, but you haven't explained the steps properly


    4 years ago

    its a good project, but you haven't explained the steps properly

    DIY Hacks and How Tos

    Cool accessibility project. This could help a lot of people.