This is an old revision of the document!


Portable MP3 Player

Introduction

The project consists of creating a portable MP3 Player capable of playing audio files from a microSD card and displaying current track information on an OLED screen. Music is listened to through headphones connected to the auxiliary output.

  • Goal: Creating a compact and autonomous device for audio playback with a simple button-based control interface.
  • Core Idea: Using a dedicated module (DFPlayer) for audio decoding, leaving the microcontroller the task of managing the user interface and control logic.
  • Utility: For me, it represents an opportunity to learn the integration of communication protocols (I2C, Serial) and power management (Li-Po battery). It is also a way to listen to music using a device I created myself. For others, maybe a cool toy :) that is an example of an embedded system balanced between dedicated hardware resources and software control.

General Description

The project integrates the following hardware modules:

  • Arduino Nano (ATmega328P): The “brain” of the system that processes button inputs and commands the peripherals.
  • DFPlayer Mini: The module responsible for reading files from the microSD card and playing the sound.
  • OLED Screen (I2C): Displays the player status and the menu.
  • Power System: 3.7V Li-Po battery with a TP4056 charging module and protection.

Block design:

Interaction: The user presses the buttons (Input), the Arduino processes the command (Software Logic), sends instructions via UART to the DFPlayer (Sound Output), and updates the screen via I2C (Visual Output).

Hardware Design

Hypothesis

“We believe that using a dedicated hardware decoding module (DFPlayer) will improve audio system performance because it offloads the ATmega328P microcontroller from the intensive task of processing the MP3 data stream, allowing for a smooth visual interface on the OLED screen.”

Components

  • 1x Arduino Nano (Atmega328P)
  • 1x DFPlayer Mini Module
  • 1x OLED Module (I2C)
  • 1x TP4056 Module (Li-Po Charger)
  • 1x 3.7V 1200mAh Li-Po Battery
  • 1x 3.5mm Audio Jack Module
  • 3x Push buttons (Next/Vol+, Play/Pause, Prev/Vol-)
  • 1x Toggle Switch (On/Off)
  • 1x 1kOhm Resistor (for UART RX line protection)
  • 1x Prototype PCB board & Jumping cables

Schematics

Software Design

Description of the application code (firmware):

  • Development Environment: AVR / VS Code with PlatformIO.
  • Libraries and 3rd-party sources:
    • Using the standard `avr/io.h` library for register access.
    • Custom implementation for I2C (OLED) and UART (DFPlayer) protocols.
    • `util/delay.h` for timing.
  • Algorithms and Structures:
    • State Machine: To manage player states (Play, Pause, Stop, Next).
    • UART Protocol: Implementation of `UART_init` and `UART_transmit` functions to control the DFPlayer.
    • I2C Protocol (TWI): Managing the OLED screen by manipulating the TWI (Two Wire Interface) registers of the ATmega328P.

I have included concepts from the following laboratories:

  • Laboratory 3 (Interrupts): Used for control buttons (External Interrupts) to ensure minimal response time.
  • Laboratory 6 (UART): Asynchronous communication with the audio module (9600 bps).
  • Laboratory 7 (I2C/TWI): Control of the OLED screen via the I2C protocol, using the hardware TWI module of the microcontroller.

Results

Conclusions

Download

Journal

  • *May 3:** Created the Wiki documentation page and the Block Diagram.

Bibliography/Resources

Export to PDF

pm/prj2026/theodor_ioan.buliga/adrian.vancea.1777838918.txt.gz · Last modified: 2026/05/03 23:08 by adrian.vancea
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0