กลับไปหน้ารวมไฟล์
build-your-own-retro-style-mp3-player-0763aa-en.md

🎧 This compact device features five buttons: play/pause, next, previous, volume up, and volume down, plus an OLED screen that brings your music to life. The display shows a playback icon and a retro cassette animation that responds to play/pause actions, along with detailed 🎶 track info: number, title, elapsed time, and volume level.

🛠️ Setup Instructions

  1. Download the vs1053_avr_renesas_uno library and add it to your Arduino IDE.
  2. Open the Examples section and select portable_mp3_player_UNO_R4.ino
  3. Upload the sketch to your Arduino UNO R4 WiFi or Minima board.
  4. Connect the SparkFun MP3 shield , OLED display, and buttons as shown in the diagram below.

⚠️ Preparing Your SD Card

The SdFat library uses the classic 8.3 filename format: up to 8 characters, a dot, and a 3-character extension (e.g., track001.mp3 ). Avoid long names like MyMusicPlaylist.mp3 — they won’t work.

  1. Place your MP3 files directly in the root of the SD card (no folders).
  2. Format the card as FAT16 or FAT32 to ensure compatibility with the library and hardware.

⚠️ Compatibility Notes

This project is exclusive to the Arduino UNO R4, which features a powerful ARM architecture. It easily handles:

  1. Audio decoding and playback using the VS1053 chip, controlled via SPI
  2. SD card access through high-speed SPI communication
  3. OLED display control via the I2C interface

This enables smooth UI animations and responsive playback.

Other examples in the library support both the UNO R4 and classic AVR boards (UNO R3, MEGA R3, Leonardo). For instance, the portable_mp3_player.ino sketch uses the same wiring but features a simplified UI without animation — ideal for resource-constrained boards.

🛠️ Deep Dive / Technical Analysis

The core of this project is the VS1053 MP3 decoder chip on the SparkFun shield. This dedicated audio processor handles the complex task of decoding MP3 files, freeing the Arduino's main CPU to manage the user interface, file system, and animations. The Arduino communicates with the VS1053 via SPI (Serial Peripheral Interface), sending commands and the raw MP3 data stream. Simultaneously, the Arduino uses another SPI channel to read MP3 files from the SD card at high speed. The I2C (Inter-Integrated Circuit) protocol is used to drive the OLED display, sending graphics data for the retro cassette animation and track information. This multi-protocol operation is efficiently managed by the UNO R4's powerful 32-bit ARM Cortex-M4 processor, which is essential for maintaining smooth animations alongside uninterrupted audio playback.

📺 Watch on YouTube

Leave a comment, subscribe, and share it with fellow makers! And if you'd like to support future builds, consider buying me a Ko-fi ☕ — it helps me keep creating.

### https://ko-fi.com/kaledsouky

ข้อมูล Frontmatter ดั้งเดิม

apps:
  - "1x Arduino IDE 2.3.6"
author: "kaled4809"
category: "Audio & Sound"
components:
  - "1x Arduino® UNO R4 Minima"
  - "1x Arduino USB Type-C® Cable 2-in1"
  - "1x Grove - OLED Display 0.96"
  - "1x SparkFun MP3 Player Shield."
  - "1x Box 180 mixed buttons"
  - "1x Arduino® UNO R4 WiFi"
description: "Create a portable MP3 player with a UI that evokes retro nostalgia and excellent audio quality, perfect for music lovers and makers."
difficulty: "Easy"
documentationLinks: []
downloadableFiles:
  - "https://github.com/KaledSouky/VS1053_for_Arduino_AVR_and_UNO_R4"
encryptedPayload: "U2FsdGVkX1+W8Qh/e5HY3R2vOYBAUMUQJODSnIm6RK/7AIqiWw9vFpEE3/lItfFRHZraUon21u3CXT9Vv0GvxDUE8VkAsdcaanGbvLGAg7Y08W1MgZVaXtkNsrA8oZMhrQJIZT6cthI0ChYbWLt6x3HKU+u4F5HxPMEzDCPo5jY="
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/build-your-own-retro-style-mp3-player-0763aa_cover.jpg"
lang: "en"
likes: 11
passwordHash: "80493c616ef81f9870cc6c51ce2b890363dffd26194c05813893cde11b2c2b73"
price: 2450
seoDescription: "DIY portable MP3 Player with retro UI and high-quality audio. Perfect Arduino project for makers and music lovers."
tags:
  - "Arduino User Group"
  - "Audio"
  - "Music"
  - "Entertainment System"
title: "Build Your Own Retro-Style MP3 Player"
tools: []
videoLinks:
  - "https://youtu.be/5qlL_dXkuaY"
views: 23801