Master the MP3-TF-16P (DF Player Mini) on Arduino: Seamless Sound Integration & Easy Setup! 🎶

  Рет қаралды 58,390

The Last Outpost Workshop

The Last Outpost Workshop

Күн бұрын

Пікірлер: 218
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
Next Video in this series: Navigating MP3 Files with Rotary Encoder | MP3 Player Project Series: kzbin.info/www/bejne/aJmlf3Z8rtSogLs
@alaeddingarraoui4538
@alaeddingarraoui4538 8 ай бұрын
I can't thank you enough man !!! you made my night here .. I tried a bunch of tutorials on KZbin before this one but they didn't work, and with yours, it worked for the first time. THANK YOU A LOT!
@davidjesky
@davidjesky Жыл бұрын
Excellently done. I appreciate all the time you spent here and well documented as well. Thanks!
@DrHaywoodJablome
@DrHaywoodJablome Ай бұрын
You my good sir, have rescued me from hours of headaches wrestling with various libraries that didn't work, custom code I tried to put together.. finally, yours is the one that worked! Thanks so much for this guide! A++++
@albafleutot3944
@albafleutot3944 11 ай бұрын
Thank you so much !! I've been trying to make DFPlayer work for days ! I'm so happy I found your channel haha
@Dr-Dissection
@Dr-Dissection Ай бұрын
I am so grateful for this video, I been trying for weeks now thank you so much
@YasirFaur
@YasirFaur Жыл бұрын
Thank you very much. Please note that you should use a 3W speaker or one with lower power rating. If you don't have a 3W speaker, you can use a 5W speaker with a series resistor (20 ohms or more), and it can work, as I have done.
@UliSpalthoff
@UliSpalthoff 11 ай бұрын
Isn't the load to the amplifier defined by the Ohms rating, not by the power rating? afaik, The speaker power just tells which power the speaker can handle without distorting sound too much.
@grayeagle247
@grayeagle247 5 ай бұрын
With this device, can I add 100 W amp and a larger speaker? Thank you in advance.
@plantor0728
@plantor0728 9 ай бұрын
I KID YOU NOT I HAVE BEEN TRYING TO GET THIS STUPID PIECE TO WORK FOR 3 DAYS THANK YOU!!!!!!!! MY TORTURE IS FINALLY OVER
@plantor0728
@plantor0728 9 ай бұрын
now all I have to do now is find a way to play it by using an ir remote
@taebm
@taebm Ай бұрын
bro, fucking same. its an anniversary present and this wee fuckin thing has given me nothing but bother. UI done weeks ago, 3d modelled weeks ago, but this fuckin one thing has genuinely given me nothing but trouble. hope you got your proejct working in the end bro
@plantor0728
@plantor0728 Ай бұрын
@@taebm ya it went amazing, I used to play bell noises for a prison model that we made for our law class, also using it I was able to rick roll my teacher so I was very happy
@taebm
@taebm Ай бұрын
@plantor0728 Ahahah, no way! That's the best use of it man, good stuff. Sounds like a really unique and cool project you ended up with too. Hope you're still designing stuff, nothing more fun and engaging than that imo
@plantor0728
@plantor0728 Ай бұрын
@ ya now I’m trying to make a very simple computer out of transistors, it’s going along pretty well too, already made a astable multivibrator for the clock circuit and I’ve made a 4 bit adder for it to, next up on my list is to made a binary counter to make sure the program is on the right step
@balimade5686
@balimade5686 3 ай бұрын
Sebagai seorang pemula, saya sangat berterima kasih kepada anda. semoga anda sehat dan bekarya selalu.
@CalvinGentry-o6r
@CalvinGentry-o6r Жыл бұрын
How do I Reset when i want to stop a song thats already playing
@LowerDeckProps
@LowerDeckProps Жыл бұрын
I got this working this morning. Thanks, Charles. Great tutorial! I'm looking forward to adding sound to my projects.
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
Fantastic!
@LIMFANGQUAN
@LIMFANGQUAN Жыл бұрын
Thanks a lot. This video really helps me! After i format my SD card the mp3 player finally works!
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
You're welcome!
@tonyakauhi147
@tonyakauhi147 3 ай бұрын
Thank you for this tutorial. I am only able to get my DFplayer to work using your mp3tf16p wrapper. I am not able to access the DFMiniPlayerRobot library in a new sketch (it is installed). Do you know why this is? I want to add a button push to trigger the music and then randomly play one of 4 MP3s but I keep getting an error that its not defined in the class MP3Player. Any help would be appreciated.
@thelastoutpostworkshop
@thelastoutpostworkshop 3 ай бұрын
You can access the functions of DFMiniPlayerRobot library, by using the player object, for example using my code with mp3.player.EQ to access the equlizer or any other functions provided by the DFMiniPlayerRobot library
@thatotherguyontv
@thatotherguyontv 9 ай бұрын
Just worked through an issue I had with this board, one that others may also have, so I thought I'd share. Everything was connected correctly, the code was implemented and uploaded. But the only serial output was "MP3 Player Online." After messing around with the code and it still not working, I switched out my Arduino Nano for an Uno, and that instantly fixed the problem. I think my Nano is an older model, without an ESP32. So check for microcontroller compatbility! Otherwise, a great tutorial and header file. Thanks!
@thelastoutpostworkshop
@thelastoutpostworkshop 9 ай бұрын
Thanks for sharing
@Madmaxkkb
@Madmaxkkb 8 ай бұрын
Brother I the got same problem but then I used an external battery to power the df player and it worked in my case
@vasunirawdekar8056
@vasunirawdekar8056 4 ай бұрын
how do i use push button configuration , like if i press button it will start playing and after it ends it will stop unless n untill i push the button again to listen
@richardphillips1891
@richardphillips1891 4 ай бұрын
Great series and helpful information regarding editing features, formatting SD card and mp3 information, and as usual, helpful programming tips. Thank you.
@feenixb1o7
@feenixb1o7 3 ай бұрын
Is this device capable of playing one audio track on startup, and then a different audio track when a button is held down and then back to the first audio track when the button is released? Thank you for your time.
@thelastoutpostworkshop
@thelastoutpostworkshop 3 ай бұрын
Yes it can do that with the proper code in your sketch
@feenixb1o7
@feenixb1o7 3 ай бұрын
@@thelastoutpostworkshop Any pointers? I have it in an if statement in the loop, but when I press the button, it has to wait for the song to finish before playing the other audio track?
@lauravilleda4359
@lauravilleda4359 3 ай бұрын
El código corre bien, me encato, fue el único vídeo que me ayudo a poder realizar mi proyecto. Siga haciendo vídeos así!😃😃😃¡Estoy feliz con el resultado!
@MrWesleyruff
@MrWesleyruff Жыл бұрын
Thank you! This helped me get my MP3-TF-16P V3.0 up and running!👍👍
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
Great to hear!
@imarobodude
@imarobodude 6 ай бұрын
I'm confused why nobody ever says what impedance of speaker this can handle; as if they think 3 Watt tells me anything? It makes NO difference if the speaker can handle more than 3 Watt since DFPlayer will never get that high so it will never care that your speaker can handle more than that. I get the hint people don't comprehend that the speaker is not sending power back to the driver. But I DO need to know whether you have 4, 8, maybe 16 ohm speaker ??
@greenmoss
@greenmoss 7 күн бұрын
He is clearly using a 2W 8 Ohm speaker. Look at the speaker.
@imarobodude
@imarobodude 7 күн бұрын
@@greenmoss thanks I did see it later that day but hope for professional specs and yes I've been professional since about 1992 so not fooled by amateur errors on social media, like assuming if the driver is rated 3W you better use a 2W speaker to be safe XD
@surfnexplore
@surfnexplore 5 ай бұрын
excellent and to the point walkthrough to begin with, appreciate !!
@leeskelton9715
@leeskelton9715 Жыл бұрын
Thank you very much for this. Complete beginner here and I managed ( eventually ) to get this working thanks to your detailed tutorial. I wondered if you have another tutorial on adding a PIR sensor so that it plays the themes when movement is detected? Thanks again and kind regards
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
Thanks a lot for your feedback, I do not have a tutorial with a PIR sensor, I will add it to the list!
@jindagar
@jindagar Жыл бұрын
how can we configure this in to a sound fx board i.e. pressing a certain button plays a certain sound?
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
I will do it in a future video with a rotary encoder
@sam-e6h5o
@sam-e6h5o 10 ай бұрын
I've checked my wiring, and every time I plug the mp3 player in, the lights on the Arduino turn off, do you have any idea what is happening.
@Hafizsamsung-h6m
@Hafizsamsung-h6m 6 ай бұрын
Short
@Sunnystew222
@Sunnystew222 5 ай бұрын
You are short circuiting your Arduino
@Hafizsamsung-h6m
@Hafizsamsung-h6m 5 ай бұрын
@@sam-e6h5o Maybe your MP3 player has a short circuit or you installed the polarity in reverse
@keramikmann9740
@keramikmann9740 5 күн бұрын
I always get this : "Compilation error: SoftwareSerial.h: No such file or directory" i have both libraries installed, its inside the header file
@leeskelton9715
@leeskelton9715 Жыл бұрын
Hello and thank you for fantastic content. I just wanted to ask if you may have found a way of adding a PIR sensor to this as yet? I have a great little Sith Wayfinder star wars project that I’d like to add sound, activated by a sensor when you enter the room. Kind regards
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
It is still on my list, choice are hard to make! Anyone else would like to have tutorial a PIR sensor with the MP3 module ?
@leeskelton9715
@leeskelton9715 Жыл бұрын
@@thelastoutpostworkshop fingers crossed 🙏🏻😄
@judgeworks3687
@judgeworks3687 11 ай бұрын
I’d love a tutorial on using PIR sensor to trigger sound/tracks
@leeskelton9715
@leeskelton9715 11 ай бұрын
@@judgeworks3687 , thanks 👍
@elektronstorm
@elektronstorm Ай бұрын
God bless you man!
@SWAFanPilot
@SWAFanPilot 4 ай бұрын
My sounds are playing twice for some reason, and usually won't play in sequence. Some play twice and some don't. Some play in sequence and some don't.
@simran11.11
@simran11.11 3 ай бұрын
I am using arduino 2.3.2 and I cant find preferences
@eddiejones8709
@eddiejones8709 Жыл бұрын
Great Video. As you, I was having problems getting my player to play all the files after formatting my disk using WIN10. I found that if you don't use the quick format your MP3 player will play all of you files. I have about 700 songs on a disk and by using the randomALL command it plays all of the songs loaded. Also, I don't any number or folders assigned to the songs. Hope this helps.
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
Thanks for the tip
@kevingreenberg4281
@kevingreenberg4281 10 ай бұрын
When I run the code to test a song I am not seeing a blue light at all and no music is playing. Not sure what I did/am doing wrong.
@thelastoutpostworkshop
@thelastoutpostworkshop 10 ай бұрын
The wiring may be the issue
@kevingreenberg4281
@kevingreenberg4281 10 ай бұрын
@@thelastoutpostworkshop hmm I just tried again, same issue. I do hear faint white noise from the speakers but thats all that is happening
@sam-e6h5o
@sam-e6h5o 10 ай бұрын
the same thing keeps happening to me@@kevingreenberg4281
@Symboter
@Symboter 9 ай бұрын
Did you experience different speed of playback using more than one of modules? I hooked up three of them, Start them simultaneously, same as cards, same file and they start synchronous, but drift about 1 sec within 6 minutes playback. So speed of playback is not identical on these modules, good only for doorbells, but not for serious applications, or?
@thelastoutpostworkshop
@thelastoutpostworkshop 9 ай бұрын
I never tried with more than one module
@jogsdc2020
@jogsdc2020 3 ай бұрын
Is the volume of the speaker is adjustable? And also i have a concern about how many sounds can play because i need to input many kinds of sounds of animals i hope you answer my question sir thank you 🙏🏻
@thelastoutpostworkshop
@thelastoutpostworkshop 3 ай бұрын
yes the volume can be adjusted in the code and you can store hundreds of sounds on the sd card that you can replay
@jogsdc2020
@jogsdc2020 3 ай бұрын
@@thelastoutpostworkshop , your so very generous when it comes to your viewers thanks a lot sir 👍
@АнастасіяПолюхович-м5з
@АнастасіяПолюхович-м5з 7 ай бұрын
Good evening, I'm trying to start the player but it says MP3 online, but nothing works, what could be the error? Can you help me please?
@thelastoutpostworkshop
@thelastoutpostworkshop 7 ай бұрын
Reeheck your wiring. Make sure the TX and RX pin are not reversed. Do you have any error message on the serial monitor when playing a sound file ?
@АнастасіяПолюхович-м5з
@АнастасіяПолюхович-м5з 7 ай бұрын
@@thelastoutpostworkshop no, nothing appears. Everything is connected correctly, there are no errors. I would attach a photo here, but this is impossible. Can we write to each other somewhere on social networks? I will be very grateful to you!!!🙏🙏🙏
@ruiguedes4789
@ruiguedes4789 3 ай бұрын
Hello friend thanks for sharing this touturial but I have a question for this module is " 3.0 right "you used mp3tf16.h ,I use DfRobotDFPlayerMini.h but is not good,and my display p10 shutdown,and order songs not the same when I used DFrobot Dfplayer mini.h. You can tell me why please 😉
@thelastoutpostworkshop
@thelastoutpostworkshop 3 ай бұрын
mp3tf16.h is just a wrapper for DfRobotDFPlayerMini.h to make it easier to use. DfRobotDFPlayerMini.h is no longer maintained and has some issues. I tried to find an alternative with no luck. But the code should work, make sure the pins used in this project are not reserved in your development board.
@ruiguedes4789
@ruiguedes4789 3 ай бұрын
@@thelastoutpostworkshop hello friend well pins be ok because for me work perfect and for my friend no , I have module red light and my friend have blue light have some Diference?
@marckerger
@marckerger 10 ай бұрын
how can I use your script on a board with hardware serial1 ? mine does not support softwareserial
@thelastoutpostworkshop
@thelastoutpostworkshop 10 ай бұрын
Here’s how you can modify the MP3Player class to use a hardware serial port instead of a software serial one. The changes mainly involve removing the SoftwareSerial object and assuming you will use a predefined hardware serial port for communication with the DFPlayer Mini module: #include "Arduino.h" #include "DFRobotDFPlayerMini.h" #define MP3_ERROR_ONLY 1 #define MP3_ALL_MESSAGE 2 class MP3Player { private: HardwareSerial *mySerial; // Pointer to HardwareSerial instead of SoftwareSerial void statusOnSerial(uint8_t type, int value); void waitPlayIsTerminated(void); public: DFRobotDFPlayerMini player; // Constructor now takes a reference to a HardwareSerial object MP3Player(HardwareSerial &serialPort); ~MP3Player(); void playTrackNumber(int trackNumber, int volume, boolean waitPlayTerminated = true); boolean playCompleted(void); void initialize(void); int serialPrintStatus(int errorOnly); }; // Constructor implementation changed to initialize the HardwareSerial reference MP3Player::MP3Player(HardwareSerial &serialPort) : mySerial(&serialPort) { } MP3Player::~MP3Player() { } void MP3Player::initialize(void) { mySerial->begin(9600); Serial.println(F("Initializing MP3Player ...")); if (!player.begin(*mySerial,true,false)) // Use the HardwareSerial reference { Serial.println(F("Unable to begin:")); Serial.println(F("1.Please recheck the connection!")); Serial.println(F("2.Please insert the SD card!")); while (true) ; } player.volume(10); Serial.println(F("MP3Player online.")); } // The rest of the implementation remains the same...
@Fusionultra2000
@Fusionultra2000 11 ай бұрын
When I run the sketch it only says mp3 player online and nothing happens. When I run the GetStarted example by dfrobot I get different results. I get a timeout error running it after the speaker makes a short crackling sound and then it says track 1 complete. I triple checked every connection with the same wiring in the video but I can't get it to work.
@thelastoutpostworkshop
@thelastoutpostworkshop 11 ай бұрын
Seams like a wiring issue to me
@Fusionultra2000
@Fusionultra2000 11 ай бұрын
@@thelastoutpostworkshop I got it working now but it doesn't like long files that are more than a minute long. If I go to soundbuttonsworld and download a short audio file and add it to the sd card, it plays just fine. However if I put in a regular music length file into it, it will not play. Is there a size limit for each file?
@monkeytree1648
@monkeytree1648 7 ай бұрын
can you help me for some reason it only works if I use Uno not a Nano and in serial monitor for the Nano it says : Initializing MP3Player … MP3Player online. the Uno works perfectly fine pleases Help
@thelastoutpostworkshop
@thelastoutpostworkshop 7 ай бұрын
Very strange, the wiring shoud be the same. Are you running the same code ? Does the Nano execute the playTrackNumber() ?
@monkeytree1648
@monkeytree1648 7 ай бұрын
@@thelastoutpostworkshop the wiring is the same and it doesn’t play the song :(
@monkeytree1648
@monkeytree1648 7 ай бұрын
@@thelastoutpostworkshop i used a different tutorial and I got it working thx for trying to help me
@dudaqee2059
@dudaqee2059 11 ай бұрын
hey so working on a project where I am only using one song on the SD card, but wanted to know how i could make it activate by the push of a button and only play the song once each time. think you could help me with this one?
@udeolisachukwudalu1309
@udeolisachukwudalu1309 9 ай бұрын
Is there a functionality where you can directly access a music you want to play with the press of a button? I dont mean jumping to the next music, rather i want to be able to access any music file not minding its position on the file list.
@thelastoutpostworkshop
@thelastoutpostworkshop 9 ай бұрын
You can access any music using its index number, but it will be hard with just on button
@udeolisachukwudalu1309
@udeolisachukwudalu1309 9 ай бұрын
@@thelastoutpostworkshop so I can use matrix keypad
@thelastoutpostworkshop
@thelastoutpostworkshop 9 ай бұрын
I think so
@theveteranworkshop8328
@theveteranworkshop8328 Жыл бұрын
Great video, what if I want to have a total of about 20 sounds playing with a delay in between. Do I need to number each out with a delay command in between? Or is there a way to make the code shorter?
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
You just have to put them into a for-loop and insert a delay like this : int volumeLevel = 20; int trackCount = mp3.player.readFileCounts(); for (int i = 1; i
@kind_Nictus
@kind_Nictus 9 ай бұрын
what mp3 player to use if u want to use for example 12w speakers, or even more?
@thelastoutpostworkshop
@thelastoutpostworkshop 9 ай бұрын
The same but with an amplifier board
@CharlieMashinini
@CharlieMashinini Жыл бұрын
Greetings I am using the Gravity Digital Speaker Module for the MP3-TF-16P project, but my speaker has 3 pins. For my my connection I tried connecting the VCC and GND of speaker to the Arduino Mega, then the signal Pin to SPK1 of the MP3, I eventually connected signal pin to all other pins of the MP3 player but there is still no audio sound output, the speaker produces a scratchy sound The MP3 blue light is not turning on but on the serial monitor it says “MP3Player online” May you please assist me?
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
I am not sure if it can work since the gravity module has a digital interface when SPK connections on the MP3-TF-16P are analog, but it also have DAC_R and DAC_L pins, have you tried these ?
@kingnylonofficial1139
@kingnylonofficial1139 Жыл бұрын
Please can you help me connect these to an ultrasonic sensores to detect object from 5meters
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
That’s a good idea for a future video
@stephengrattage5219
@stephengrattage5219 Жыл бұрын
Can you use a Oled screen with this board? I have been trying to get this to work with a adafruit sound board but haven’t been successful
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
yes here is an example : kzbin.info/www/bejne/fqurg32abNecnqc
@jordangoddard630
@jordangoddard630 Жыл бұрын
Can you point me in the right direction to learn how to Stop/Pause as well as Loop a track?
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
Pausing a track, I am not sure it can be done with this module, looping a track yes, if you look at the second video in the series you will get an idea on how to possibly loop a track : kzbin.info/www/bejne/aJmlf3Z8rtSogLs
@marjunemjhay6328
@marjunemjhay6328 Жыл бұрын
I have a problem with playing loop folder function. After playing for let say 4 songs in a row my buttons stop working but the music still contineus to play. I only calling the button function from the main loop. I have 5 button that use millis and state change for single and long press. Does maybe something have conflict with the code?or does it have a blocking code that prevents it to continue in main loop?
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
if your playing your song with the last parameter as true : mp3.playTrackNumber(1,15,true), this code is blocking and the rest of the code is going to execute after the song as entirely played. Change the last parameter to false.
@marjunemjhay6328
@marjunemjhay6328 Жыл бұрын
@@thelastoutpostworkshop Thank you for the reply. But i did not use playTrackNumber in my code. The problem is with mp3.player.randomAll and mp3.player.loopfolder() functions. When we say it's playing for at least 4 songs. The buttons just stop working. I dont know if there a blocking code that prevents it to go to main loop. Or conficts with my millis. Hope you can help. Thank you.
@tk2097
@tk2097 5 ай бұрын
Thanks this is great you are a good teacher. Can you explain how I would use this with a display (displayA) if I wanted to trigger the MP3 at specific times during the countdown one when the countdown starts, two at 10 seconds, one when the countdown finishes?
@drz400
@drz400 Жыл бұрын
Thank you! The test was successful.Your header file was helpful.  I will modify some toys.
@BR-rg9ib
@BR-rg9ib Жыл бұрын
CAN WE ADD SPEAKERS (WITH BUILTIN POWER SUPPLY) WITH 3.5 MM AUDIO JACK IN MP3-TF PLAYER?
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
There is no 3.5 mm jack on the module but maybe it would work with an amplifier module
@omerhalitipekci2256
@omerhalitipekci2256 11 ай бұрын
i have a issue. code and everything works well but when code starts in 3 seconds it volumes down to nothing. can you help me?
@thelastoutpostworkshop
@thelastoutpostworkshop 11 ай бұрын
You hear sound, but it lowers after 3 seconds ?
@omerhalitipekci2256
@omerhalitipekci2256 11 ай бұрын
yes@@thelastoutpostworkshop
@omerhalitipekci2256
@omerhalitipekci2256 11 ай бұрын
@@thelastoutpostworkshop yeah, sorry for my bad english
@thelastoutpostworkshop
@thelastoutpostworkshop 11 ай бұрын
very strange, please post the code here
@121sarveshwarvec8
@121sarveshwarvec8 10 ай бұрын
Can we play specific audio , when it is mapped with some buttons
@thelastoutpostworkshop
@thelastoutpostworkshop 10 ай бұрын
Sure you can do that, you just have to create a function for each button that will be called when they are pressed, inside each function call the play function to play the audio file
@hari_govind_vlogs_
@hari_govind_vlogs_ 2 ай бұрын
Thanks a lot bruhhhhh❤
@codecrusader123
@codecrusader123 Жыл бұрын
Super Project. This type of tutorial is very helpful for people thankyou
@ashishkishore6447
@ashishkishore6447 9 ай бұрын
How can we use DFPlayer mini with Arduino Nano 33 IoT ?
@thelastoutpostworkshop
@thelastoutpostworkshop 8 ай бұрын
Yes, the DFPlayer Mini can be used with the Arduino Nano 33 IoT. However, there are a few considerations you should take into account due to the differences in operating voltages and the additional features of the Arduino Nano 33 IoT. Voltage Compatibility: The Arduino Nano 33 IoT operates at 3.3V, whereas the DFPlayer Mini typically works with 5V signals. To safely connect the TX and RX pins of the DFPlayer Mini to the Arduino Nano 33 IoT, you might need to use a level shifter or a voltage divider to step down the 5V TX output of the DFPlayer to 3.3V acceptable by the Arduino's RX pin. Serial Communication: The Arduino Nano 33 IoT has one primary serial port used for programming and debugging over USB. To communicate with the DFPlayer Mini, you can use software serial on other digital pins.
@ashishkishore6447
@ashishkishore6447 8 ай бұрын
@@thelastoutpostworkshop Thanks for your prompt reply. Can you please make and share some tutorial on this? Shall appreciate your help on this!
@dreezykareem7199
@dreezykareem7199 Жыл бұрын
hey, mp3 player turns off when i plug in the sd card. its slowing down my project. pleas help me.
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
Is there any message on the serial Monitor ? Also recheck your wiring
@tomas3244
@tomas3244 Жыл бұрын
Great tutorial! Thank you! I followed every step of it. I have one issue, though. I have four tracks on my SD card, and some of them are super short (like 1 second). When i play the short tracks, they repeat themselves once. Why does this happen?
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
Very strange, I really don't know. If you play a track with this call : mp3.playTrackNumber(your_track_number, volume,true); Do it repeat itself ?
@tomas3244
@tomas3244 Жыл бұрын
@@thelastoutpostworkshop Thank you for your quick response, I’ll check it out
@Martmarttoo
@Martmarttoo Жыл бұрын
@thelastoutpostworkshop Hi, I try to connect the mp3 player to a mega 2560 pro at hardware serial1 (pin 18 and 19). There seems to be no connection, can you help for a solution?
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
I don't have a mega board, so I cannot test it, but I assume pin 18 and 19 you are using are for the RX and TX pin of the MP3 player. Have you tried using pin 10 and 11 on the Mega for the RX and TX pins on the MP3 player to see if it works ?
@Martmarttoo
@Martmarttoo Жыл бұрын
@@thelastoutpostworkshop Thank you, yes I tried. There is even no message at the serial monitor with the mp3.serialPrintStatus(MP3_ALL_MESSAGE) command. It works with the ADKEY pin, so it's not defect.
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
you mean the MP3 is working with the ADKEY pin ?
@Martmarttoo
@Martmarttoo Жыл бұрын
@@thelastoutpostworkshop I would like it working with the UART but to test if it's not broken I tried the ADKEY pin.
@FiammaH2SO4
@FiammaH2SO4 Жыл бұрын
Hi nice video it helped me understand how it works, but I have one question: Is there a way to stop the initialize if the audio files are in the void loop? like, I use a switch to toggle all off but I don't want to use it for removing the power, do you think is there a way with coding?
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
I ma not sure I understand what you mean exactly by "stop the initialize", show me some code please
@FiammaH2SO4
@FiammaH2SO4 Жыл бұрын
@@thelastoutpostworkshop I mean like: void loop() { int filecount = mp3.player.readFileCounts(); Serial.println(filecount); mp3.initialize(); *Then Here in the loop I add some coding* And then after I did the code, I want a switch to, like, "mute" the speaker or to stop the code, because mp3.initialize(); makes the mp3 start to play, is there a "reverse" of the mp3.initialize(); or I have to stop all using external power connections?
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
the mp3.initialize() must be in the setup(), not in the loop.
@AntonyIssaqS
@AntonyIssaqS 10 ай бұрын
I have a problem with playing songs using DF player mini. It didn’t play the song. I had uploaded the song to the SD card. Then I insert that to the DF player. While inserting the SD card to the DF player, the light on the DF player mini turned off and there is no sign of playing the song. I thought that there might be an issue with the module. So I replaced that with newer one. Then also the same problem comes. I had used three modules till now but the problem persists. Can anyone who is familiar in this can able to solve this issue?
@thelastoutpostworkshop
@thelastoutpostworkshop 10 ай бұрын
check if you have reversed TX and RX pins
@AntonyIssaqS
@AntonyIssaqS 9 ай бұрын
@@thelastoutpostworkshop I am using without arduino
@AntonyIssaqS
@AntonyIssaqS 9 ай бұрын
@@thelastoutpostworkshop can you please share your email?
@tisenres
@tisenres Жыл бұрын
Thanks for such an informative video on KZbin!!!!
@marjunemjhay6328
@marjunemjhay6328 Жыл бұрын
Hi can you help me..i want to use your "mp3tf16p.h" with hardware serial..thank you very much.
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
Here is the code for using Harware Serial : #include "DFRobotDFPlayerMini.h", be aware that it is used for Serial for communication with your computer over the USB port : #define MP3_ERROR_ONLY 1 #define MP3_ALL_MESSAGE 2 class MP3Player { private: void statusOnSerial(uint8_t type, int value); void waitPlayIsTerminated(void); public: DFRobotDFPlayerMini player; MP3Player(); // No pins in the constructor now ~MP3Player(); void playTrackNumber(int trackNumber, int volume, boolean waitPlayTerminated = true); boolean playCompleted(void); void initialize(void); int serialPrintStatus(int errorOnly); }; MP3Player::MP3Player() // Constructor doesn't need parameters now { // Empty constructor } // ... [Other methods remain unchanged] void MP3Player::initialize(void) { Serial.begin(9600); // Start the hardware serial port Serial.println(F("Initializing MP3Player ...")); if (!player.begin(Serial, true, false)) // Pass the hardware Serial { // ... [Unchanged error handling code] } player.volume(10); Serial.println(F("MP3Player online.")); }
@marjunemjhay6328
@marjunemjhay6328 Жыл бұрын
@@thelastoutpostworkshop thank you very much you are the best at this. Subscribed to your channel...keep it up..👍👍👍👍
@marjunemjhay6328
@marjunemjhay6328 Жыл бұрын
@@thelastoutpostworkshop im having an error: request for member 'initialize' in 'mp3', which is of non-class type 'MP3Player()' mp3.initialize();
@marjunemjhay6328
@marjunemjhay6328 Жыл бұрын
​@@thelastoutpostworkshop do i have to change anything in my old script? I've just pass the mp3 with an empty value. MP3Player mp3(); Edited..: i get it... I have to lose the bracket..thank you very much
@VRNC-kn5tf
@VRNC-kn5tf Жыл бұрын
This module works perfect for a project I'm working on its just that its a little quite even at max volume of 30. Is there a way to boost the volume without needing another module?
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
What are the specs of your speaker ?
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
Is it quiet with all the sounds you have on your SD card?
@exoticloop
@exoticloop Жыл бұрын
I'm working on a project rn that needs screaming. There are some amplifying circuitry you can do on a breadboard with transistors and other components but it can get cluttered and complicated. If you do end up using a module try a PAM8403 (im using this rn) or maybe a LM386 (i havent used this)
@he214abc
@he214abc Жыл бұрын
how many sounds tracks can be played at the same time ?
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
only one
@he214abc
@he214abc Жыл бұрын
@@thelastoutpostworkshop i played rc tank, many sound tracks needed to be played at the same time, like 5 channels, then what i should use instead ?
@rosmanminiatures
@rosmanminiatures Жыл бұрын
I have tried this and, for sure not 5 chanels but a couple, and you have to conect as many dfplayer as channels you want, with only one speaker needed. For example in your case, i supose the noise of the engine sound will be one channel and at the same time when the canon shots you want to hear an explosion, then you play this on the second one. The dfplayer has to be connected to another pin set for RX TX comunication. And i reccomend to think about if you really need those five channels or if you can simplify them in less because all that will be so pin consuming
@Mysthral1
@Mysthral1 Жыл бұрын
Intéressant comme d'habitude. À ton avis, est-il nécessaire de prendre ce modèle exactement, (MP3-TF-16P comme ta photo, écrit sur le dessus) ou il n'y a pas de différence (côté qualité bien sûre? Il y a plusieurs modèles sur Amazon et à différents prix. Celui qui porte le numéro du modèle exact, au lieu de DFPlayer mini comme les moins dispendieux, est 12 $ au lieu de 3 pour 5 $.
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
Je n'ai testé que ce modèle jusqu'èa maintenant
@Mysthral1
@Mysthral1 Жыл бұрын
OK, je tentes ma chance.@@thelastoutpostworkshop
@studywithrichardlin3381
@studywithrichardlin3381 Жыл бұрын
Tks for sharing. I can did it because I saw this video. Great. Good KZbinr.
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
Many thanks!
@Ninanas98
@Ninanas98 Жыл бұрын
Thanks for the video! Is it also possible to use a button to cycle through the sounds while they still play in a loop? So that when the sound is done playing it jumps to the next sound, but when it is playing and you want to skip this sound you can press the button to go to the next? I tried a few things but can't get it to work.
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
yes you can do that, just specify false for the last parameter when starting a sound : mp3.playTrackNumber(sound, currentVolume, false); So the sound will start playing and your code will not be blocked, you can then do anything you want while the sound is still playing, including starting a new sound!
@Ninanas98
@Ninanas98 Жыл бұрын
@@thelastoutpostworkshop Thank you for the reply! I tried it like this if (digitalRead(buttonNext) == ACTIVATED){ i ++; } mp3.playTrackNumber(i, 4, false); but the sound keeps starting from the beginning until you start the last sound in the folder, that one is played fully. Would it also be possible to combine it with a for loop or something so when you don't press the button the next sound will automatically play after the current sound is finished?
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
if you want to play a sound automatically after one is finished, you can do it this way : mp3.playTrackNumber(sound1,15,false); while(!mp3.playCompleted() && !buttonPressed) { } //play the other file
@user001sg9
@user001sg9 Жыл бұрын
Nice video, Thanks for sharing. I wish to add the MP3 player function to a selfbuilt Nixie clock and turn it into a "talking clock". For this purpose, I need to concatnate different MP3 files depending upon the time the clock is going to announce. My question: Does the MP3 Player library allow concatanation of files? Thanks for your comment/advice in advance.
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
Nice project! You don't need to concatenate the MP3 files (and the MP3 player don't have this functionnality), you can select which one to play by using code depending on the hour. Here is a very simple example : #define trackFor12 20 #define trackfor11 25 switch (hour) { case 12: mp3.playTrackNumber(trackFor12, 25, true); break; case 11: mp3.playTrackNumber(trackfor11, 25, true); break; break; // and son on }
@user001sg9
@user001sg9 Жыл бұрын
@@thelastoutpostworkshop Thank you for your quick response. It is helpful.
@weler2491
@weler2491 4 ай бұрын
How to stop the song from playing?
@thelastoutpostworkshop
@thelastoutpostworkshop 4 ай бұрын
mp3.player.stop();
@theveteranworkshop8328
@theveteranworkshop8328 Жыл бұрын
Hello again, Once again great video. I am having 2 issues, one when I do the file count I am getting a -1 as the number of files in my card. 2 and most important, I upload the program and it runs perfectly, then I remove the USB from the computer and hook it up to my mobile battery and nothing happens. Do I need a different code to start it once plugged to a battery?
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
-1 occurs when the player is busy and a timeout occurs for waiting too long for the player
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
Ho do you hook up the battery to the ESP32 ?
@marcosvolpato8135
@marcosvolpato8135 2 ай бұрын
THANK YOU SO MUCH!! IT WORKS!!
@mostafamaged3404
@mostafamaged3404 Жыл бұрын
Does the player have to be connected to pins 10 and 11 ? If so why ?
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
You can use other digital pins since the Arduino library is using software serial Uart
@guohongxu4825
@guohongxu4825 Жыл бұрын
Hi, if I want to stop the mp3 file halfway while it's playing, how would I do that?
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
The easiest way is to cut your mp3 file with the free MP3 editor Audacity : www.audacityteam.org/
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
You can also stop the song in code using the stop() function this way (here the MP3 stops after 3s): mp3.initialize(); mp3.playTrackNumber(23, 25,false); delay(3000); mp3.player.stop();
@guohongxu4825
@guohongxu4825 Жыл бұрын
​@@thelastoutpostworkshop many thanks for the quick response. do you have a reference sheet that i can look into?
@mercedespautassi9978
@mercedespautassi9978 9 ай бұрын
Good morning, I am trying to compile the sketch, but it keeps saying that I don't have the SoftwareSerial.h file, which I actually do have. And the times that it does compile the sketch, it says that I don't have another .h file that I guess the SoftwareSerial.h file is calling. What can I do? Another problem I've been havign is that the esp32 doesn't even detect the module, i've rechecked the conections a lot, but they are all correct. Also, the module i have is a clone, it isn't exactly the same hardware, do you know where I can get info about this? The place I bought the module from doesn't have any info about DFPlayer Mini's clones.
@rando5930
@rando5930 10 ай бұрын
Thank´s a lot. now it finally worked on my setup!!
@deepakzilla4962
@deepakzilla4962 Жыл бұрын
Sir I am doing a project on Blind Stick with multiple sensors (Fire, Water, LDR, Ultrasonic, DHT11) Can I use this method to play different sounds depending up on the sensor input reads and using the If, else if conditions ? BTW this was an helpful video
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
Yes absolutely, you can play sounds using if then else based on your sensors input
@deepakzilla4962
@deepakzilla4962 Жыл бұрын
Thanks a lot sir 🙏
@Pierre-Olivier-t8f
@Pierre-Olivier-t8f 11 ай бұрын
I really appreciate your videos, really helpfull! i am working on controling the volume with a ultrasonic capteur for the distance and im not sure what fonction to use!! any advice? thanks for your work
@thelastoutpostworkshop
@thelastoutpostworkshop 11 ай бұрын
Thanks, never tried it
@DreamsOfTheMind-video
@DreamsOfTheMind-video 10 ай бұрын
Thank you very much! Your explaining is perfect!
@michaelcoles4181
@michaelcoles4181 Жыл бұрын
Thanks for this video, I'm new to this and found it very informative. I've got the player to work as instructed but I'd like to play two tracks basically an engine on/off effect. Track 1 (engine startup) would play continually as long as a momentary switch is pressed then track 2 (engine cool down)would play automatically when the the switch is released. Could this be done and where would I wire the switch?
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
Yes it can be done, you can wire the switch on pin 7, and use this to initialize it in the setup() function: void setup() { pinMode(7, INPUT_PULLUP); // Rest pf your code here } then in the loop function you read the push button: void loop() { if (readPushButton()) { // Play your first MP3 file while(!readPushButton()) { // Here we are just waiting for the push button to release } // Plya your second MP3 file } Here is the function to read the push button: boolean readPushButton(void) { int value = digitalRead(PushButtonPin); delay(5); return value == 0; }
@michaelcoles4181
@michaelcoles4181 Жыл бұрын
Thanks for answering so promptly. I'll definitely give this a go!@@thelastoutpostworkshop
@michaelcoles4181
@michaelcoles4181 Жыл бұрын
Having problems setting this up. I keep getting error messages no matter which order I put them in. #include "mp3tf16p.h" MP3Player mp3(10,11); void setup() { Serial.begin(9600); mp3.initialize(); pinMode(7,INPUT_PULLUP); } void loop() { boolean readPushButton(void); int value = digitalRead(PushButtonPin); delay(5); return value == 0; if (readPushButton()); mp3.playTrackNumber(1,30); while(!readPushButton()) mp3.playTrackNumber(2,30); } I'm obviously doing something very wrong.
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
here is the full code for the sketch corrected: #include "./lib/mp3tf16p.h" #define led 13 // MP3 Player MP3Player mp3(10, 11); #define PushButtonPin 7 void setup() { Serial.begin(9600); mp3.initialize(); pinMode(PushButtonPin, INPUT_PULLUP); } void loop() { if (readPushButton()) { mp3.playTrackNumber(1, 30); while (!readPushButton()) ; mp3.playTrackNumber(2, 30); } } boolean readPushButton(void) { int value = digitalRead(PushButtonPin); delay(5); return value == 0; }
@michaelcoles4181
@michaelcoles4181 Жыл бұрын
Thanks for taking the time to correct this for me. I've just started and realise that I have a lot to learn.@@thelastoutpostworkshop
@AnxBeta
@AnxBeta Жыл бұрын
SD card format program does not work, loads then does nothing??
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
I reinstalled it and it worked just fine
@_kazuha00
@_kazuha00 6 ай бұрын
can i put an earphone here?
@thelastoutpostworkshop
@thelastoutpostworkshop 6 ай бұрын
I never tried it
@nandhakishore8439
@nandhakishore8439 4 ай бұрын
Thanks a lott!! It's working but it's not playing few audio files even though they are wav
@thelastoutpostworkshop
@thelastoutpostworkshop 4 ай бұрын
Try converting them to MP3
@garyrowlands8537
@garyrowlands8537 Жыл бұрын
Hi Great clear video and content thank you. I have read through the comments below to see if anyone else has asked the following question. I have this unit and everything works...except....I cannot play a track with a number greater than 10 (ten) I can play up to ten, so double digits work great but not in excess of ten. I have fully formatted the card, the DF Robot player Mini is installed as is your very useful header file...... All the obvious and even some less obvious... Have you had this issue, if you did what was your way forward please. If I find one I will post it here. Thanks and I hope your Christmas was fantastic and the coming New Year also
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
I never had this issue before, do you get any message on the serial monitor ?
@garyrowlands8537
@garyrowlands8537 Жыл бұрын
Not in the Serial Monitor, simply the track will not play and the program hangs. If I change to a track that had a modified date and position of ten or under, it plays perfectly without hanging :)@@thelastoutpostworkshop
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
Paste your code here, I will check it out
@benedictpng1343
@benedictpng1343 8 ай бұрын
Can you make a video using microbit for dfplayer
@hayan112
@hayan112 10 ай бұрын
does it not work with 64 GB Sd card ????
@thelastoutpostworkshop
@thelastoutpostworkshop 10 ай бұрын
No
@hayan112
@hayan112 10 ай бұрын
@thelastoutpostworkshop i thought it must work so i already bought the 64 gb😭. Thanks for the awesome tutorial tho
@thelastoutpostworkshop
@thelastoutpostworkshop 10 ай бұрын
But I think you can format it as 32GB
@hayan112
@hayan112 10 ай бұрын
@thelastoutpostworkshop can you please tell me how and save me money and time, im in a rush for a project
@DatFunnyPerson
@DatFunnyPerson 10 ай бұрын
Thank you for the Tutorial. In my case I have like 10 Songs as mp3 on my card and i would love the songs to shuffle whenever i turn my arudino on. So it plays a random song. any idea? I have zero idea how to code btw ^^ lol
@jeffbornes3986
@jeffbornes3986 Жыл бұрын
Nice Video... thank you
@robertrobert5583
@robertrobert5583 Жыл бұрын
Excellent tutorial - thank you very much
@ianlukamagics3744
@ianlukamagics3744 2 ай бұрын
Hey buddy Ive got a problem, when the card is being read, the output says that the amount of files in the card is -1, how can I solve this? thanks ¯\_(ツ)_/¯
@theforestrealm8783
@theforestrealm8783 7 ай бұрын
Hello this is a very good video 👍 but it says that in the mp3tf16p.h file that there is no file called software serial.h if you could help me that would be amazing. Btw you have a new subscriber
@thelastoutpostworkshop
@thelastoutpostworkshop 7 ай бұрын
Thanks, you mean you have a compile error ?
@retrobombstudios1258
@retrobombstudios1258 Жыл бұрын
Could a pico run this?
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
I did not try it, my only concern is the DFRobotMiniplayer library compatibility with the Pico, but since the MP3 player use standard serial communications, it should work. Give it a try!
@davidrose1278
@davidrose1278 Жыл бұрын
Im getting a undefined reference to 'DFRobotDFPlayerMini::volume(unsigned char)' 'DFRobotDFPlayerMini::play(int)',etc.
@thelastoutpostworkshop
@thelastoutpostworkshop Жыл бұрын
Did you install the library DFRobotDFPlayerMini from the Arduino IDE library manager ?
@trevo2686
@trevo2686 6 ай бұрын
Hey im going to try and get in contact with you. I'm trying to connect my arduino to a gp2040-ce. It's for a custom fightstick. You seem to know a lot about this. I'm trying to get my fightstick to play the jurassic park theme song when I turn it on. (if I could add sound to the buttons when I pushed them that would be cool too)
@garyschultz253
@garyschultz253 4 ай бұрын
"Speaker must be 3 watts or less" ? Wattage is what the speaker can handle ! Less could damage the speaker. Impedance is what you need to watch. The Speaker must be 8 ohm's or more.
@VladGohn
@VladGohn Ай бұрын
дякую!
@suhasmahajan-if9ez
@suhasmahajan-if9ez Жыл бұрын
sir can you plz help me it snot working
Arduino Magic: Navigating MP3 Files with Rotary Encoder | MP3 Player Project Series
14:24
Непосредственно Каха: сумка
0:53
К-Media
Рет қаралды 12 МЛН
БОЙКАЛАР| bayGUYS | 27 шығарылым
28:49
bayGUYS
Рет қаралды 1,1 МЛН
Who is More Stupid? #tiktok #sigmagirl #funny
0:27
CRAZY GREAPA
Рет қаралды 10 МЛН
Motion-activated Sound Effects with Arduino, PIR Sensor & MP3 Player
25:26
Play MP3 Files on ESP32 Without Codec Chip: Easy Guide
8:51
atomic14
Рет қаралды 96 М.
DFPlayer Mini Play Audio with Push Button | Simple DIY Tutorial
2:36
Audio modules for electronics project
37:54
Playful Technology
Рет қаралды 72 М.
The BEST Mechanical Display You've EVER Seen!!!
13:51
Tin Foil Hat
Рет қаралды 570 М.
🤖Я в шоке! ChatGPT пишет Arduino проекты
28:24
Building a Digital Music Player with I2S?! What is I2S! EB#45
10:24
Playing Music on the Oldest Running Computer in America!
27:06
Usagi Electric
Рет қаралды 352 М.