Raspberry Pi RadioHAT
Dec 2022
A Raspberry Pi HAT for PWM audio and additional peripherals to create easy media player platform
- Linux
- Electronics
- C++
- 3D printing
For a personal need I created a digital radio and Spotify connect player. I used a Raspberry Pi Zero W and developed a custom HAT (Hardware Attached on Top) for it.
The HAT has a mono PWM audio output, based on the design for the PedalPi by Electrosmash. I designed the HAT in a way that it can be used for other projects as well. So, there are general pins for buttons, switches and LEDs to create a custom interface and also a power section to give steady 5V power to the Pi.
The digital radio audio is obtained via MPD (Music Playing Daemon) and the Spotify Connect server is the spotifyd library. I developed a custom bash script that interfaces between the peripherals and the code. I also setup an ALSA config to be able to switch between the two audio sources.
The Raspberry Pi zero W and the RadioHAT
This project was very much in my comfort zone, but still I learned new things. For example, I was introduced to configuring low level audio devices in Linux using ALSA. Also, I had never created a manufactured PCB. Until then, I only used perfboard for my projects. I quite liked the process and it was easier than I thought it would be. I will definitely do this more often in the future.
Code on Github