Skip to main content

RustPlayer

This project rekindles the nostalgic charm of physically selecting music with buttons, delivering a classic audio experience through an intuitive MP3 player.

info

Author: Popa Ruxandra-Georgiana
GitHub Project Link: (https://github.com/ruxi22/RustPlayer)

Description

RustPlayer is a custom-built MP3 player utilizing a Raspberry Pi Pico W to allow users to play music directly from a microSD card, controlled through a simple interface of buttons and an OLED display. Some laboratories I found relevent for the project I am implementing, are:

  • Lab 3: Interfacing SPI devices
  • Lab 5: I2S Audio
  • Lab 7: Advanced I/O Interfaces

Motivation

My passion for music and technology inspired me to want to create the RustPlayer. This project is a perfect opportunity to apply my technical skills in a meaningful way, combining my love for tunes with the challenge of programming and hardware design. I'm excited to develop a device that not only plays music but also reconnects people with the tactile joy of manually choosing songs—something that's lost in today’s streaming era. Building the RustPlayer is also an excellent opportunity to deepen my understanding of embedded systems and user interface design, which are crucial in my studies and future career in technology.

Architecture

Schematic Diagram

A schematic diagram is provided to illustrate the connections and layout of the components.

Schematic diagram

Raspberry Pi Pico W

  • Role: Acts as the central controller for all functions.
  • Connections:
    • Interfaces with the OLED Display, MicroSD Card Module, Audio Amplifier, LEDs and Buttons.

OLED Display

  • Interface: I2C
  • Connections:
    • SDA (Serial Data Line) to GPIO4 of Raspberry Pi Pico W
    • SCL (Serial Clock Line) to GPIO5 of Raspberry Pi Pico W
  • Role: Displays user interface, track information, and playback status.

Buttons

  • Interface: GPIO (with interrupts)
  • Connections:
    • Connected to various GPIO pins for different controls (e.g., play/pause, next, previous).
  • Role: Allow user input for controlling playback and settings.

LEDs

  • Interface: PWM capable for brightness control
  • Role: Provide visual feedback during operation.

Audio Amplifier

  • Interface: I2S
  • Role: Amplifies the audio signal for output to the speaker.

Speaker

  • Role: Outputs audio signal received from the Audio Amplifier.

MicroSD Card Module

  • Interface: SPI
  • Connections:
    • SCK (Serial Clock) to GPIO24 of Raspberry Pi Pico W
    • MOSI (Master Out Slave In) to GPIO25 of Raspberry Pi Pico W
    • MISO (Master In Slave Out) to GPIO21 of Raspberry Pi Pico W
    • CS (Chip Select) to GPIO22 of Raspberry Pi Pico W

Log

Week 6 - 12 May

The schematic for the project has been successfully created using KiCad. This schematic includes all necessary components and connections for the electronic circuit. Detailed component selection was finalized, and precise connections were established to ensure optimal functionality.

Week 7 - 19 May

A 3D model of the project enclosure has been designed using Tinkercad. The box is tailored to fit all components securely and includes cutouts for the buttons, display, RGB LED, and speaker. Special attention was given to the layout to ensure ease of assembly and accessibility for future maintenance.

Week 20 - 26 May

The software development phase began. The microcontroller was programmed to interface with and control the various components of the project. Initial tests were conducted to ensure basic functionality.

User interface enhancements were implemented. Additional testing and debugging were carried out to ensure seamless interaction between all components.

Comprehensive documentation was created, covering the design, assembly, and software integration processes. The project was prepared for the final review and deployment.

Hardware

The Raspberry Pi Pico W serves as the central microcontroller for the RustPlayer project. It provides the processing power and interfaces necessary to control various components of the music player. With its dual-core ARM Cortex-M0+ processor and ample GPIO pins, the Pico W can handle tasks such as reading input from buttons, interfacing with the MicroSD card module for storing and accessing MP3 files, driving the OLED display for the user interface, and controlling the audio output via the MAX98357A amplifier.

This is the current progress of the RustPlayer project. So far, the essential components have been assembled. The next step involves making the music player more compact by integrating all components into a custom-designed box with a lid. This enclosure will be created using Tinkercad to ensure a perfect fit.

Schematics

This schematic, created with KiCad, illustrates the electronic design of the RustPlayer project. It provides a detailed layout of the connections and components, ensuring accurate assembly and functionality.

The kicad schematic

In the second picture I have used net labels to represent connections, for a cleaner and more organized layout.

The kicad schematic

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico WThe microcontroller35 RON
MicroSD Card ModuleStorage for MP3 files66 RON
Amplificator 3W I2S - MAX98357AAudio output53 RON
0.96'' I2C IIC OLED DisplayUser interface display20 RON
VISATON 2916Audio output device50 RON
Card MicroSDMemory Card MicroSD30-40 RON
Electronic components: LEDs, buttons, wires resistors and BreadboardElectronic Components15-20 RON

Software

LibraryDescriptionUsage
embedded-halHardware Abstraction Layer for embedded systemsUsed for SPI and GPIO control
rppalRaspberry Pi Peripheral Access LibraryUsed for GPIO and SPI communication on the Raspberry Pi
embassyModern, lightweight, and safe async framework for embedded systemsUsed for async task handling and peripheral management
ssd1306Driver for SSD1306 OLED displaysUsed to control the OLED display
embedded-graphics2D graphics library for embedded systemsUsed for rendering graphics and text on the display
logLogging facade for RustUsed for logging debug and informational messages
panic-probeA panic handler for embedded systemsUsed for handling panics and debugging
static-cellProvides safe, static storage for data that outlives the main functionUsed for managing static data
fixedFixed-point arithmetic libraryUsed for precise timing calculations
  1. Music Player using Raspberry Pi Pico and DFPlayer
  2. World's Cheapest Internet Radio Player! - Powered by Raspberry Pi
  3. Revolutionize Your Spotify Experience for less than $15