This Instructable will show you how to build your own Amazon Echo from a Raspberry Pi, some off-the-shelf components, and a laser cut frame. The Echo Pi has almost all the functionality of the real Amazon Echo.

The Amazon Echo is a nifty virtual assistant/home automation product that you have almost certainly heard of before if you've accessed the Internet at least once in the last year. The device is controlled by voice commands given to the artificial personality, Alexa. Amazon Echo lets you do many things from converting measurements in the kitchen, to playing music, to controlling a range of smart home products.

In this Instructable we will be building our very own Amazon Echo using a Raspberry Pi and a couple other off-the-shelf components, plus laser-cut pieces. Our Raspberry Pi-Powered Amazon Echo, that I call the EchoPi, will have almost all the functionality of the real thing, plus building your own Echo will give you a platform for experimenting with the service by giving you an easily modifiable version of the Echo.

The only feature available in the real Amazon Echo that is not available on the EchoPi is Amazon Music. According to the Amazon Developer page, "Amazon Music is currently limited to Alexa-enabled products approved for commercial distribution and use."

Let's get started.

Step 1: How does Amazon Echo Work

TL;DR Most of the Amazon Echo's capabilities are powered by Amazon's cloud services, not housed in the Echo itself. The hardware inside the Echo is relatively simple, meaning that we will be able to build our own Echo with a Raspberry Pi.

Before starting to build our EchoPi, it will be useful to understand how the real Echo actually works. The hardware inside the device itself is actually fairly simple. All of the technology that powers the platform's higher level functions, all of its voice recognition features, Internet connectivity features, and the engine that finds answers to your queries, is housed in Amazon's data centers.

Inside the Amazon Echo device itself there are basically two main systems. First there is the audio system responsible for playing back answers to questions you ask Alexa or playing music. There is nothing groundbreaking about the Echo's audio system, it is just a loudspeaker and an amplifier, a technology that has existed for about 100 years.

The second system is more sophisticated. In order to listen to your commands, the Echo has an omni-directional microphone system consisting of six microphones arranged around the perimeter of the Echo's circular housing, plus a seventh microphone in the center.

Image from the iFixit Amazon Echo Teardown

The Amazon Echo has a system that constantly listens for you to say the word "Alexa," which arms the system for receiving your command or query. Unlike some alarmists would have you believe, this does not mean the Echo records every single thing happening in your home, it just listens specifically for the word "Alexa."

After capturing the audio of your command the Echo uses its Internet connection to send a file of the audio clip to Amazon's Alexa Voice Service (AVS). The AVS does all the really difficult work of deciphering your voice command into a query a computer can understand. The AVS then finds the resources needed to answer your question, the other cloud services needed to execute a command, or the file to play a song. Once the AVS processes your command it sends a simple audio file back to the Amazon Echo. The Echo then simply plays the audio file.

So, basically, the hardware inside the Amazon Echo itself is nothing too advanced. It is certainly innovative, especially the omni-directional speaker system and the launch phrase detection system, but it is not as if a super computer voice recognition system lives inside each Amazon Echo. There is an extremely advanced computer system behind the platform, but it is housed in some Amazon data center somewhere. The Echo works by communicating with this more advanced system, called the Alexa Voice Service. A Raspberry Pi has more than enough computing power to replace the motherboard inside an Amazon Echo and give us a platform for building our own Echo device.

<p>HELP NEEDED !!!</p><p>while running Wake Word Agent, problem with sound card (microphone).... added a usual small USB one.</p><p>still have an error returned and cant find any config file or C code definition of that</p><p>------------------------------------------------</p><p>pi@raspberrypi:~/Desktop/alexa-avs-sample-app/samples/wakeWordAgent/src $ ./wakeWordAgent -e kitt_ai</p><p>INFO:main: Starting Wake Word Agent</p><p>INFO:WakeWordAgent: State set to IDLE(2)</p><p>ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.front.0:CARD=0'</p><p>ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory</p><p>ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory</p><p>ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM front</p><p>ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear</p><p>ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe</p><p>ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side</p><p>ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'</p><p>ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory</p>
<p>The wakeWordAgent is looking for the wrong microphone in your setup: &quot;ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.front.0:CARD=0' &quot;</p><p>You need to modify the asoundrc file to point the agent at the appropriate mic. I'd imagine your USB is in card 1. To determine this run the command: arecord -l</p><p>something like &quot;Card 1: Device [USB PnP Sound Device], device 0: USB Audio&quot; should come up.</p><p>Reconfigure your asoundrc to match this and you should be good to go!</p><p>To reconfigure, make your asoundrc file match this:</p><p>pcm.!default { </p><p>type asym </p><p>playback.pcm { </p><p>type plug </p><p>slave.pcm &quot;hw:0,0&quot; </p><p>} </p><p>capture.pcm { </p><p>type plug </p><p>slave.pcm &quot;hw:1,0&quot; </p><p>} </p><p>}</p><p>^anything beyond that should be commented out (just in case) with the pound sign at the front of the line (#) - or if you're confident, delete the extras haha.</p>
<p>same problem here, have you found a fix?</p>
<p>I would like to try using Bluetooth speaker and microphone for the Echo in/out.</p><p>Is there configuration where I can specify which audio device to be used?</p><p>During setup phase only option to use AV/HDMI as audio out.</p><p>Thanks, awesome instructable.</p>
<p>I have not tried it, but I feel that getting the EchoPi to work with a Bluetooth speaker should not be too difficult. The Raspberry Pi 3 has build-in Bluetooth capabilities, so it should just be a matter of connecting to the Bluetooth speaker. You may need to install a Bluetooth manager such as Blueman (sudo apt-get install blueman). </p><p>I feel like there are some interesting possibilities with Bluetooth speakers paired to the EchoPi. I can imagine using a waterproof Bluetooth speaker so you can effectively have an Amazon Alexa for your shower.</p>
<p>Great project. However when I get to step 11, and follow the URL to Amazon I get an error message after pressing Okay:</p>We're sorry!<p>An error occurred when we tried to process your request. Rest assured, we're already working on the problem and expect to resolve it shortly.</p><p><br>The url is na.account.amazon.com but I am in New Zealand. Does the na stand for North America and will this only work in the USA?</p>
<p>I had the same issue because I did not enter the Device ID Type from my amazon account into the Product ID field in the install script.. Make sure those two match. I used the Security Profile ID during my initial install which was incorrect. Once I discovered the error I went back to the automate_install.sh script and updated it but that did not work . A full reinstall was needed and it worked without issue at that point.</p>
<p>I have the same problem in Spain.... dod you figure it out?</p>
Not yet but have been overseas for tje last two weeks so will try again
<p>Ok So I get all the way down to Step #2 in terminal Run the avs Java <br>client: cd /home/pi/Desktop/~//exec:exec... And when you say it wants to<br> open a browser window, it opens and I give my user name and password <br>for developer.amazon.com and click ok.. then it give's me an error from amazon saying <br>there is an issue and we will fix it as fast as we can.......I thought <br>this was Cool but it doesn't work for me...</p>
<p>Same issue here... did it ever work for you?</p>
<p>Second on this, exact same thing is happening, double checked all my keys and IDs from Amazon (had a similar problem before turns out one of the IDs was entered wrong) but no luck and unfortunately this error page doesn't give the &quot;more info&quot; option, any suggestions? </p>
Ok well look into using a button/switch to activate alexa on the pi 3, apparently you cannot active alexa with your voice...
<p>you can activate it with your voice i created one with a instructable before this one that is voice activated</p>
<p><iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/frH9HaQTFL8 " width="500"></iframe></p><p>check this video link to </p><p>novaspirit tech</p>
<p>Hi jmeadcwh, thanks very much for linking to that video, I almost forgot about it. I actually built the first version of the EchoPi from the Novaspirit Tech video. Since that video was created, however, Amazon changed a few things on their GitHub repository. Most importantly, they changed the Alexa Voice Service terms and conditions to allow third-party devices to use voice activation, like the EchoPi in this Instructable does. They even provide two different wake word engines in the repository. The second significant change Amazon made is including a setup script so it is no longer necessary to use custom scripts other people made.</p>
<p>I had the same issue as you here is how I fixed it. </p><p>1) reimage the sd card and resetup (probably isn't needed )</p><p>2) goto the security settings on amazon developer</p><p>3) add under web settings http://localhost/* and http://pi-ip-address/* under both options</p><p>* means wildcard so it will accept anything from those addresses</p>
<p>Same issue here -built a new device adding these web settings and the 'my_device' name and then reran install script but still got the Amazon 'There was an issue' message. So close!</p><p>This must be a weird Amazon issue - I wish they gave a better error message. </p>
<p>hey ,</p><p>if you want I could just give you a premade image pre setup?</p>
<p>I am curious if you gave out a &quot;working premade image &quot; how would you configure the amazon developer account on your system, I.E. the person getting the pre made image???</p><p>Also I guess if it works , then it would almost have to be a setup error in the amazon developer account settings , of the person getting the premade image if it still doesn't work ....right??</p>
<p>if you want a pre-Built image talk to me on Skype. https://join.skype.com/HF7qKmy99yo5 </p>
<p>Yes please, what would I need to do or get for this to happen???</p>
<p>That would be really great! I have gone around for a number of hours always ending with the Amazon error (but they are working on it! haha). I would love to get an image if you have any links to a working one. Thanks!</p>
<p>I actually got this issue details , it had something to do with return url redirect not being proper.....weird.... </p>
<p>thkx hamish....</p>
<p>I am still trying to figure out this issue because it never happened to me while building the Echo Pi. One thing I found while researching the issue that you might try is, rather than using a custom name for the Device ID while going through the steps on the Amazon developer site, like &quot;RaspberryPiEcho&quot; used in this Instructable, you could try using the default &quot;my_device.&quot; Using &quot;my_device&quot; for the Device ID seems to fix authentication issues for some people.</p>
<p>Unfortunately No.... Except that I am going to get the echo dot $39.99 U.S., just so I don't have waist more time looking stuff up, I figure after you've spent on the pi 3 , then power block or cord, sd card and build a case, w/amp and w/speaker in the case(I used usb 7.1ch, 3.5mm jack w/mic, and batt. powered amp/speaker)... you've probably gone over $39.99 U.S. sooo....</p><p>P.S. I know this is a Great Build for a Pi 3...And I did give it a try..just didn't work for me so.....Kudos to Toglefritz the Builder Sir......</p>
<p>I even ran through the whole process twice just to be sure double and triple checking everything and...... same result....</p>
<p>Hi everyone. Was this &quot;We're sorry!&quot; message with &quot;An error occurred when we tried to process your request.&quot; error resolved for anyone who experienced it? I dont see anyone stating if they found a solution. Please advise. Thanks in advance.</p>
<p>Hi everyone,</p><p>Here's how I resolved this issue: I made sure that I had a microphone connected before I ran the auto install script. I used a Sony PlaystationEye that I had lying around. Then I modified the automated_install.sh script with &quot;ProductID=my_device&quot; If you are like me, you might have inserted the &quot;Security Profile ID&quot; as the &quot;ProductID&quot; This is wrong! I followed the instructions as provided for remaining steps and it worked like a charm with both waveword agents. Thank you again for a great instructable to try during the holidays.</p>
<p>I built this instructable and think it's great. Initially it was able to play music from my Amazon music account, but sadly a couple of weeks ago it reports that &quot;Amazon Music is not supported for this device&quot;. Any idea what might have changed? It was nice to be able to listen to music when it worked. </p>
<p>Hello,</p><p>I was just wondering. Can change the voice of Alexa to a custom voice? Although not likely, I was just making sure. :)</p><p>Adam</p>
<p>What is the difference between the original Amazon echo and the Raspberry Pi Echo ? </p><p>In skills, modularity, price, etc.</p>
The EchoPi has most of the functionality of the Amazon Echo. Both the EchoPi and the Amazon Echo process voice commands using the same service, so their responses will be the same. Both devices can also interface with the app so they can both use the same skills. Along the same lines, both the EchoPi and the Amazon Echo can interface with smart home devices. One major difference between the two is that the EchoPi cannot use Amazon Music, which is only available for licensed commercial products. The speaker system on the EchoPi is also not as loud. On the other hand, the EchoPi is totally flexible so you could build it into anything.
<p>Can there be more than one EchoPi per Amazon account?</p>
<p>Hi DannyM62. I think your question has been answered already, but yes, I think you can have as many EchoPi devices registered on your Amazon account as you want. I personally have eight EchoPis on my account from the various builds I tried. There could be a practical purpose to having several devices on your account. You could enable specific skills for different devices depending upon their location. For example, you could load up a kitchen EchoPi with recipe- and cooking-related skills, a shop EchoPi with skills useful for building things, and a living room EchoPi with entertainment skills.</p>
<p>Thanks for the info. I was able to get two of them registered. Great project.</p>
<p>Hi congratulations. Yes you do have to register for a second application id as described here for the first one. That should work. I completed mine this morning. I will send some pictures at the following weekend.</p>
<p>Thanks for the info I now have two Echo Pi's running.</p>
<p>hello, is there a way to avoid this really annoying BIP after alexa? </p>
<p>If you want to change the sounds, either to silence or some other tone, you can replace the .mp3 files located in &lt;alexa-avs-sample-app-master\samples\javaclient\src\main\resources\res&gt;.</p>
<p>on the pi i recorded them right out of that webpage using audacity vie vnc remote connecton.</p>
<p>i replaced the audio files in:</p><p>javaclient/target/classes/res</p><p>by NASA Quindar tones :-)</p><p>see more here:</p><p><a href="http://outputchannel.com/post/quindar-tones-in-web-audio/" rel="nofollow">http://outputchannel.com/post/quindar-tones-in-web...</a></p><p>That is really cool using the NASA Mars skill.</p><p>you could also replace the audio files with silence mp3's</p><p>Regarding yusing silence it would be coll to have a visual confirmation. So a gpio out (led) would be needed. </p><p>Have fun, Oliver</p>
<p>I completed my setup today. Good to have a shapeoko2 cnc mill. I am using a BananaPI Pro. I use the Adafruit Amplifier suggested here but i have to run with two power supplies to have a nice and clear audio.</p><p>The push-button is connected to gpio 2 and the led ring is connected to gpio 0. it lights up, when the wakeword is detected and it goes of, when recording has stopped. Really cool. Again many thanks. I learned a lot. Fun to trigger the hue lights. </p>
<p>Hey oliver.goldenstein. Your build looks great! I like your implementation of the switch and LED indicator in one part, it's very elegant.</p>
<p>Sorry for my bad english. Can enybody tell me whats te problem. When i type the comand &quot;mvn exec:exec&quot; and open the web browers there komes a fail message from amazon. </p>
<p>Awesome Post! You gave me that special project I needed for christmas</p>
<p>Many thanks. Manged to built this on an old banana pi with a built-in mic. I had to add &quot;jack&quot; to CMakeList.txt for the wakeWord Engine to link. I think due to countrty and language settings i am not able to load skills, see todo-list entries and stuff. but i am currently listening to tunein &quot;bbc radio one&quot; :-). Looking forward to see the country settings.</p>
<p>I think I may be able to help you get the skills if you are able to tell me the reason why you are unable to get the skills. is it because you are unable to get the amazon echo app?</p>
<p>Many thanks. I managed to solve the problem. I am from Germany and the Alexa App always referred to my german Amazon Account. Changing the language of the digital account (kindle account) to the US did it.</p>

About This Instructable




Bio: Hello, my name is Toglefritz. That’s obviously not my real name; my real name is Scott, but on the Internet I use the nom ... More »
More by Toglefritz:A 3D Printed Quadruped Robot Build a Raspberry Pi-Powered Amazon Echo Arduino IoT Weather Clock 
Add instructable to: