Build one

Make your own Spotifactory.

You'll need off-the-shelf parts, a 3D printer, a soldering iron for two wires, and an afternoon.

Build it with an AI helper

An AI assistant such as Claude can be a patient build partner. It can read the instructions, work out what you still need to buy, walk you through each step, give you the exact commands, and help when something doesn't work. You still do the hands-on parts: printing, screwing it together, and signing in to Spotify.

Copy this into a new chat to start:

I want to build a Spotifactory: a Raspberry Pi music box that plays Spotify albums from NFC-tagged Instax photos. The instructions, code and case model are at https://github.com/peasus/spotifactory (start with README.md) and the build guide is at https://spotifactory.com/build.

Please be my build guide:
- Read those first. If you can't open links, tell me and I'll paste the README.
- Ask what I already have (parts, 3D printer, computer, Spotify Premium) and make me a shopping list for the rest.
- Then take me through it one step at a time: printing the parts, creating the Spotify developer app, setting up the Pi, assembly, and first start. Wait for me to say I'm done before moving on.
- For every command, tell me exactly what to type, where to type it (my computer or the Pi), and what I should see.
- If something goes wrong, ask me to paste the error or describe what I see, and help me fix it.
- Never ask for my Spotify password.

About me: I'm [new to this / comfortable with a terminal], and my computer runs [Mac / Windows / Linux].

1. Get the parts

  • Raspberry Pi Zero 2 WWith the 40-pin header fitted. Plus a microSD card.
    1
  • SeenGreat 1.3" OLED HATSH1106 screen, 5-way joystick and three buttons.
    1
  • PN532 NFC reader, USB-CThe CH340 serial version. Plus a right-angle USB-C to micro-USB cable.
    1
  • USB-C power socketAdafruit 5993, so any USB-C charger works. A spare micro-USB cable, cut down, makes the lead to the Pi.
    1
  • Instax Square Link printerPlus Instax Square film.
    1
  • NFC stickers, 25 mm squareOne for the back of each photo.
    a roll
  • Screws and fittingsM2.5×14 pan or button head (6), M2.5×8 (4), M3 flat-head about 6 mm (4), M3×4 mm brass heat-set inserts (4), rubber feet (4).
     
  • ToolsA soldering iron (for the power lead and the heat-set inserts) and a small screwdriver.
     
  • A speakerAny Spotify Connect speaker, or a Bluetooth speaker that the box plays to directly.
    1
  • Spotify PremiumNeeded to control playback. Why only Spotify?
     

The power socket, inserts and feet are in enclosure/bom_digikey.csv, which imports straight into a DigiKey cart.

2. Print the case

The case is a body, a faceplate, a base plate and a few small parts. Any PLA works, in whatever colour you like, and nothing needs supports. The body is 104 × 92 × 107 mm as it sits on the bed, so check your printer's build height.

Renders of the case from the front, from the back with the USB-C socket and vents, and cut away from the side
The assembled case: front, back, and a cut-away side view.

Download the STL files

Download all STLs (.zip)

Each file is already turned the way it should sit on the bed. They're rebuilt from the case model automatically whenever it changes.

What to print

FileWhat it isOn the bed
spotifactory_body.stlThe easel itself: photo panel, sloped screen face and wallsUpright, open bottom down
spotifactory_faceplate.stlHolds the screen, joystick and buttonsVisible face down
spotifactory_baseplate.stlBottom plate, with the power socket bracketFlat side down
spotifactory_spacers.stl4 tubes for between the Pi and the screen, plus 4 washers you only need with M2.5×16 screwsAs exported
spotifactory_keepers.stl2 blocks that hold the NFC reader in placeAs exported
spotifactory_buttoncaps.stl3 caps: volume up, volume down and menuStanding on their flanges
spotifactory_nub.stlThe joystick knobUpright
  • Nozzle: a standard 0.4 mm nozzle is fine. The walls are 2.4 mm, six lines at 0.4 mm (or four at 0.6 mm).
  • Second colour (optional): the icons on the caps and the joystick knob stand 0.48 mm proud, which is four layers at 0.12 mm. Add a filament change at that height to print them in an accent colour.
  • Extras: crate.py makes a crate for your photos and dispenser.py a holder for the roll of tag stickers.
The body upright, the faceplate face down and the base plate flat side down, each on a print bed
How the three big parts sit on the bed.

Or make them yourself

The case is a parametric build123d model in enclosure/, so you can change it and generate fresh files:

git clone https://github.com/peasus/spotifactory.git && cd spotifactory
python3 -m venv enclosure/.venv
enclosure/.venv/bin/pip install build123d trimesh matplotlib networkx
enclosure/.venv/bin/python enclosure/easel.py   # STLs into enclosure/out/print/
enclosure/.venv/bin/python enclosure/check.py   # fit and printability checks

3. Make a Spotify app

The box signs in to Spotify through a developer app. Spotify only lets five people use an app while it's in development mode, so make your own. It's free and takes a few minutes. You won't need a client secret.

  1. Go to the Spotify developer dashboard and log in with your Spotify account. Accept the developer terms if it asks.

  2. Choose Create app and fill in:

    • App name and description: anything, for example "My Spotifactory".
    • Redirect URI: https://auth.spotifactory.workers.dev/callback, then press Add. It has to match exactly.
    • Which API/SDKs: tick Web API.

    Agree to the terms and save.

  3. Open the app's Settings and copy the Client ID.

  4. Under User Management, add the name and email address of every Spotify account that will use the box, yours included, up to five.

  5. In the repo on your computer, copy deploy/provision.env.example to deploy/provision.env and paste in your ID:

    SPOTIPY_CLIENT_ID=your-client-id-here
    RELAY_URL=https://auth.spotifactory.workers.dev

The relay address is the Spotifactory login relay, which passes the sign-in from your phone to the box. It works with any Spotify app, so just use it as is. If you'd rather host your own, you can deploy deploy/relay/ to Cloudflare Workers.

4. Set up the Pi

  1. In Raspberry Pi Imager, flash Raspberry Pi OS Lite (64-bit). Set the hostname to spotifactory and the user to spotifactory, and turn on SSH and Wi-Fi.

  2. From your computer, copy your provision.env over to the Pi:

    scp deploy/provision.env spotifactory@spotifactory.local:~/spotifactory-provision.env
  3. On the Pi, run:

    sudo apt-get update && sudo apt-get install -y git
    git clone https://github.com/peasus/spotifactory.git ~/spotifactory
    cd ~/spotifactory && bash deploy/setup.sh

5. Put it together

First, press the four M3 heat-set inserts into the bosses in the body's bottom corners with a soldering iron. Set the screen HAT to I2C by turning both switches on its back (SW1 and SW2) to 0. Then, with the body upside down or on its back:

  1. Plug the right-angle cable into the reader. Bring the reader in from below with the antenna side facing the panel, and slide it about 4 mm up until its top corners sit in the caps.

  2. Put a keeper under each bottom corner of the reader and drive an M2.5×14 screw straight up through it into the post.

  3. Screw the Pi and HAT stack to the faceplate through the spacers, using four M2.5×14 screws. Plug in the cables, then fit it from below into the pocket under the screen window.

  4. Make the power lead: cut the spare micro-USB cable, keeping the micro-USB end long enough to reach the Pi. Strip the +5 V wire (usually red) and the ground wire (usually black), and solder them to the VBUS and GND pads on the USB-C socket board. Check with a multimeter before you plug it into the Pi.

  5. Screw the power socket to its bracket on the base plate with the four M2.5×8 screws. Fit the base plate and screw it into the corner inserts with the M3 flat-head screws, then stick on the feet.

Use pan or button head screws for the M2.5 ones, never countersunk. The README has the exact screw lengths and the cable sizes that fit.

6. First start

  1. Plug it in. With no Wi-Fi yet, the box makes its own network called Spotifactory. Join it from your phone and pick your Wi-Fi on the page that opens.

  2. Scan the QR code on the screen and log in to Spotify.

  3. In the Spotify app, pick the Spotifactory device once.

  4. From the menu, use Pair Device for your Bluetooth speaker and the Instax printer, or Choose Speaker for a Connect speaker.

  5. Play an album and choose Print Album. When the photo comes out, stick a tag on the back and stand it on the easel so the box can write it.

From then on the box updates itself each night from the stable branch, and rolls back on its own if an update doesn't start cleanly.

Sharing and selling

The code and the case are free for personal and other noncommercial use under the PolyForm Noncommercial License. Build one for yourself, or as a gift. To sell them, or use them commercially, ask first at hello@spotifactory.com.