Skip to main content
Version: ACS CC

MP3 Player

An MP3 player with button controls and a display that shows the current track, play/pause status, and volume.

info

Author: Nistor Ioan-Mario
GitHub Project Link: https://github.com/UPB-PMRust-Students/proiect-marionistor

Description

This MP3 player, built around the Raspberry Pi Pico 2 microcontroller, enables playback of MP3 files stored on a microSD card. It features five tactile buttons for intuitive control, supporting play, pause, song navigation (next/previous), and volume adjustment. A 1.3" I2C OLED display delivers real-time updates, showing the current track title and playback status. The system employs a DFPlayer Mini module for MP3 playback, interfaced with the Pico via UART, complemented by a PAM8403 amplifier for improved audio output. Power is supplied by a 5V power bank, ensuring dependable and portable performance.

Motivation

This project draws inspiration from the nostalgia of early portable MP3 players, known for their compact screens and tactile buttons, aiming to revive their charm with modern technology. Using the Raspberry Pi Pico 2, DFPlayer Mini, and OLED display, the goal is to create a functional player that captures the simplicity and joy of those classic devices.

Architecture

Diagram

Connections

  • Microcontroller ↔ DFPlayer Mini: UART (GPIO0 TX → DFPlayer RX, GPIO1 RX → DFPlayer TX) for playback commands.
  • Microcontroller ↔ Display: I2C (GPIO4 SDA, GPIO5 SCL) for displaying track info, with OLED VCC connected to 5V and GND to ground.
  • Microcontroller ↔ Buttons: GPIO6–10 as inputs for the buttons.
  • DFPlayer Mini ↔ PAM8403: DFPlayer audio output (L/R) to PAM8403D input for amplification.
  • PAM8403 ↔ Speaker: PAM8403D output connected to the 4Ω/3W speaker.
  • Power: 5V power bank connected to VBUS (Pin 40) of the Raspberry Pi Pico 2, supplying 5V directly to the OLED VCC, DFPlayer Mini VCC, and PAM8403D VDD.

Log

Week 5 - 11 May

Week 12 - 18 May

Week 19 - 25 May

Hardware

  • Microcontroller: Raspberry Pi Pico 2 manages logic, UART communication with DFPlayer, and I2C with OLED.
  • Audio Module: DFPlayer Mini plays MP3s from a microSD card.
  • Display: 1.3" I2C OLED (SSD1306) shows track info and playback status, powered at 5V as per specifications (3.3V-5V range).
  • Input: Five tactile buttons (SW1–SW5) for play/pause, next, previous, and volume control.
  • Audio Amplifier: PAM8403D boosts the sound output to drive the speaker.
  • Speaker: 4Ω/3W speaker connected to the PAM8403D for audio playback.

Schematics

Schematic

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2Main microcontroller running the firmware28 RON
Raspberry Pi Pico 2WDebugging40 RON
DFPlayer MiniMP3 decoder and audio playback module14 RON
SanDisk 32GB MicroSD CardStores the MP3 files for playbackAlready owned
PAM8403Amplifies audio signal for the speaker3 RON
4Ω/3W SpeakerOutputs the audio playback11 RON
OLED 1.3" DisplayDisplays song info and player status30 RON
HAMA PD10 201719Provides power to the breadboard setupAlready owned
ButtonsUser input for controlling playback and volume5 x 0.36 RON
ResistorsResistors used for buttons10 x 0.10 RON
BreadboardFor prototyping the entire circuit2 x 10 RON
WiresConnect all components on breadboard19 RON
Total-168 RON

Software

LibraryDescriptionUsage
embassy-rpEmbassy framework for RP2350Used to control peripherals like UART, I2C, GPIO, and timers on the Pico 2
ssd1306Driver for SSD1306 OLED displays via I2CUsed to control the 1.3" I2C OLED display
embassy-timeAsync timers and delaysUsed for implementing delays and scheduling tasks
dfplayer-asyncAsync Rust driver for DFPlayer Mini MP3 moduleProvides MP3 playback control over UART using async calls
embassy-executorAsync task executor for embedded systemsManages and schedules async tasks on the microcontroller
embedded-graphics2D graphics library for embedded systemsUsed to draw text, icons, and other UI elements on the OLED display
embedded-halHardware Abstraction Layer for embedded devicesInterface layer used by all driver crates for GPIO, I2C, UART, etc.
defmtLightweight logging framework for embedded RustUsed for debug logging during development
panic-probeMinimal panic handler for embedded RustProvides panic messages via logging for embedded debug purposes
  1. MP3 Player made using Arduino
  2. Connecting Audio Amplifier to DF Player Mini
  3. Ways to power the breadboard