DIY PhonieBox - an NFC Driven Music Box Using Raspberry Pi
by christophermurphy in Circuits > Raspberry Pi
74 Views, 0 Favorites, 0 Comments
DIY PhonieBox - an NFC Driven Music Box Using Raspberry Pi
My children LOVE classic musicals and movie soundtracks. They like to listen to them in the car and the house, but I wanted them to feel more independent and able to put the music they wanted on at any time, without a screen or voice controls connected to Alexa or Google. I had researched Toniebox but felt that the system was too locked down and didn't have the media my kids wanted to hear. So I did MORE research and found a DIY, open source system using Raspberry Pi called Phoniebox. It was exactly what I was looking for and more - besides streaming Spotify, I can also play local audio files, allowing me and my family to record ourselves reading books and having them played back on the music box using NFC tags as triggers.
While the instructions on the Phoniebox github was helpful and got me on the right path, but with new updates to Spotify's API and differing hardware causing problems and bugs, I decided to write my own Instructable to help others make their own!
Supplies
Raspberry Pi 4 B + Power cable + microSD card
Spotify Premium Account (if you want to use it to stream music)
Whatever materials you want to build your enclosure out of! I used scrap hardwood I had lying around, but you can 3D print one, use an old lunchbox, whatever you like.
Programming Your Phoniebox
Using the pre-made one line install script is the easiest and fastest way to get started with your PhonieBox. But there are some tips and tricks and additional lines of code that I found helped the process along much faster and streamlined.
1 - Plug in all of your USB accessories BEFORE doing the install script. This makes it much easier than adding the USB stuff after the fact. So wait until you have all your supplies before starting.
2 - Use PhonieBox version 2 if you want to stream from Spotify.
Now let's get started!
Install the latest LEGACY raspberry pi OS to your SD card and use the lite (no GUI) version. Connect your RPi to a monitor and a keyboard. I won't go into depth on that as there are millions of RaspPi getting started guides, if you need help setting up your Pi and accessing the command line look HERE.
Follow the step by step instructions here: https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/INSTALL
It will ask you to configure your WiFi - input your home wifi information (SSID and password) and to make a static IP address. I recommend you make a static IP just to keep things simple.
It will also ask you to make a local WAN for when the RaspPi does not have access to the internet. This is really useful for bringing the music box on trips, or to Grandmas house or wherever you may not have wifi access. This will allow you to update wifi settings on the go. Insert a WAN name and password (or use the defaults) and make sure to write it down because you won't be able to find this again easily!
If it asks to install Mopidy, say Yes if you want to use Spotify (also just do it, because it is easier to do now than install it later if you change your mind). It will ask you to go to a website and input your spotify account information. Do that and follow the instructions on how to add your User Key to the Raspberry Pi.
Use the default location for music files. Again, this just keeps everything easy if you are not a RaspPi Pro.
Then the installation will start. It should just take a few minutes. After Installation, it will ask you a few more questions about your USB accessories. This is why it was important to have them plugged in before hand!
say "yes" to "have you connected your USB NFC reader?" Insert the number associated with the USB Reader.
The PhonyBox will reboot and you are ready to start playing some music!
After the Pi reboots, you will want to go to the raspi-config. type sudo raspi-config into your cmd prompt. Navigate to "Boot Options" to select "Wait for network at boot". This will make sure your Pi has wifi access before boot. This helps prevent some spotify errors.
Additionally - Many Spotify changes have been breaking the PhonieBox's sync with their servers: Here is a fix that works as of 11/9/2025
https://github.com/MiczFlor/RPi-Jukebox-RFID/issues/2533#issuecomment-3507310148
Configuring the PhonieBox
Navigate to your phoniebox's static IP address in your browser (phone or computer) to bring up the Phoniebox.
First, hit the Three horizontal line menu button in the upper right, and go to spotify. This will open a new tab that looks similar, but is called Iris. Hit the menu button in the lower right and go to settings, this is where you can input your Spotify information and log in. Also change the language and country to yours. I am in the US and speak english, so I changed mine to en_US.
Now you can add Playlists to your NFC tags.
Add Playlists to NFC Tags
Now you're ready to add your Playlists to NFC tags. First, copy the URI on the spotify tab in the phoniebox webUI. Then navigate back to the Card ID tab. Scan a NFC tag, the number should appear in the Chip ID box. Paste the Stream URI into the StreamURL box and select Spotify. Create a name for the new folder in the "Link new folder" text box.
You can also do this for local files. I like to record books for my kids and then add the NFC tag to the back of the book so they can follow along while listening to me read. You can navigate to the files and folders tab and upload local files like voice memos there and assign them to a folder. Then program an NFC tag following the same instructions above to locate that folder.
Test and Build an Enclosure
Your Phoniebox is all set up now! I used wood to enclose my hardware, but you could use whatever you want. I'll walk you through my process though.
I started with a piece of hardwood about 6 inches wide. I made 45 deg. miters in the corners and made the sides 6" x 8" and 6" x 4". I cut a 1/4" groove in the front and back to secure the face and rear of the box.
I used TinkerCAD to create an SVG to be laser cut to leave slots for the speakers' sound to come out of. I used 1/4" birch plywood Once the front of the case was cut, I modeled and 3D printed spacers for the speakers, so that I could flush mount them. I created a small slot in the rear to allow access to the plugs, and then hot glued the NFC reader to the top of the box. With 1/2" thick wood, it can still read NFC cards through the wood.
Finally, I glued up the miters, and assembled all the speakers, Raspberry Pi and NFC reader in the box. It is a tight fit, but it all works perfectly in there!