Home Creators Posts Import Register Favorites Logout

Content

I've often mentioned that I believe audio is a somewhat overlooked area - it is easy to be distracted by flashing LEDs, display screens, motorised mechanisms, ... - and not give enough attention to our core sense of hearing! Almost any project can benefit from the addition of an audio module - whether it's to provide positive feedback to a user interface, add background ambience to a thematic setting, or sound effects for a model, toy, or fright prop.

There's several easy to obtain, cheap audio modules that are often used in tutorials and projects in the internet, and in this video, I'm going to demonstrate some of them, including: the DF Player Mini, Catalex Serial MP3 Player, (including the YX5200, YX6300, MH-ET LIVE MH2024K and AA20HF "variants"), DY-SV17F, DY-SV5W, DY-SV8F, DY-HV8F, and DY-HV20T.

I've not included any specific links to purchase the modules used - I don't have any kind of sponsorship deal or use affiliate links - these are purely my own personal findings and recommendations based on having deployed many projects using these boards. If you search for any of the model names you should be able to find plenty of local suppliers, but let me know if you have any issues with availability.

Some of these devices can be controlled by code sent from an Arduino, ESP32, or Raspberry Pi, whereas others can be used as a completely standalone device - requiring you only to connect a power supply and speaker. Playback of different sounds can then be controlled by pressing different buttons (or any other inputs), which makes them ideal for use in an interactive museum exhibit or other installation. such as a halloween prop activated when you step on a pressure pad. 

Now, it's going to be impossible for me to convey the volume or quality of these modules in a video.... they're all just going to sound like the speakers you're currently listening on at the volume level you've set (possibly a little bit more distorted due to my microphone!). So, I'm going to concentrate on demonstrating these other features instead: 

how to wire them _correctly_ to minimise static noise, clicks, etc. and prevent erratic behaviour during playback  

how to prepare and store audio data (using, e.g. using Audacity to normalise and trim audio files, and DriveSort to ensure that track 00004.mp3 really corresponds to track 4 on the SD card http://www.anerty.net/software/file/D... ) 

comparing ease-of-use; some devices can be wired directly to the GPIO pins of a 3.3V or 5V microprocessor, whereas others need external components such as resistors or capacitors 

testing audio latency between flash memory and SD card devices

I've tried to be as thorough and accurate as I can in the video - while there is existing information for many of these modules already on the internet, I found much of it to be incorrect! For each board, I've referred back to the manufacturer's specification and source schematics to demonstrate the correct way to use them for optimal performance. So, if you've ever encountered issues with using any of these devices previously, please do check it out and ask any questions.

I've also tried to gather all the documentation I can, together with a feature comparison table, example wiring and code, etc. which I've uploaded to the following GitHub repository:

https://github.com/playfultechnology/arduino-audio

This is currently a work-in-progress. As I think of more examples, or try new boards, I plan to add them in to make this even more thorough.

I hope you find this useful - please do ask if you have any questions, or if I've failed to mention something important!

Files

Audio modules for electronics project

In this video, I'm going to demonstrate various common audio modules - devices you can use to add music or sound effects to your Halloween scare props, escape rooms, model railways, or any other electronics projects! Particularly, I'll be comparing the following: DF Player Mini, Catalex Serial MP3 Player, (including the YX5200, YX6300, MH-ET LIVE MH2024K and AA20HF "variants"), DY-SV17F, DY-SV5W, DY-SV8F, DY-HV8F, DY-HV20T Some of these devices can be controlled by code sent from an Arduino, ESP32, or Raspberry Pi, whereas others can be used as a completely standalone device - requiring you only to connect a power supply and speaker. Playback of different sounds can then be controlled by pressing different buttons (or any other inputs), which makes them ideal for use in an interactive museum exhibit or other installation. Now, it's going to be impossible for me to convey the volume or quality of these modules in a video.... they're all just going to sound like the speakers you're currently listening on at the volume level you've set (possibly a little bit more distorted due to my microphone!). So, I'm going to concentrate on demonstrating these other features instead: - how to wire them _correctly_ to minimise static noise, clicks, etc. and prevent erratic behaviour during playback - how to prepare and store audio data (using, e.g. using Audacity to normalise and trim audio files, and DriveSort to ensure that track 00004.mp3 really corresponds to track 4 on the SD card http://www.anerty.net/software/file/DriveSort/?lang=en ) - comparing ease-of-use; some devices can be wired directly to the GPIO pins of a 3.3V or 5V microprocessor, whereas others need external components such as resistors or capacitors - testing audio latency between flash memory and SD card devices 00:00:00 - 00:00:25 Introduction 00:00:26 - 00:07:22 DF Player Mini MP3 Player 00:07:23 - 00:09:18 Catalex Serial MP3 Player 00:09:19 - 00:14:21 Clones and Counterfeit chips 00:14:22 - 00:21:52 DY-SV17F 00:21:53 - 00:24:20 DY-SV5W and DY-SV8F 00:24:21 - 00:26:53 Comparing SD card and flash latency 00:26:54 - 00:28:14 DY-HV20T and DY-HV8F 00:28:15 - 00:29:48 Preparing Audio files with Audacity 00:29:49 - 00:32:47 The importance of file naming 00:32:48 - 00:35:45 Using DriveSort to correct file indexes 00:35:46 - 00:37:53 Wrapup For further details about this, or any of my other #escaperoom tutorial videos, please see https://www.patreon.com/playfultech

Comments

Din_Jävel

This was a really, really good guide, tutorial, thank you Alastair!

Tyrel Phelps

Alastair, I sent a message from the patrons side but you mentioned that you might not be getting notified there. Can you check for my message please? Thanks in advance!!

Ian Campbell

Alastair, Messaged you on YouTube as well. Great video. I'm having trouble with a DFPlayer module as part of your rotary pulse dial phone. The DFPlayer works with the sample program from DFRobot, but not with the phone code. All of the phone switches and ringers function fine. I hope you can help me.

Ian Campbell

Alastair, Thank you again for sharing your work. You have no idea of the joy you have helped create in my household over the last few months! Anyway, you can find code and screen shots here:

Doug

Hey Alastair, Is there any way to get the DY-HV20T to be non-interruptible? I have an RFID that triggers a relay that signals the song to play, but if the relay is triggered again (if you removed the object and place it back down) it restarts the song. I've tried to use the busy pin, but I cant get it to work as intended. Any suggestions to force it to play all the way through before it can be played again?

Eduardo H

Hi, there, where can I find the value for the capacitor and the transistor that you used with the mp3-TF-16P? Thanks!!

Todd Child

Just finished my first MP3 addition using a DY-HV20T and Arduino Nano. A few things it took me too long to figure out that I'll leave here to hopefully save other first timers some time... 1) the SD card MUST be FAT formatted not NTFS. Seems obvious in retrospect but lots of SDs floating around already formatted NTFS... 2) Arduino Nano as Alastair points out in Crystal Ball, have one serial Tx/Rx pair. So to use both the Monitor and MP3 you need to use AltSoftwareSerial or SoftwareSerial to add a port. I was never able to get Alt to work but SoftwareSerial worked and there were good examples of the setup. In any event you can't just plug Arduino 0TX to MP3 Rx, you need to set up the software serial pins. Those libes allow you to set the Arduino software Tx and Rx pins to like 10 and 11... 3) Fundamental tip probably but Arduino is picky about adding Libraries. Best to use the Sketch Include Library method 4) There are some DYPlayer methods helpful for debugging but getPlayingDevice can be really helpful in telling you the state of the SD (254 your UART IO is probably backwards, 255 SD not functioning right... 5) Share ground across devices 6) sound card seems squirrely at 6 VDC but stable at 12 VDC 7) Its said in a number of places but Tx and Rx from Arduino (5vdc) to MP3 at least on the DY-HV20T (3 VDC) need 1 K Ohm resistors in line. Thanks! and good luck!

Bren 79

Where can i get sketch for this one