Close
0%
0%

sPot: Spotify in a 4th-gen iPod (2004)

Full-on Spotify scrolling and streaming via a Raspberry Pi Zero W and the original iPod clickwheel. Bluetooth, WiFi, and haptic feedback!!

Similar projects worth following
My mother-in-law recently gifted me a bag of the family's retired iPods. I had forgotten how good it feels to hold and use one of these things. Naturally, I decided to modify one. I wanted to supply some modern features (streaming, search, Bluetooth audio, etc), while paying homage to the amazing UX that Apple originally released almost 20 years ago.

Fast forward a few months - here's the sPot (ess-pot)! We've got:
* Streaming/Search via Spotify.
* Scratch-built UI, written in Python, based on the OG iPod experience.
* Full control via the original "click wheel".
* Haptic feedback.
* Micro-USB port for charging.
*... Linux, because there's a Raspberry Pi inside.



Hardware overview:

* Power is provided by a standard rechargeable li-ion battery. It's charged through a 500 ma Adafruit USB charger, and boosted to 5V using the Adafruit PowerBoost Basic. Both the Raspberry Pi and the display run on 5V.
* The click wheel connected to the original iPod motherboard via an 8 pin FPC cable. Thanks to this 10-year-old Hackaday article (and accompanying blog post by Jason Garr , I was able to find the pinout. Using an FPC breakout board, I easily connected the click wheel controller's 3.3V, GND, Data, and Clock lines directly to the Raspberry Pi. (More on this in the software overview).
* I used one of the Raspberry Pi's GPIO pins to drive a small DC motor (through a transistor, of course) for haptic feedback. I use quick haptic pulses in place of the iPod's original click sound, which triggers as your finger crosses each of the click wheel's virtual "steps".

* Repurposed the iPod's original lock switch to control the device's power. Conveniently, the PowerBoost module has an "enable" pin that can simply be pulled low to cut all power.

* Connected the display directly to 5V and the Pi's composite video output!




Software:

* I installed Raspberry Pi OS Lite as my OS. I figured I'd be conservative by not installing a full desktop environment, not sure if that was actually necessary in retrospect. The Pi Zero is more capable than I originally figured.
* Streaming from Spotify was surprisingly simple. I installed Raspotify, which just runs as a daemon and handles everything once you've authenticated. When it's running, the Pi appears as a "Spotify Connect" device on your account, and you can instruct it to takeover playback via an HTTP request (or using the UI of another authenticated Spotify client!).
* I used the Spotipy Python library to authenticate, search Spotify's catalog, fetch my saved artists/albums/playlists, and send playback commands to Spotify's servers.
* I wrote the UI as a Python application using tkinter. It was honestly pretty great to work with - front-end frameworks are hard to pick up! And this project was the first time I put any real effort into learning (and trying to love) Python. Forgive me, I spend most of my time in JVM-land.
* Referencing Jason Garr's blog post, I wrote a C program to the bitbang the click wheel's serial data into the Pi. I used pigpio to control the GPIO pins. Once I parse out the button presses and finger position, I send the data to the UI application via UDP. Jason - THANK you, wherever you are. This project would have been nothing without the original click wheel, and I would not have been brave enough to try to figure out the pinout myself. I will - hopefully - on future projects.
* ^ I snuck the haptic control into the C program that reads the click wheel. When the user's finger position changes, I quickly pulse the GPIO pin that's hooked up to the haptic motor. This was super easy, but the downside is that the haptics don't sync perfectly with the UI. For example, if you reach the bottom of a list, the haptics will continue even when the scrolling stops. It syncs perfectly while actively scrolling, so I didn't think it was worth changing.
* I use Redis (via Python library) to persist/cache user's Spotify data.
* I use Openbox to host the UI Application, which starts automatically once the PI boots up.
* I use pi-btaudio to get Bluetooth audio out of the Pi.

All of my source code will eventually be available here.


iPod-Spotify client UI running on Desktop
I was able to develop the UI entirely on my MacBook! Only had to optimize a tiny bit when I migrated to the Pi.
Earlier in the build: Haptic motor too big. Battery too small. Sketchy charge/boost module. Tried using a transistor to switch all power, but it kept cutting out.
These screens are adorable. Not bad image for composite input, either!
The "Now Playing" screen

Issues / TODOs:
* At some point the Pi started emitting a high-pitch whine. Big spike at 16khz and a little something at 8khz. What could this be? Doesn't bother me too much...

Read more »

View all 10 components

View all 3 project logs

Enjoy this project?

Share

Discussions

zburhop wrote 02/25/2021 at 13:20 point

I made this Fritzing wiring diagram the other night.  Its how I wired my ipod up.  In case anyone finds it useful.

https://ibb.co/7tVtXK5

  Are you sure? yes | no

ethanheiss wrote 02/26/2021 at 02:09 point

Very dumb noob question but what gauge wire did you use?

  Are you sure? yes | no

zburhop wrote 02/26/2021 at 04:02 point

I used this wire. It’s my favorite. It’s silicone sleeved and 24awg it’s nice and flexible when your trying to squeeze this all together.


https://www.amazon.com/StrivedayTMFlexible-Silicone-Electric-electronic-electrics/dp/B01LH1G2IE/ref=mp_s_a_1_3?dchild=1&keywords=silicone+wire&qid=1614311006&sr=8-3

  Are you sure? yes | no

zburhop wrote 02/24/2021 at 12:41 point

Has anyone got the software to run?  Mine boots to command line and nothing else.  I've added all of the nessicary auto start stuff.  Been over it with a fine tooth comb.... nothing pops out.

  Are you sure? yes | no

sebakitzing wrote 02/25/2021 at 05:52 point

Same is happening to me. Im connected to the monitor, not the 2" screen... But I've done everything twice anda checked everything

  Are you sure? yes | no

ethanheiss wrote 02/24/2021 at 01:09 point

another question, how did you wire the lock switch to power on and off the iPod? 

  Are you sure? yes | no

zburhop wrote 02/24/2021 at 22:34 point

looking down at the hold switch board starting from the right side there are two pins. Solder a wire to each. You can leave off the third. One wire needs to go to the ground on the powerboost 1000 and one wire needs to go to the pin labled EN.  This will toggle power on and off.

  Are you sure? yes | no

ethanheiss wrote 02/25/2021 at 04:05 point

Wow thank you man saved the build!

  Are you sure? yes | no

zburhop wrote 02/25/2021 at 05:17 point

no problem.  Did you get the software going?  Im kind of at a standstill and would appreciate some help.

  Are you sure? yes | no

ethanheiss wrote 02/20/2021 at 01:00 point

I hate to be one of these people but if you make a full guide can you add a part about how to install the software and get the iPod setup? The hardware was easy just very lost on the software end. Thank You.

  Are you sure? yes | no

Guy Dupont wrote 02/20/2021 at 01:46 point

Yeah sorry, I did not anticipate anyone else actually trying to get it runaming. Have you looked at the github repo recently? As of yesterday, folks had added quite a few details about the software in the readme

  Are you sure? yes | no

ethanheiss wrote 02/20/2021 at 19:12 point

Wow just saw the update thank you so much! I practically need hand held doing this stuff appreciate it.

  Are you sure? yes | no

zburhop wrote 02/24/2021 at 22:34 point

Have you got this to work.  Im struggling with the software.

  Are you sure? yes | no

wc.przenosne wrote 02/19/2021 at 14:39 point

This is absolutely outstanding! I've never thought someone would be able to do this. I know and see it's uncomfortable to use daily, but hey - Spotify on an iPod! You hit many headlines lately!

-------------------------------------------

https://wcskip.pl/

  Are you sure? yes | no

sebakitzing wrote 02/18/2021 at 23:19 point

Hey @Guy Dupont did you work with the standard or fat size iPod?

I want to replace my back housing so getting the fat one might not be a bad idea... But if the standard works, I'm keeping it

  Are you sure? yes | no

Guy Dupont wrote 02/19/2021 at 02:35 point

I used the 20GB, which I think is the standard?

  Are you sure? yes | no

sebakitzing wrote 02/19/2021 at 03:06 point

Yep, that's the standard. Thanks!

  Are you sure? yes | no

Junaldinho wrote 02/18/2021 at 14:32 point

Question to everyone, I am trying to purchase all the components to create this build but struggling to find a 2inch TFT display as every online store seems to be sold out or discontinued, has anyone tried another display that works with this build and if so how would you wire this? Thanks 

  Are you sure? yes | no

Guy Dupont wrote 02/18/2021 at 16:55 point

Looks like one left here!
https://chicagodist.com/products/ntsc-pal-television-tft-display-2-0-diagonal?variant=21653023684&gclid=Cj0KCQiAvbiBBhD-ARIsAGM48bwj-t8NUYV-h3K19CKr-ImAb0OTPq1QQbanbq3fMSf9eSkyXqYfCX0aAk7WEALw_wcB

But yeah I'm also curious about alternatives. I think there are plenty out there with a correctly sized display... but the carrier boards tend not to fit in the iPod case. 

  Are you sure? yes | no

Junaldinho wrote 02/18/2021 at 17:13 point

thanks Guy, however I’m in the UK and they don’t deliver to us. I’ve looked at alternative screens but they seem to be hats for the Pi Zero unit which would be too thick for the iPod case. Hopefully someone could find a solution. 

  Are you sure? yes | no

efernan wrote 02/18/2021 at 18:59 point

Hi!

I'm testing this: 

https://www.amazon.es/gp/product/B081NBBRWS/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1

I'm fighting with the dremel to fit the ipod case...

You may want to take a look here:

https://github.com/dupontgu/retro-ipod-spotify-client/issues/9

  Are you sure? yes | no

Junaldinho wrote 02/19/2021 at 00:59 point

thanks will take a look at this. If you manage to connect this up could you post a picture of how you wired this up to include space to connect the click wheel. 

  Are you sure? yes | no

dave wrote 03/05/2021 at 09:18 point

Hi, I ordered this screen and just received it but looks big for the case!

Did you succeed to fit it in?

  Are you sure? yes | no

Kakoub wrote 02/16/2021 at 17:03 point

Hello I tried to figure out the full electronic diagram and correct wiering but I'm not 100% sure to be correct especially about connecting the Rasb pin 34 and for the TV output, also I'm not into haptic feedback for myself, so I didn’t included it. I add what Guy post for the clicking wheel wiring thanks for that :).

Here is a pic: https://i.imgur.com/bx0WM4p.jpg

Please fell free to tell me if I'm wrong anywhere or if I'm not using the correct terms on my diagram I'm still fresh to this.

  Are you sure? yes | no

Guy Dupont wrote 02/16/2021 at 17:14 point

Your wiring looks perfect! What exactly isn't working for you?

A few things to look into:
1. Have you enabled composite video output?
https://magpi.raspberrypi.org/articles/rca-pi-zero

2. For the click wheel, have you compiled and run my click.c program? I start it up when the pi boots.

3. Are you sure your click wheel ribbon cable is going in the right direction. The pins are only labeled on once side. (I had this messed up originally).

  Are you sure? yes | no

Kakoub wrote 02/16/2021 at 17:17 point

Haha I didn't began to really try it out, I wanted to be sure of my diagram before soldering any stuff :) 

  Are you sure? yes | no

nicholassieracki wrote 02/19/2021 at 01:13 point

Thanks Kakoub,

Guy,

II wired up off this diagram, bit it doesn't seem to boot via GIPO PIN2 is there anything special that I have to do in software to enable this?

 When I power the PI via USB both the Pi and the display boot up. But when I disconnect and power via the Adafruit charger, neither get power.

thanks

  Are you sure? yes | no

Mike G wrote 02/14/2021 at 15:27 point

I too have a 4th gen ipod that doesn't seem to want to charge. Ive been told its the IC on the logic board. I have a spare raspberry pi zero w and would love to overhaul this so I can run rockbox or similar and preferably maintain use of the headphone jack but have no idea where to start.

  Are you sure? yes | no

Phil Karza wrote 02/10/2021 at 01:14 point

could you make this into an mp3/flac  player to make it just like an ipod.... so we don't have to stream??  What do you think - have it open up clementine (my favorite) or another player??  I would love that...  enable ssh and auto start clementine and networking....

  Are you sure? yes | no

Guy Dupont wrote 02/10/2021 at 01:30 point

Yup, this will run any music player that will run on the Pi! Just need to write a little extra software to map the click wheel input to key commands.

  Are you sure? yes | no

Phil Karza wrote 02/10/2021 at 01:38 point

That would be GREAT!  I have several non-working 4s....   I would like to see this run a music player, be loaded by network and charge by a port - Volumio would also be a great thing to add to this.

I just set up a player and used this DAC - i2s - and it is pretty easy to set up... and is smaller... and does work with a small amplifier board, too

https://www.aliexpress.com/item/4000292708385.html?spm=a2g0s.9042311.0.0.10574c4dLU6wbA

https://www.aliexpress.com/item/1005001913390877.html?spm=a2g0o.productlist.0.0.24db381cu1cCDu&algo_pvid=562461e2-f679-4e9c-8454-af89f827455c&algo_expid=562461e2-f679-4e9c-8454-af89f827455c-1&btsid=0bb0622c16129209779846535e16f4&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_

  Are you sure? yes | no

Phil Karza wrote 02/10/2021 at 01:52 point

forgot to mention - a battery indicator would be good, too!

  Are you sure? yes | no

Phil Karza wrote 02/12/2021 at 02:52 point

Is there anything I could do to help?

  Are you sure? yes | no

Guy Dupont wrote 02/13/2021 at 14:30 point

@Phil Karza nice! did you get the i2s to work with Raspotify, or another music player? Very cool either way. And I thought about a battery indicator too - any ideas how to get that done without taking up much more space? 

  Are you sure? yes | no

Pierre-Loup M. wrote 02/14/2021 at 10:48 point

@Guy Dupont @Phil Karza I've used I2S DAC with Pi Zero, namely the PCM5102A that is used in almost every sound board made for the Pi. Pimoroni had (I believe they no longer make it) a nice phatDAC hat for Pi Zero with it on it. It works really well, the only thing you have to do is to set the Pi to output audio on I2S. There is a comprehensive how-to at this address, with both a one line script and a extended manual setup, here : https://learn.pimoroni.com/tutorial/phat/raspberry-pi-phat-dac-install
The pinout is available here : https://pinout.xyz/pinout/phat_dac#

I believe your sPot could have audio out through the jack as well with very little hassle ! ;)

  Are you sure? yes | no

sebakitzing wrote 02/14/2021 at 13:06 point

@Pierre-Loup M. Doing that would leave the audio output only to the headphone jack? Any ideas on some setting where you can choose  BT/HeadphoneJack?

  Are you sure? yes | no

Phil Karza wrote 02/14/2021 at 18:19 point

I got it to work on volumio - it was not a problem - but there were several different solutions for wiring and software configuration.  I did kind of a hybrid.

As for the battery indicator - it a hotkey combo was able to be added to switch to desktop, that could work ?  would  it also be possible to have the code to work with vlc, for instance?

  Are you sure? yes | no

Pierre-Loup M. wrote 02/15/2021 at 13:47 point

@sebakitzing : to my knowledge there is not conflict between I2S and wifi / bluetooth. I use I2S audio + wifi on my Wendy project (see my profile), it's ok. I believe audio out can be routed to several outputs, but that may be needed to write some scripts. I suppose a good start are the Alsa and Jack documentations. Alsa is the default audio layer in Raspbian, I'm not sure if Jack is preinstalled.

Maybe volumio and other audio ditributions of linux have informations about that. Making a connected player for my hifi system is a project I've had for a long time, but never had the time to look at it...


For the headphone, itself, the PCM5102 is a both qualitative and cheap solution, but it gives a line level. A headphone amp (on chip or discrete components) will be needed.

I'm currently working (well, I haven't look at it in a month) on a esp32-based iPod, on which I use both the PCM5102 for hifi audio out and TPA6130A2 for headphones amp. I will publish the project, but I need to progress more on it. And as it's working on the esp32, it can give directions for hardware, but not for software.

  Are you sure? yes | no

Allen Kreager wrote 02/09/2021 at 16:02 point

This project is incredible! I should be getting my iPod today from eBay. I am going to work on a good 3D model of the gutted internals of the iPod and start putting together a 3D printed frame to hold all the components. I want to experiment with other displays and try to get something working that can turn the backlight off. 

  Are you sure? yes | no

Allen Kreager wrote 02/11/2021 at 03:40 point

I have a pair of USB type C headphones that I connected to my RasPi Zero through a few adapters and a hub and they instantly showed up as an audio output. I think if you wire the D+/D- from the pi to the USB port on your LiPo charger board you could have wired audio without adding a separate DAC. 

  Are you sure? yes | no

Guy Dupont wrote 02/12/2021 at 13:56 point

Great idea, but not really what I'm going for with this design. I care more about getting the headphone jack functional than I actually do about wired audio.

  Are you sure? yes | no

Allen Kreager wrote 02/12/2021 at 20:07 point

Are you planning on wiring the audio from the Pi directly to the headphone jack or are you planning on reverse engineering the 12 pin fpc connector on the board?

  Are you sure? yes | no

jamietchisholm wrote 02/09/2021 at 06:50 point

I love this project! I want to get started on this soon. Would very much look forward to a detailed walk-through. If anyone already has a walk-through of Guy Dupont’s method please share! Looking to build two of these and want to drill every step in my head.

  Are you sure? yes | no

Guy Dupont wrote 02/06/2021 at 21:11 point

For folks having issues getting up an running:

1. I apologize, I never anticipated so many people actually trying to run this!! I don't have a ton of bandwidth for support at the moment.
2. Please post issues/questions on the github repo rather than here. There are other lovely devs on there helping people out.
3. The Spotipy library is tricky to get up and running, and I am by no means an expert. I recommend following their docs to get a "Hello, World" app up and running, and then just copying the auth file that gets generated into my repo : )
4. I will upload something resembling a schematic ASAP.
5. I do very much want to create a more detailed walk-through of how to build, but that's gonna take a ton of time. I also want to refine some things, design-wise, first.

Thank you all!!

  Are you sure? yes | no

Sai Khurana wrote 02/08/2021 at 21:43 point

Hey man, 

This project has really inspired me even tho i had a similar idea. I am a CS major myself and an avid electronics enthusiast. So please should you need anything from a unknown guy, I'd be mire than happy to help. BTW i found a way to retain the original 30 pin dock so we can start there if you'd like. 

  Are you sure? yes | no

Matt wrote 02/09/2021 at 01:08 point

Could you elaborate on the 30 pin solution??

  Are you sure? yes | no

grr5510 wrote 02/06/2021 at 00:26 point

Cool project, I'm trying to get your spotifypod code to run to check out the UI but I'm getting some kind of connection error : Error 10061 connecting to localhost:6379. No connection could be made because the target machine actively refused it. (I was able to authenticate my spotify account)

Do I need any external server software running just to view the UI? I'm a total noob at this kind of thing.

  Are you sure? yes | no

Guy Dupont wrote 02/06/2021 at 21:05 point

Sorry about that - for the spotipy stuff, I'm recommending that people follow their official docs to get a separate "Hello world" app running, and then just copy the ".cache" auth file that gets generated into the spotipy project.

Feel free to drop an issue on the github repo, I think other folks are already discussing things like this. I'm not going to be checking here very often for comments.

  Are you sure? yes | no

Scott Bierly wrote 02/06/2021 at 00:03 point

Hey, found a guy on Ebay who sells salvage parts, sharing in case this (and other things) comes in handy: https://www.ebay.com/itm/iPod-Classic-Photo-4th-Gen-Clickwheel-Buttons-A1059-A1099-Click-Wheel-632-0258-A/361332793431?hash=item54211ce057:g:XJkAAOSwQJhUdScM

  Are you sure? yes | no

Scott Bierly wrote 02/05/2021 at 23:46 point

Oh...forgot to add that the 5th gen has a 2.5" screen, rather than 2.0". Might need a different display for that option.

  Are you sure? yes | no

Peter Burkimsher wrote 02/06/2021 at 01:17 point

There's been some reverse-engineering on the iPod Video LCD itself. I'd find it really cool to be able to use it as an iPod, then switch to RPi. For my PiPod, I use remote desktop from a phone, but it's not half as convenient as a built-in touchscreen. 

http://www.electricstuff.co.uk/ipodlcd.html

  Are you sure? yes | no

Scott Bierly wrote 02/05/2021 at 23:44 point

Super awesome project, I'm wanting to build this too when spare time permits. I was just checking on the Ipod details, can you confirm that you pretty much need to have a 4th Gen, or A1059? From what I see, the 5th gen gets thinner (but has the click wheel) and while the 3rd gen is thicker it has the touch wheel, not the click wheel. So I suppose with a PCB revision the 5th could be supported as well for more dead Ipod options :) Oh...another idea (perhaps for the future PCB edition), wondering if we can fit a wireless charging coil in there. Hmmm, measuring the one on my bench from a Galaxy S6 phone, it's only 0.31mm thick...

  Are you sure? yes | no

Ken Walker wrote 02/05/2021 at 23:24 point

Does this work with the free Spotify account or do you need a paid account?

  Are you sure? yes | no

Guy Dupont wrote 02/06/2021 at 21:06 point

You need premium, unfortunately.

  Are you sure? yes | no

Ken Walker wrote 02/06/2021 at 22:01 point

Thanks for getting back to me.

I thought so.  Upgraded my account.  Still no joy.

  Are you sure? yes | no

Ken Walker wrote 02/05/2021 at 21:35 point

This is a great project!  I have been trying to get the interface running on my Mac, but no Joy.  If you get some time and are so inclined a walkthrough of that process would be great.  Thanks for this.

  Are you sure? yes | no

Jason wrote 02/05/2021 at 18:34 point

This is such a cool project! I really want to make it but I have no idea how to get the code and all that on the pie. Are you going to make some sort of explanation on how to do that? 

  Are you sure? yes | no

Does this project spark your interest?

Become a member to follow this project and never miss any updates