Music Player
A device that plays, stops and skips music.
Author: Dragan Delia-Alexa
GitHub Project Link: https://github.com/UPB-PMRust-Students/project-ddeliaffelia
Description
Simple, compact music player built using a Raspberry Pi Pico W, programmed in Rust. It will allow users to play, pause, and skip songs stored on an SD card through a speaker, whose volume can be controlled using a potentiometer. The playing song's title will be shown on an LCD.
Motivation
I tried to find a project idea that fits my interests and that I could enjoy working on. I have been passionate about music since I was little, and I can still recall the day my parents bought me a music player just like my brother's. Besides, I find it quite fun to work on a hardware project like this one.
Architecture
Raspberry Pi Pico 2W:
- the centre of the project, controls all the other components
- connections: SPI - SD card module, ADC - potentiometer, PWM - buttons, amplifier, I2C - LCD
LCD:
- displays the name of the song
- connections: I2C - microcontroller
Amplifier:
- increases the quality and strength of the sound
- connections: through wires - speaker, DAC
Speaker:
- emmits the music
- connections: through wires - amplifier
Potentiometer:
- increases or decreases the volume
- connections: ADC - microcontroller
SD card module:
- supplements storage space for the songs that will be played
- connections: SPI - microcontroller
DAC:
- transforms digital signal into analog signal
- connections: SPI - microcontroller, through wires - amplifier, power supply
Power supply:
- powers the DAC with 5V
- connections: DC cable - battery, through wires - DAC
Battery:
- powers the power supply
- connections: DC cable - power supply
Log
Week 28 April - 4 May
Purchased components, started my research for the software part, worked on a KiCAD scheme, uploaded the basics on my website
Week 5 - 11 May
Set up my components, focusing on the 2 Picos (connected and tested the target and debug microcontrollers). Started testing code for my components

Week 12 - 18 May
Purchased more components after finding out about some possible errors (a 9V battery, DC cable, DAC) and set them up (except for the DAC that will arrive on the 19th). Focused on the software after assembling my components

Week 19 - 25 May
Hardware
In this project, the core piece is a Raspberry Pi Pico 2W that gets its digital audio play-back from an SD card inserted in a module, interfaced via SPI connection, and outputs it through a speaker, powered by a PAM8403D amplifier. The amplifier functions with analog signal, which is why a MCP4821-E/P DAC (Digital-Analog converter) is used, that gets its power from a 5V power supply with a 9V alkaline battery. A 1602 LCD displays via I2C protocol the currently playing song's title. The emitted sound's volume is controlled by a manually adjustable variable resistor (potentiometer). There are also three buttons connected to the microcontroller's GPIO pins meant to play, pause and navigate through the songs.
Schematics
Bill of Materials
| Device | Usage | Price |
|---|---|---|
| Raspberry Pi Pico W | The microcontroller | 35 RON |
| Breadboard kit | Breadboard, resistors, cables, buttons, power supply | 71 RON |
| LCD Display | Displays song | 16 RON |
| Amplifier | Boosts audio | 4 RON |
| Speaker | Plays audio | 4 RON |
| Potentiometer | Changes the volume | 2 RON |
| SD Card Module | Reads SD card with songs | 6 RON |
| DAC | Converts digital signal into analog signal | 16 RON |
| Battery-DC cable | Connects 9V battery to the power supply | 1.5 RON |
| Battery | Powers power supply | 9 RON |
Software
| Library | Description | Usage |
|---|---|---|
| embassy-rp | Embassy HAL for Raspberry Pi RP2040 | Used for running Rust on Raspberry Pi |
| embassy-executor | async/await executor | Used for asynchronous programming |
| defmt | Highly efficient logging framework | Used for debugging |
| cortex-m | Low-level access to Cortex-M processors | Used for accesing Cortex-M processor |
| lcd-lcm1602-i2c | Driver for LCD1602 | Used to control the display |