Spotify Connect on a Raspberry Pi + Auto-on stereo
The inspiration for this project came because I wanted to be able to cast spotify to the speakers in my room similar to the way you can cast it to google home or roku devices. The heart of this system is raspotify, which is a super easy way to get “spotify connect” capabilities on a raspberry pi.
The Raspberry Pi:
Programming the pi was very easy. After flashing raspbian onto my OG Model 1 raspberry pi, the raspotify setup was a super easy one line install. Here’s the link to the raspotify project.
The other piece of the puzzle was getting the stereo to turn on. The most elegant way to do this would be to have the Raspberry Pi trigger a relay via a GPIO when raspotify detects that a device is connected. I have no desire to dig into the raspotify code & build from source, and I have a buttload of arduinos, so the easiest solution was to have an arduino detect when the raspberry pi was playing audio and have it trigger a relay. The software/hardware for this project took just about as long as it took to document it here.