Arduino Retro Style MP3 Player!

8,560

97

17

Introduction: Arduino Retro Style MP3 Player!

About: Electrical Engineer and a programming hobbyist! I love to build exciting stuff!

Mp3 player may sound quite outdated. Smartphones can do much better than this! With all those apps and streaming services, you don’t even need to download any music or song.

But when I encountered the DFplayer module it really excited me with a bunch of features. From volume control, a 3W amplifier, equalizer, ability to play ads between the mp3 files, and much more. I wanted to explore all these features and put them to good use in a single device. So this MP3 player was a perfect choice.

The end product was quite interesting to use with the following features:

  • EQ Adjustment
  • Volume Control
  • Pause/play MP3 files
  • Next/previous
  • 2 screen navigation
  • rechargeable battery

Supplies

Here is the list of parts I used in this project (affiliate links):

Step 1: Setting Up the OLED Display

1.3-inch OLED and 0.96-inch OLED may look similar, but they don’ t share the same display driver, So if you try to use a library like Adafruit SSD1306, the display won't work because the 1.3inch OLED display has Sh1106 display driver.

So, we are going to use the U8g2 library. You can download this library for your Arduino IDE with this link or go to your library manager and install the latest version of U8g2.

This library has a lot of flexibility when compared to other libraries, for example, you can run the same code for a variety of displays with very minimal code change and importantly gives you a wide range of fonts and open icons to use in your project.

The 1.3-inch display has 4 pins VCC, GND, SDA, and SCL.
Since the display supports an I2C communication, connect the VCC and GND to +5V and GND of the Arduino pro mini and connect the SDA and SCL to A4 and A5 of the Arduino pro mini.

You can test the display either by running the demo sketch which comes with the u8g2 library or you can compile and run my sketch which is in Soundpod.rar file or use the Github link.

Step 2: Setting Up DFPlayer

DFplayer is a small and cheap MP3 module with a simplified output that can be directly connected to a speaker without an amplifier.

Features

  • 24bit DAC
  • Supports FAT16, FAT32 file system
  • Up to 32GB SD card support
  • Built-in 3Watt Amplifier
  • supports 100folders, each folder can support up to 1000songs
  • 5 levels of EQ adjustment and 30 levels of volume adjustment

Circuit

This module can be used standalone with an attached battery, speaker & push buttons or can be used with an Arduino or any other microcontroller. It uses UART/serial communication for sending and receiving commands to microcontrollers. So we can use the Arduino's serial read/write function to control this module.

Connect 4 push buttons to the pin 2,3,4 of the Arduino for controlling the volume/start/stop and then connect the pin Rx and Tx pin of the DFplayer to Arduino pin 10 and 11. Finally, connect the speaker to spk+, spk- of the DFplayer, and connect +5v supply to VCC and GND to GND of the DFplayer.

You can test your module with the code which is in the folder 'DFPlayer'. This instructable would help you more in easily getting started with Arduino and DFPlayer.

Step 3: Preparing the Components

You would have seen the final built looks messy and you may think it would be way better to print a PCB. I totally agree! But this is comparatively more fun and personally they are pretty cool to look at as well. Anyway, I will drop a link where you can use the existing circuit and build a PCB.

Since there are too many components to use, a 2 sided PCB would be a perfect fit. Then cut 2 sided PCB in such a way that horizontally it has 14 holes and vertically 21. Then placed the push buttons which will help us in navigation, pause, and play of the song. While placing other components you need to be really careful where you place them and how many pins each component has. From my experience of building this twice, keep only the pins that are used and cut the rest of them, It would solve more problems down the road. You can refer to this circuit diagram and cut the unnecessary pins.

Step 4: Placing the Components

Place the digital pins of the Arduino close to the buttons and the analog pins pointing toward the top of the board so it would be easy connecting to the OLED display. Then do the same process for the DFplayer, place the module in such a way that the SD card slot is pointed inward, and also remove the black separator from the header pins, so the DFplayer has a proper fit in the board along with the Arduino.

I wanted to run DFplayer with full capacity, so I added a small boost converter to convert the 3.7 volts from the lithium battery to 5V. But in the end, this module couldn’t provide enough current to run the DFPlayer. And I felt it was doing much better with the 3.7-volt battery alone So, in the end, I discarded the boost converter(the green PCB module next to the Arduino pro mini).

Finally, to finish it off the backside of the PCB install the slide switch and the 3.5mm audio jack.

Step 5: Soldering Everything Together

Follow the circuit diagram and solder the components close to each other, where you can merge two connections easily, and try to avoid using wires. Instead, use a bare single strand wire to make the connections and make sure you don’t touch any of the components on the bottom side too. And I Placed 2 single strand wires which are poking out of the board, this will be later used to solder the TP4056.

Step 6: More Soldering!

Place the TP4056 module, which we will be using to charge our MP3 player with micro-USB. I used double-sided tape to place the Lithium polymer battery next to the charging module. This is a 300Mah module that fits perfectly within the PCB. If you build a bigger one, You can easily expand the battery without any modification to the current circuit.

Finally, solder the OLED display to finish it off, If you could follow the circuit diagram and place the components in the same order it will be a lot easier to work with.

Step 7: Uploading the Code and Finishing Touches

Then I gave some final touch, by giving it some smooth rounded corner and I drilled a hole at the top corner so I can use this as a keychain!

Now, we can look into the programming part!

Instructions for the installation of the required libraries and how to use them is given in the Readme file on my git repository of this project. Just follow the instructions and use an FDTI module to program which is in the soundpod.rar file to Arduino pro mini. We are using an FDTI module because Arduino pro mini doesn't support USB to program it.

Finally, I removed the lights from the Arduino pro mini and DFplayer to save some battery and distraction it was causing while playing the song.

Step 8: Finished Project!

If you turn on the circuit after uploading the code, you can see Arduino boots up and the OLED screen works. Before jumping in and seeing all the features of this MP3 module, copy some music files to SD. For this, you have to follow some certain naming convention, where your folders should be named 01,02,..etc and your files inside each folder should be named 001,002,003..etc.

So to make everything simple I have a python script in the GitHub repo along with the code for this project. Just run the script in the command prompt and you should get a GUI interface where you can transfer files to your SD card hustle free for your DFPlayer.

Here you can create as many folders as you want, and you can add as many as files as you need in the files list. You can also remove unwanted folders and files (The program is designed to look like software from the past decade so it matches our mp3 build). Insert the SD card and turn on the soundpod(That's the name I gave for my MP3 player XD).

You can see the working of this soundpod in the video posted above!

First Time Author Contest

Participated in the
First Time Author Contest

Be the First to Share

    Recommendations

    • Arduino Contest

      Arduino Contest
    • Barbecue Speed Challenge

      Barbecue Speed Challenge
    • Colors of the Rainbow Contest

      Colors of the Rainbow Contest

    17 Comments

    0
    demetrileemaltezos
    demetrileemaltezos

    Question 3 months ago

    i get this error when i try to compile, can you fix it? 'buttonVolume' was not declared in this scope

    0
    lavanya4520
    lavanya4520

    7 months ago

    It's lovely! I'm inspired :')

    0
    joesgarage18
    joesgarage18

    8 months ago

    The code doesnt download (the rar file). It comes down as 1K.

    0
    Neutrino-1
    Neutrino-1

    Reply 8 months ago

    try getting the code from GitHub

    0
    Charles Projects
    Charles Projects

    Question 9 months ago

    Can I use OLED screen when using nano, just like Pro mini?
    Is the connection the same? I want to make this, but I am a little bit confused.
    Thanks in advance.

    0
    Neutrino-1
    Neutrino-1

    Answer 9 months ago

    Yes, Pro mini has the same connection as Arduino nano.

    0
    Charles Projects
    Charles Projects

    Question 9 months ago on Step 2

    When you are working, you use your prototype on Arduino Nano, right (Step 2)? For your finished project, why you do not use Arduino Nano instead you use Arduino Pro Mini? Confused.

    0
    Neutrino-1
    Neutrino-1

    Answer 9 months ago

    Nano was very easy to prototype that's the reason it was used in step-2.
    Later to decrease the size of the overall device I used the pro mini.

    0
    Mj3x
    Mj3x

    Tip 11 months ago

    hello
    your project is not sheet
    its was good

    Schematic_SoundPod.png
    1
    Manjunath Prashanth
    Manjunath Prashanth

    Question 1 year ago

    I am thinking of building it. How much does it cost to build?

    0
    Neutrino-1
    Neutrino-1

    Answer 1 year ago

    Say around 1.2k rupee

    1
    kaushikrao
    kaushikrao

    1 year ago

    This is very interesting, nice job!!!

    1
    im_no_one
    im_no_one

    1 year ago

    Very well explained...gonna try it for sure!! :) Thank you

    2
    seerena
    seerena

    1 year ago

    These are so cool. Nice work

    4
    Penolopy Bulnick
    Penolopy Bulnick

    1 year ago

    Thanks for sharing your project! It looks great :)