Skip to main content
Version: ACS CC

MP3 Player

Mini music player based on Raspberry Pi Pico 2.

info

Author: Liță Gabriel-Laurențiu
GitHub Project Link: https://github.com/UPB-PMRust-Students/proiect-gabruellita


Description

The project consists of a mini music player built around a Raspberry Pi Pico 2, capable of:

  • Playing music from a microSD card.
  • Displaying song information on a small LCD screen.
  • Supporting play, pause, next, and previous controls through physical buttons.
  • Using Rust with Embassy for efficient multitasking.

At first, the device will play audio through a small speaker connected via a PAM8403 mini amplifier.
Optionally, if the basic setup is successful, the player may be expanded with headphone jack output and/or Bluetooth audio support.


Motivation

I wanted a simple external device that can play and control music independently without being tied to a laptop.
Rust and Embassy provide the necessary performance and multitasking tools to manage this efficiently on the Raspberry Pi Pico.


Architecture

The Raspberry Pi Pico 2W acts as the brain of the system, managing all peripherals:

  • microSD card: Stores the audio files.
  • DFPlayer Mini: Handles audio file playback directly from the SD card.
  • Speaker (through PAM8403 amplifier): Outputs the audio.
  • LCD 1602 + I2C interface: Displays the current track information and playback status.
  • Buttons: Allow control of music playback.

Data flow:

  • Pico sends commands to the DFPlayer Mini via UART.
  • DFPlayer plays the file and outputs audio to the amplifier and then the speaker.
  • Pico updates the LCD and handles button presses asynchronously.

Diagrama Block

System Diagram


Components

ComponentPurposeDetails
Raspberry Pi Pico 2WMain controllerRuns firmware and manages all components
microSD card + adapterStorageHolds audio files
DFPlayer MiniMP3 player moduleReads and plays audio from SD
PAM8403 Mini AmplifierAudio amplificationBoosts the signal for speaker output
SpeakerAudio outputBasic sound output
LCD 1602 with I2C InterfaceDisplayShows track info and playback status
Push ButtonsUser controlPlay, Pause, Next, Previous actions

Hardware Overview

  • The Pico controls the music player by sending commands over UART to the DFPlayer Mini.
  • DFPlayer Mini reads the audio files from the microSD card.
  • The audio output is amplified by the PAM8403 amplifier and played through a small speaker.
  • The LCD 1602 displays song and status info via the I2C interface.
  • Buttons provide direct user interaction for playback controls.

Optional Features (Future Extensions)

If the basic functionality is successfully implemented, the project could be extended with:

  • Headphone Jack Output:
    Using a 3.5mm Audio Jack Module, allowing headphone connections.

  • Bluetooth Audio Output:
    Integrating a Bluetooth Audio Receiver Module to allow wireless music playback.

  • High-Power Amplifier Upgrade:
    Switching from the PAM8403 to a more powerful TPA3118 amplifier for better speaker output.

Note: These features are optional and depend on the success of the core implementation.


Bill of Materials (Hardware)

Product CodeDeviceUsagePrice
0104110000013743DFPlayer Mini MP3 ModuleAudio playback from microSD13,99 lei
0104110000003584LCD 1602 + I2C InterfaceDisplay song info16,34 lei
0104110000035356TPA3118 Mono Audio Amplifier (60W)High power audio (optional)19,99 lei
0104110000003737PAM8403 Mini Stereo Amplifier (3W)Basic speaker amplification2,99 lei
01041100000065473.5mm Audio Jack ModuleHeadphone output (optional)4,99 lei
0104110000019561Bluetooth Audio Receiver ModuleWireless playback (optional)23,99 lei
5056561803975Raspberry Pi Pico 2WMain controller~39,66 lei

Setup TypeComponents
Core SetupPico 2W, DFPlayer Mini, microSD, LCD 1602 I2C, Buttons, PAM8403, Speaker
Optional Setup+ 3.5mm Audio Jack, + Bluetooth Receiver, + TPA3118 Amplifier

Software Design

Rust will be used for firmware development, utilizing asynchronous programming with Embassy.

LibraryPurposeDescription
embassy-rpRaspberry Pi Pico-specific driversAccesses and controls RP2040 peripherals (UART, GPIO, I2C, etc.)
embassyAsync executorManages efficient multitasking
embedded-halHardware abstraction layerUnified API for embedded peripherals
ssd1306Display driverControls the LCD screen through I2C
heaplessStatic data structuresProvides memory-safe buffers without dynamic allocation
embedded-sdmmcSD card filesystemHandles file reading from microSD
DFPlayer Mini UART driver (to be implemented)Serial commandsSends control commands to DFPlayer Mini module

Functional Diagram

FunctionalDiagram


Log

(To be completed as the project progresses)


Photos

(To be added after prototype assembly)


(To be added once resources and documentation are finalized)