RustPlayer
This project rekindles the nostalgic charm of physically selecting music with buttons, delivering a classic audio experience through an intuitive MP3 player.
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.
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.
In the second picture I have used net labels to represent connections, for a cleaner and more organized layout.
Bill of Materials
Device | Usage | Price |
---|---|---|
Raspberry Pi Pico W | The microcontroller | 35 RON |
MicroSD Card Module | Storage for MP3 files | 66 RON |
Amplificator 3W I2S - MAX98357A | Audio output | 53 RON |
0.96'' I2C IIC OLED Display | User interface display | 20 RON |
VISATON 2916 | Audio output device | 50 RON |
Card MicroSD | Memory Card MicroSD | 30-40 RON |
Electronic components: LEDs, buttons, wires resistors and Breadboard | Electronic Components | 15-20 RON |
Software
Library | Description | Usage |
---|---|---|
embedded-hal | Hardware Abstraction Layer for embedded systems | Used for SPI and GPIO control |
rppal | Raspberry Pi Peripheral Access Library | Used for GPIO and SPI communication on the Raspberry Pi |
embassy | Modern, lightweight, and safe async framework for embedded systems | Used for async task handling and peripheral management |
ssd1306 | Driver for SSD1306 OLED displays | Used to control the OLED display |
embedded-graphics | 2D graphics library for embedded systems | Used for rendering graphics and text on the display |
log | Logging facade for Rust | Used for logging debug and informational messages |
panic-probe | A panic handler for embedded systems | Used for handling panics and debugging |
static-cell | Provides safe, static storage for data that outlives the main function | Used for managing static data |
fixed | Fixed-point arithmetic library | Used for precise timing calculations |