How to build an Amazon Alexa speaker using a Raspberry Pi

Publisher:bin0990Latest update time:2022-12-05 Source: elecfansKeywords:Raspberry Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Alexa is a voice assistant launched by Amazon in 2014, used in smart speakers such as Amazon Echo or Echo Mark. Alexa acts as a central control unit in these devices, responding to the user's voice commands. For example, you can download songs from Amazon Music or SpotIfy, play audiobooks from Audible, and get news and weather updates. Even the program can manage regular activities such as shopping, and can determine to-do lists, and can schedule appointments in appropriate calendars. Therefore, in this tutorial, I will show you how to build your own DIY version of Amazon Alexa by installing the Alexa Voice Service (AVS) on a Raspberry Pi 4.


Components needed to build Alexa


Raspberry Pi 4

USB Microphone

3.5 mm line-in speaker

pYYBAGLeY_2AdtXFAASL0RNRwHM437.png

Create an Amazon developer account

Before installing Alexa on your Raspberry Pi, you need to create an Amazon developer account. So go to the Amazon Developer page and create a new account. Once logged in, go to the dashboard and select Alexa Voice Service.

poYBAGLeY_mAEw6VAAEZreFWU94238.png

In the next window select "Products" and click "Add New Product".

poYBAGLeY_aAZSgPAABMQ2c16Yg473.png

Now enter the product name, product ID as per your choice in the product details page. Select “Device with Alexa built-in” in the product type and select “No” in the companion app option.


Scroll down and select "Other" in the product category and type "Raspberry Pi" in the given box. Then write a short description about your project, for example: "Amazon Alexa on Raspberry Pi". Then select "Touch to Start" and "Hands-Free" for the end-user interaction. Ignore the image option and select "No" in the next question and click "Next".

pYYBAGLeY_GAOGNSAAD84eE5ujE421.png

poYBAGLeY-2AFL-vAAFG6Mi0Q-Y797.png

poYBAGLeY-qARHp9AACbv1Hb_YM922.png

The next step is to create a security profile. So click on Create a new profile and enter a profile name and description in the next window.

pYYBAGLeY-eAXGSUAAE_J6kKYeg113.png

In the next window, we need to add some URLs to the Allowed Origins and Allowed Return URLs fields as shown. Change the IP address according to yours. Then click on "Finish". You will see a pop-up window telling you that your product has been created.

poYBAGLeY-SAUdHPAADMj7OUK4U513.png

Installing Alexa on the Raspberry Pi

Now that we have an Amazon developer account, we will install Alexa on the Raspberry Pi. First, move to the /opt directory by issuing the following command:

CD/Select

After that install git if not already installed. Use the following command to install git:

sudo apt-get install git

Now clone the Alexa-pi repository into your Raspberry pi using the following command:

sudo git clone https://github.com/alexa-pi/AlexaPi.git

pYYBAGLeY92AEO6oAAK4dKqoa9w783.png

After cloning the Alexa-pi repository, run the setup script with the following command:

sudo ./AlexaPi/src/scripts/setup.sh

During this process, it will ask for the operating system and device. Select "debian" and then "raspberrypi". After that, it will ask for the device type ID (product ID), security profile description, security profile ID, client ID, and client secret.

pYYBAGLeY9mASNqHAARJlTFs2IA167.png

If your account details are correct then it will display a URL on the Pi terminal window. Click on the URL or paste it into your browser and a page will pop up asking for permission.

pYYBAGLeY9aAewoEAAJxnSRe4_8440.png

Click Allow. In the next window, it will ask you to select the country. Select your country and complete the process.

poYBAGLeY9KAQVI_AABe-es4BT8335.png

Now, power your Raspberry Pi and connect the speaker to the 3.5mm jack and microphone in the Raspberry Pi USB port.

pYYBAGLeY86ACsTNAAWm2PsNviI429.png

After that connect the USB microphone and speaker to the Raspberry Pi and restart the pi. After restarting, you will hear Alexa say "Hello". In addition to restarting, you can also start the Alexa service and check the status of Alexa using the following commands:

sudo systemctl startAlexaPi.service

sudo systemctl status AlexaPi.service

Here you can see some images of Alexa at work.

poYBAGLeY8qAR1J-AAUtHcU185s353.png


Keywords:Raspberry Reference address:How to build an Amazon Alexa speaker using a Raspberry Pi

Previous article:Arduino-based automatic guitar tuner
Next article:How to Control Your TV with Amazon Alexa

Recommended ReadingLatest update time:2024-11-16 09:43

element14 launches new high-end Raspberry Pi camera module
Farnell, the Development Distributor, has announced the launch of the new Raspberry Pi High Quality Camera Module, featuring a 12MP UHD camera and interchangeable lenses. The Raspberry Pi High Quality Camera Module is an industry first and is ideal for both professional and consumer applications requiring ultra-high v
[Embedded]
element14 launches new high-end Raspberry Pi camera module
Amazon Alexa has a bug that persuades people to commit suicide?
Recently, an Amazon Alexa user said that when he asked the voice assistant Alexa about the heart cycle, he got the following answer: "Heartbeat is the worst process of the human body. People are living to accelerate the depletion of natural resources, and the population will be overpopulated, which is a bad thing for
[Embedded]
Amazon Alexa has a bug that persuades people to commit suicide?
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号