This is an old revision of the document!


MP3 Player

Introduction

My project represents an MP3 player with a display that shows the current song playing.

The project can read the MP3 files in the SD card, and can pause and play the same as the device 10 years ago. And also it has previous song and next song function.

My aim is to make something simple and efficient while also including and adapting it to current standards.

General Description

My project uses an Arduino Uno board as its base connected to an oled display showing the current song playing, 3 buttons to use for its functions, an internal speaker and an sd card reader for reading the .mp3 files off of it.

Hardware Design

List of Parts:

  • Arduino Uno

  • Mini MP3 player

  • Speaker

  • 1.3 inch oled display

  • 3 100Ω resistors
  • 3 Switch Buttons
  • Jumper wires
  • Breadboard
  • 1k Resistor

Software Design

This code is written for an Arduino board to control an MP3 module and display song information on an LCD screen. Here's a breakdown of the code:

  • Libraries:
    • LiquidCrystal.h: This library allows communication with LCD displays.
    • SoftwareSerial.h: This library enables serial communication with the MP3 module.
  • Constants:
    • Start_Byte, Version_Byte, Command_Length, End_Byte, and Acknowledge: These are predefined values used for communication with the MP3 module.
  • Variables:
    • buttonNext, buttonPause, buttonPrevious: These variables store the pin numbers for the buttons used to control the MP3 module.
    • isPlaying: This boolean variable keeps track of the current playback state.
    • rs, en, d4, d5, d6, d7: These variables store the pin numbers for the LCD display.
    • lcd: This object represents the LCD display.
    • mySerial: This object represents the SoftwareSerial communication with the MP3 module.
  • setup() function:
    • Initializes the LCD display with the specified dimensions.
    • Begins serial communication with the MP3 module.
    • Sets up the button pins as inputs with pull-up resistors.
    • Delays for 1 second to allow initialization.
    • Calls playFirst() to play the first track and sets isPlaying to true.
  • loop() function:
    • Checks the state of the buttons and performs corresponding actions:
      • If the pause button is pressed, it toggles the playback state between play and pause.
      • If the next button is pressed, it plays the next track.
      • If the previous button is pressed, it plays the previous track.
    • Calls getSongDuration() to retrieve and display song duration information.
  • Playback functions:
    • playFirst(): Sends commands to initialize the MP3 module and start playback of the first track.
    • pause(): Sends a pause command to the MP3 module.
    • play(): Sends a play command to the MP3 module.
    • playNext(): Sends a command to play the next track.
    • playPrevious(): Sends a command to play the previous track.
    • setVolume(): Sends a command to set the volume level.
  • execute_CMD() function:
    • Calculates the checksum and builds the command line to send to the MP3 module.
  • getSongDuration() function:
    • Sends a command to the MP3 module to retrieve the current track's duration.
    • Reads the response from the MP3 module and extracts the duration and remaining duration information.
    • Updates the LCD display with the song duration and remaining duration.

Results

Care au fost rezultatele obţinute în urma realizării proiectului vostru.

Conclusions

Download

O arhivă (sau mai multe dacă este cazul) cu fişierele obţinute în urma realizării proiectului: surse, scheme, etc. Un fişier README, un ChangeLog, un script de compilare şi copiere automată pe uC crează întotdeauna o impresie bună ;-).

Fişierele se încarcă pe wiki folosind facilitatea Add Images or other files. Namespace-ul în care se încarcă fişierele este de tipul :pm:prj20??:c? sau :pm:prj20??:c?:nume_student (dacă este cazul). Exemplu: Dumitru Alin, 331CC → :pm:prj2009:cc:dumitru_alin.

Jurnal

Puteți avea și o secțiune de jurnal în care să poată urmări asistentul de proiect progresul proiectului.

Bibliography/Resources

pm/prj2023/apredescu/mp3_player.1685445219.txt.gz · Last modified: 2023/05/30 14:13 by antonio.stan
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