I planned out this build several times with different equipment each time. I came to the best combination of components that maximizes the available space, and the performance of the audio system and smart features.
The diagram I've drawn will hopefully help you understand how all of these components interact.
- The speakers will be driven by the amplifier
- The audio input will come from the Raspberry Pi via the USB DAC
- The voice control will come into the Raspberry Pi via the USB Microphone
- The Raspberry Pi itself will driven by Alexa and Bluetooth
- The power system will feature two options for either plug-in or portable operation
- The Power Supply will provide 12V
- The Powerbank which will have its 5V output converted to 12V via the USB-C Power Delivery board
- A diode will ensure the current flows the right way given the two 12V sources
- The amp will receive 12V directly
- The Raspberry Pi will receive 5V via the 12V-5V USB-C stepdown converter
Out With The Old
I started by removing the old radio's internal chassis which came out fairly easily. I gave the wood cabinet a simple restoration using a simple "wipe-on" restoring compound, Restor-A-Finish. This made the restoration really fast and easy and did a great job of removing decades of residue and blemishes.
I removed the broken leather strap and replaced it with faux-leather purse strap, reusing the same brass footings and a leather punch for the mounting holes.
I decided I wanted to reuse the original dials, and then decided it would be a good idea to keep the original dial mounts on the chassis, so I used a cut-off wheel on a rotary tool to remove the top rail of the steel case after removing all the components. I could also use this rail to mount other components onto later, so I screwed a small wood block onto it to allow for easier installation later.
The Alexa Voice Service (AVS) has been built into a script for Raspberry Pi by Amazon developers, their documentation can be found here
To get Alexa up and running on the Raspberry Pi, I used the following rough steps. For more detailed steps with the actual code and pictures, please reference this article by Emmet at PiMyLifeUp.
- Create an Amazon Developer account
- Create a device profile
- Create a security profile for the device
- Export config.json
- Set up the Raspberry Pi with Raspian - flash to microSD
- Use a Monitor+Keyboard+Mouse to interface with the Pi
- Run the initial set up (updates, clock, wifi)
- Enable SSH
- configure .asoundrc with sound cards
- SSH into the Pi from Command Line Interface (CLI) on desktop
- ssh pi@"yourIPaddress"
- Copy config.json into /home/pi (I just used and FTP program)
- Run the AVS setup script
- bash setup.sh config.json
- Start up Alexa
- bash startsample.sh
- Authenticate Alexa at amazon.com/us/code using the code provided
- Create Alexa.service as a systemd service to start up Alexa with power and wifi
- Set up Bluetooth
Alexa on a Raspberry Pi has been done by many others before, and as I'm not very familiar with Linux, I couldn't have done this without their legwork. I also need to thank my friend Mike for helping me work through all the problems I faced along the way. Here are some things I learned that may get you unstuck if you attempt to do this yourself.
Tips and Tricks:
- Do not attempt to use a Raspberry Pi Zero W. I initially started off with one but there just isn't enough processing power to run the script and the AVS development team does not support it.
- To get the Bluetooth service on the Raspberry Pi set up as an audio sink for playing music from another device, use the following tutorial
- Change swapfile memory as needed to get the setup script to run uninterrupted (I added 2GB of swap memory)
- Make sure curl is installed prior to running the setup script (sudo apt install -y curl)
- Alexa.service may need a "-c" in the execstart line (ExecStart=/bin/bash -c /home/pi/startsample.sh)
I mounted the speakers to some thin plywood that I had...Read more »