Raspberry Pi Pico 2 Spotify Desk Player
Links
Introduction
Raise your hands: how many of you listen to music? Probably quite a few of you just raised your hands. I listen to music too, but have you ever struggled to change the song? It’s a monumental task that requires intense concentration.
. . .
I might be being a little facetious there. Many of us have a second monitor, pop the player out in picture-in-picture mode, use our phones, or simply use whatever touch controls our headphones provide. I’m sure there are dozens of options.
However, the option I wanted was a touchscreen desk device that displays the current song and lets me choose which song is playing, as well as play, pause, and skip tracks.
So I completely and arbitrarily chose a Raspberry Pi Pico 2 and a ST7796S TFT resistive touchscreen.
Overall Design
I went on Amazon, picked out a microcontroller and a screen, and did almost no research to check whether they would actually work together.
I dove into figuring out the Pico and display and, with a little help from AI, figured out how to design the program. The screen I purchased had an ST7796S chip on board, which is well-documented and has plenty of tutorials. It includes an SPI interface, making communication with the Pico easy. well-documented C++, Arduino, and Python libraries have been developed for it, but i ended up settling on Python because I hadn’t done very much with MicroPython and wanted to experiment with it.
I took quite a bit of inspiration from the Pimoroni Presto, which also coincidentally has an RP2350 chip in it. — Maybe that’s why my subconscious went straight to the Pico 2 as my microcontroller of choice. I knew my enclosure would be a bit bulkier and less refined than the Presto, but gosh darn it, I was determined to make it myself, so here we are. For some reason, the Pico 2 still uses a micro USB port for data and power, so I also knew I would have to pick up a cheap break out board.
The hardware is pretty simple: a cheap Amazon screen, a cheap microcontroller, and a cheap USB-C breakout board. Nice.
Now, onto the hardware…
Touchscreen Difficulties and Switch to a Capacitive Touchscreen
Remember how I said I didn’t look into the screen very much? Well, this bad boy comes with a resistive touchscreen. Resistive touch-screens aren’t ideal for precise input, and that was something I definitely needed for this project.
- Resistive touchscreen
- A resistive touchscreen works by sending a voltage across two invisible layers of conductive material. When those layers are pressed together by your finger, they create a voltage divider that allows the screen to determine where it is being pressed.
- Capacitive touchscreen
- This is what most touch-screens use. The screen creates an electrostatic field, and when a finger touches the screen, it acts as a conductor, disrupting the field and allowing the screen to pinpoint where it is being pressed.
Resistive touch-screens are useful in industrial environments. They can be made more robust, and are suitable for demanding applications. They can also be used with gloved hands or styluses as they do not rely on the human bodies natural capacitance for functionality. The downside? The touch accuracy and responsiveness SUCKS, and because the top layer must bend, they are often plastic screens. For obvious reasons, a resistive touch screen was not the optimal solution for this project.
So I did some actual research and settled on literally the exact same thing save for a capacitive screen and a different touch IC. This did make using it as a drop in replacement very easy. I had to shuffle some of the touch screen pins around as the capacitive chip also communicated with SPI, and I just decided to use a different SPI bus as the Pico has 2.
Lets talk about the program now.
The Program
The programming itself wasn’t too bad. I needed a little help from AI, but overall, I got everything working pretty well. The project uses the Spotify API to grab details about the currently playing song, along with its playback status.
There is a companion program running on the user’s computer. Its job is to process the album artwork using Pillow before sending it to the Pico. I do not love this solution, but the Pico was taking way too long to decode and display the artwork on its own. I definitely want to revisit that problem and find a better solution later. For now, though, running a local program and grabbing the image over LAN worked, so that’s the approach I used to get the project finished.
I’m also not a huge fan of the current UI. That’s mostly because it was almost entirely vibe-coded, and it shows. UI design is one of my weaker areas, and I’m improving, but most of my attention went toward getting the rest of the project working.
So, is it perfect? Definitely not. But it works, and I learned a lot from building it.
Chassis Design
This is what I really enjoy doing. Some good Ole hardware design. Again, I’m taking inspiration from the Pimoroni Presto, I’m shooting for the same sort of angled steel sheet design… except I’m going to 3D print it. (maybe I order something later on and make it out of metal. 🤔) .
I added a joint at the bend so that both pieces can be 3D printed with minimal supports, and the standoffs that the heat set inserts go in can be printed in the optimal direction. For this first version I didn’t enclose it, and just left all the guts hang in the wind.
This chassis has some severe industrial vibes going on. And I like it. Some of it stems from… unrefined design laziness. But as you can see with the theme of this site, thats kind of the vibe I shoot for.
I added some rubber feet and stared using it day to day.
Conclusion
And that’s pretty much where we stand. I’m definitely going to keep working on it, especially the chassis. I’d like to make something that can be printed in one shot, but keeping it support-free is going to take a little bit of work. It’s also going to get a full enclosure to hide all of its guts.
The next big step, though, is getting a PCB fabricated. Something that can connect the Pico and screen without all of the fragile jumper wires. I have experience with PCB design, so I’m not sweating it. I just didn’t get around to it before I wanted to publish this.
As for the programming, I really want to give the UI some love. I’m not sure when I’ll get to it, or even whether I’ll have it done for the next version, but there’s just something about it that I don’t quite like. We’ll see. I also want to see if I can get any kind of on board Pico image decoding working, that way we do not have to run that silly companion program.
The next immediate thing I’m going to add, however, is a like button. I would use the heck out of that.
Parts
- Raspberry Pi Pico 2w
- Rubber Feet
- Screws
- Inserts
- USB-C Breakout Board
- Screen
Sources
Szente, CC BY-SA 3.0, via Wikimedia Commons
Mercury13, CC BY-SA 3.0, via Wikimedia Commons