Latinx Modern Vinyl Player

by alemanja in Circuits > Raspberry Pi

36 Views, 0 Favorites, 0 Comments

Latinx Modern Vinyl Player

IMG_8467.jpg

This project integrates Radio-Frequency Identification (RFID) technology with the Spotify API to emulate the experience of a traditional record player. By scanning RFID-tagged cards, each representing a specific album or track, the system plays the corresponding music through Spotify. Additionally, NeoPixel LEDs provide visual feedback by illuminating the player during playback.

Supplies

️ Supplies & Components

Electronics

  1. Raspberry Pi 4 (or similar)
  2. RFID RC522 Module
  3. RFID Stickers (13.56MHz)
  4. NeoPixel LED Strip (WS2812B)
  5. Speakers (Bluetooth or AUX-connected)
  6. Female-to-Female Dupont Jumper Wires
  7. Power Supply (5V 3A for Raspberry Pi)

Fabrication (Optional, for Custom Design)

  1. 3D Printer (to make mini vinyl records)
  2. Wood Laser Cutter (to create a box for the system and tiny vinyls)

Setting Up the Raspberry Pi

Install System Updates

bash
CopyEdit
sudo apt-get update
sudo apt-get upgrade

Enable SPI for RFID Scanner

bash
CopyEdit
sudo raspi-config
  1. Go to Interfacing Options > SPI > Enable it.
  2. Reboot the Raspberry Pi:
bash
CopyEdit
sudo reboot


Setting Up the RFID Scanner

Screenshot 2025-03-19 at 3.17.55 PM.png
GPIO-Pinout-Diagram-2 (1).png
IMG_8425.jpg
IMG_8426.jpg
IMG_8427.jpg

Wiring the RC522 RFID Module

RFID PinRaspberry Pi Pin

  1. Wire pins from GPIO pinouts from Raspberry Pi to RFID.

*Use the GPIO pinout sheet to help you dictate where to put the pins. Also, use at my pictures to give you a reference point.


Install Required Libraries

bash
CopyEdit
sudo apt-get install python3-dev python3-pip
sudo pip3 install spidev mfrc522 spotipy rpi_ws281x


Testing the RFID Reader

Run the read.py script to scan RFID cards and retrieve their unique IDs:

python
CopyEdit
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522

reader = SimpleMFRC522()

try:
print("Waiting for RFID scan...")
id = reader.read()[0]
print("Card ID:", id)
finally:
GPIO.cleanup()

Write down each card's ID. You’ll need them for the next step!

Setting Up Spotify Integration

  1. Register a Spotify Developer Application:
  2. Go to the Spotify Developer Dashboard and create a new app.
  3. Note the Client ID and Client Secret.
  4. Add the following Redirect URI: http://localhost:8888/callback
  5. Obtain the Device ID (to send playback commands):
  6. Use the Spotify Web API Console to get the device ID.


Controlling Spotify Playback With RFID and LEDs

Create a script playerwithlights.py to link RFID scans to Spotify playback and control NeoPixel LEDs:

python
CopyEdit
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522
from time import sleep
import spotipy
from spotipy.oauth2 import SpotifyOAuth
from rpi_ws281x import PixelStrip, Color

# Spotify API Credentials
DEVICE_ID = "YOUR_DEVICE_ID"
CLIENT_ID = "YOUR_CLIENT_ID"
CLIENT_SECRET = "YOUR_CLIENT_SECRET"

# RFID reader setup
reader = SimpleMFRC522()

# Initialize Spotify API
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET,
redirect_uri="http://localhost:8888/callback",
scope="user-read-playback-state,user-modify-playback-state"))

# LED strip configuration
LED_COUNT = 30 # Number of LED pixels
LED_PIN = 18 # GPIO pin connected to the pixels
LED_FREQ_HZ = 800000 # LED signal frequency
LED_DMA = 10 # DMA channel
LED_BRIGHTNESS = 255 # Brightness of LEDs
LED_INVERT = False # Invert signal if needed
LED_CHANNEL = 0

# Initialize the LED strip
strip = PixelStrip(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL)
strip.begin()

# Function to turn off all LEDs
def turn_off_lights():
for i in range(strip.numPixels()):
strip.setPixelColor(i, Color(0, 0, 0))
strip.show()

# Function for the rainbow animation
def wheel(pos):
if pos < 85:
return Color(pos * 3, 255 - pos * 3, 0)
elif pos < 170:
pos -= 85
return Color(255 - pos * 3, 0, pos * 3)
else:
pos -= 170
return Color(0, pos * 3, 255 - pos * 3)

::contentReference[oaicite:54]{index=54}


Extra Customization

Things I added:

  1. Customize the wooden box design using a laser cutter.
  2. 3D print mini vinyl record tags for a more authentic feel.
  3. Expand with additional LED animations.
  4. I am using my personal IPAD, to NOT PLAY music, but only show my personal Spotify and show the changes in songs from the vinyl box that it is doing through the communication done though the API.
  5. Speakers for the music.

The sky is the limit with this project. You can 3D print a box, you can use a real vinyl player, perhaps add ADAFRUIT Matrix Panels to display the album covers, and more.


Pictures I Took During My Customization!

IMG_8437.jpg
IMG_8439.jpg
IMG_8440.jpg
IMG_8441.jpg
IMG_8448.jpg
IMG_8468.jpg

Demonstration

Latinx Modern Vinyl Player Demonstration

Enjoy :D

Challenges & Struggles:

One of the biggest challenges in this project was dealing with network connectivity while using the Spotify API. At Boston College, the available Wi-Fi networks (EDUROAM and BOSTONCOLLEGE WIFI) made it difficult to obtain a static IP address and maintain a stable connection across multiple devices—Raspberry Pi, SSH MacBook, phone, and Spotify API tokens.

To work around this issue, I resorted to using my personal hotspot. While this worked for my phone, it struggled to handle multiple devices simultaneously, especially for API calls requiring real-time responses from Spotify. As a result, my connection would often delay or drop, causing the software to crash when the API couldn't find an active network.

This remains an ongoing issue, and while the project is functional, improvements in network handling (such as using a dedicated router or a different network configuration) could enhance its reliability. If you're trying to replicate this project, keep in mind that network stability is critical for seamless music playback.