Step 2: Bill of Materials

Here’s what hardware you need to have our voice-activated speaker ready to work in your home. We’ve put links to find it at good prices. If the links are not valid anymore please send us an email we’ll help find replacements.

Important parts:

1. Raspberry Pi Model 3 — link / 35€ ($37)

2. Hifiberry AMP+ & 12V Adapter — link / 50€ ($53)

3. Speaker (25W, 4 Ω, 10mm) — link / 13€ ($14)

4. USB Microphone — link / 20€ ($21)

Fancy parts:

These part are not mandatory, but they make your voice-activated speaker stand out! 😎

5. Arduino Micro — link / 18€ ($19)

6. Neopixel Ring 24 — link / 15€ ($16)

7. Passive radiator — link / 11€ ($12)

The Case:

To make it easier for you to assemble those parts we made a 3D printable case.

The Plans are here.

If you don’t have a 3D printer, that’s fine, we don’t either! We used 3D Hubs services to print our version (it was fast and the price made sense). The price will depend on the material you use. It cost us 95EUR (100$) to print at our hub in Paris.

Miscellaneous:

DC Female plug — link / 3€

HotGlue Pistol — link / 6€

Screws 2mm x 6mm

Wires (Audio and Electronic)

Any questions, improvements ? Check the forum

Step 3: Setting up Software & Drivers on the Pi

a. Setting up Spotify

The first step in making a voice activated speaker was to set up music playback. For this, we decided to use Mopidy, an open-source music playback platform that provides easy ways to connect multiple sources of music and multiple ways of controlling playback. It has built-in support for Spotify, a number of existing web-based controller apps, and an extremely well documented API for controlling the playback programmatically.

To enable streaming music from Spotify, you need a premium account that has e-mail authentication. If you created your account with Facebook, there is an option to add an e-mail password authentication.

/!\ This account must use a username and password to authenticate, and not the Facebook authentication.

Create a Spotify application

Retrieve the client_id and the client_secret from the application

and the from the application Keep this information at hand, and copy it in the “home/pi/config” file

b. Connecting the Hifiberry

To power the speaker and to improve the sound quality (the default sound quality on the raspberry Pi is … not the best) we are using a Hifiberry AMP+. There are many sound cards that you can use. Some are made specifically for the Raspberry Pi, although most sound cards ought to work. We decided to go with the HiFiBerry because it seemed like the easiest option to get started with at the time, and we’re happy with the result.

The good thing is that you don’t need and extra alimentation for the hifiberry, because it powers the Raspberry pi

The HiFiBerry sits on top of the Raspberry Pi, as a shield. It requires a 12V power source to power itself and the Pi, and has a connector for hooking up speakers. In order to be recognized by the system, some minor modifications must be made to the ALSA config file, but the HiFiBerry tutorials make the process fairly straightforward.

From the /boot/config.txt file, remove the line:

dtparam=audio=on

And add the following line (this varies depending on the model of card you are using, here we are using a HiFiBerry AMP+)

dtoverlay=hifiberry-amp

And you’re set !