Author Topic: A new MP3 Sound Module.....  (Read 2335 times)

0 Members and 1 Guest are viewing this topic.


  • Newbie
  • *
  • Posts: 3
A new MP3 Sound Module.....
« on: September 07, 2016, 14:24:42 »
My first Post.....   ;D

I've been experimenting with DFRobot's DFPlayer Mini MP3 player as a small sized sound module for an upcoming build. (see URL below)
The Player is an approx. one inch square with a built in 3watt amplifier and Micro SD card. You can control it using normal push buttons but I have chosen to send it instructions via an Arduino Pro Mini.

I've programmed the Arduino to read the joystick movement of an unused channel and have the mp3 player toggling between engine start, engine run, horn and engine shutdown and restart. Using the same method you could link MP3 tracks according to different engine speeds, but I'm not sure that level of sophistication is required. It was able to find engine sounds with lots of revving variations to use.

So far, I'm very pleased with the performance as it seems to be a very cost effective and small sized solution.
The parts that I am using are:
1. DFPlayer cost about $12CDN
2. Arduino Pro Mini 5volt - $13CDN
3. Pololu RC Switch - $6CDN - Used to turn on the device
4. DC voltage Regulator - $5CDN - Used to knock down the voltage to 5V.

Let me know if you have any questions

cheers,   Brian


  • Moderator
  • Hero Member
  • *****
  • Posts: 609
  • Roughly 3/4 inch scale semi accurate
    • Two Tugboats
Re: A new MP3 Sound Module.....
« Reply #1 on: September 07, 2016, 20:48:42 »
Hello Brian. . .good to see you here. For me, understanding the electrical parts of RCing
my tug are quite poor. I am all ears though when someone comes up with a less pricie way
to build our operating gear and smaller is a real plus.

I am sure there are many here on the Forum who know exactly what a DFPlayer Mini MP3 player
is. I already know more than I did before I read your post and URL picturesI. Looking at the
information and terrific site URL you shared has helped me begin understanding the basics,
thank you.

A pleasure to have you here Brian and Welcome Aboard,
Yet another case of why men and women go down to the sea in ships. . .A pleasure to be here and smell the salt air. Thank you Tugboat Forum. . .Michael in Anacortes, Washington


  • Newbie
  • *
  • Posts: 3
Re: A new MP3 Sound Module.....
« Reply #2 on: September 08, 2016, 09:48:43 »
Thanks 2TugBoats!!
I'll post my source code and connections diagram for the player project this weekend for those who want to better understand and mess around on their own.  I presume that is Ok to do in this forum.

Also, just fyi... my first place to check for all things electronic incl. motors, servos etc. etc. is:

cheers,   Brian


  • Newbie
  • *
  • Posts: 3
Re: A new MP3 Sound Module.....
« Reply #3 on: September 09, 2016, 06:33:07 »
Please find attached my source code for the MP3 player experiment.
This code is meant for your personal use only and as you will quickly see
I am not a programming Wizard so any suggestions would be appreciated. :-)

The filename must be changed to "MP3_Tug_DFPlayer.ino" for use with the Arduino
or can be viewed as a Text file using WordPad (not NotePad) on a Windows PC.

I do want to send Kudo's out to the following people....
- Alan Bond of Forge Electronics UK whose products provided the inspiration.
- Matthias Lorenz the author of the original DFPlayer Sketch   
- Kamran A who wrote the original PWM Interupt code

enjoy!!    Brian


  • Newbie
  • *
  • Posts: 8
    • Solent Radio Control Model Boat Club
Re: A new MP3 Sound Module.....
« Reply #4 on: September 09, 2016, 09:12:18 »
Just to add to Brian's excellent post, be aware that as a consequence of the compression agorithm used, all mp3 tracks start with a short silence (not an issue if playing a CD album!) but that together with the time taken to access a new file from the SD card's File Allocation Table means there will be a short pause between playing successive tracks (or looping an existing track) so you don't get a truly 'seamless' result - though I'm sure most folks would be more than happy to ignore the small hiccups. As there is so much storage on an SD card you can easily avoid the engine looping issue by preparing a single file that plays for an hour or two.

Alan Bond     
in the land of the blind, the one-eyed man is king . . . . .