How to play audio with Arduino by using MP3 TF module

Поделиться
HTML-код
  • Опубликовано: 30 ноя 2024
  • In this video, I will show you, How to play audio with Arduino by using MP3 TF module.
    I am using:
    1. Arduino UNO....... ... s.click.aliexp...
    2. MP3 TF Module...... s.click.aliexp...
    3. Speaker................... s.click.aliexp...
    4. SD Card.................. s.click.aliexp...
    5. Jumper wires......... s.click.aliexp...
    6. Bread Board........... s.click.aliexp...
    Code:- drive.google.c...

Комментарии • 70

  • @tubenutt
    @tubenutt 2 месяца назад +2

    Thank you for explaining where and why you plugged in the wires. I just love it when tutorials have only crappy music. I will now go look for a tutorial that explains things

  • @이라하오
    @이라하오 5 месяцев назад +4

    It's the best!!!!!!! Thanks to you, I was able to finish my final assignment. I couldn't solve it for a few days, but thanks to your video, I was able to solve it.

  • @AndreBeukes-e1y
    @AndreBeukes-e1y 5 месяцев назад +2

    Thanks for the great video. I was battling to get my player to work using sketches posted by some others. I did find that there was significant "noise" when using .mp3 files but as soon as loaded .wav files the background "scratching" noise disappeared. Keep up the good work !

  • @Toy_and_Prop_Masters
    @Toy_and_Prop_Masters 10 месяцев назад +3

    Hi, I am looking for a device with a pre-recorded message via an SD card to plug and play. Could I connect this device to a stereo amplifier and then to speakers? I am thinking of getting a Sparkfun Trigger and a stereo amp. Ideally I would like the sound to activate automatically when the power is turned on without the use of any other controllers such as an Arduino. Does something like this even exist? Please let me know, thank you.

    • @fairelectro
      @fairelectro  10 месяцев назад +1

      you can do this with Df player mini

    • @Toy_and_Prop_Masters
      @Toy_and_Prop_Masters 10 месяцев назад +1

      Will I still need the Arduino?

    • @fairelectro
      @fairelectro  10 месяцев назад +1

      @@Toy_and_Prop_Masters you can do this without arduino, if you want to play single audio file.

    • @Toy_and_Prop_Masters
      @Toy_and_Prop_Masters 10 месяцев назад

      Perfect! Thank you!

  • @alvarogonzalez-ov4zu
    @alvarogonzalez-ov4zu 11 месяцев назад +2

    I've done everything as you did and i've been trying with different videos on RUclips to use a DFPlayer and it just doesn't work, do you have any recomendations? Thank you very much!

    • @fairelectro
      @fairelectro  11 месяцев назад

      give external 5v power to DF player

    • @uditkoli2732
      @uditkoli2732 10 месяцев назад +1

      hey there! I am struggling with mp3 module as well. Did your module work? Kindly let me know if there is any useful resource out there which I am missing on.

    • @fairelectro
      @fairelectro  10 месяцев назад

      @@uditkoli2732 What problem you face?

    • @uditkoli5530
      @uditkoli5530 10 месяцев назад

      @@fairelectro Thankyou. Your help would mean a lot. mp3 modules previous videos on YT have used red light mp3 mod. I also have a red light mp3. But you have a blue led, and your video is the recent one. does it work only with blue led.

    • @animelite4337
      @animelite4337 10 месяцев назад

      I had the same issues too, what you I realised was that the dfplayer mini with red led mostly doesn't work, try getting the dfplayer with blue Led it should work Perfectly fine.

  • @cadillacescalade5428
    @cadillacescalade5428 7 месяцев назад +1

    Hi, Can this sketch be added to a small servo sweep sketch that uses an IR sensor to activate it ?

    • @fairelectro
      @fairelectro  7 месяцев назад +1

      Yes, it can be added.

    • @cadillacescalade5428
      @cadillacescalade5428 7 месяцев назад +1

      @fairelectro OK Awesome Thank You for the reply.

    • @cadillacescalade5428
      @cadillacescalade5428 7 месяцев назад +1

      ​@fairelectro HI, I got your sketch wrote word for word I scanned over it makes sure i wrote correctly
      The section above the void setup(){
      // Create the Player object
      DFRobotDFPlayerMini player didn't highlight in orange.
      I'm guessing not letting the code upload.
      Everything else is correct in the code
      Just the DFRobotDFPlayer player didn't highlight in( orange)

    • @fairelectro
      @fairelectro  7 месяцев назад

      Install library first for DFRobotDFPlayer player

    • @cadillacescalade5428
      @cadillacescalade5428 7 месяцев назад

      @fairelectro I have all the df mini library
      I have it just like you have it
      #include "DFRobotDFPlayerMini.h"
      If I include the library it's
      #include< DfRobotDFPlayerMini.h>
      So which way do I need it ?
      It's giving me an error to upload to uno.
      #include "DFRobotDFPlayerMini.h"
      #include "SoftwareSerial.h"

  • @AntonyIssaqS
    @AntonyIssaqS 8 месяцев назад +1

    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?

    • @cadillacescalade5428
      @cadillacescalade5428 7 месяцев назад

      HI. is your file song formatted to Mp3 ? If Not you need to set it to a file that the DF-Mini can read which would be 001 or 002 also make a sound folder to insert the file into.
      It should play.

  • @JayRioLasRocas
    @JayRioLasRocas 10 месяцев назад +1

    Your other video worked great for me, this one unfortunately not. Tested with a arduino nano. Does it work for arduino nano too or only on arduino uno?
    edit: works now on both nano and uno!!! THX

  • @walteravila4753
    @walteravila4753 7 месяцев назад

    How is your MP3 TF module light turning on?

  • @alexandercereno4098
    @alexandercereno4098 4 месяца назад +1

    Hi can someone help me, i follow the instructions but still no audio output i use dfplayer mini hw 247a and 8ohms speaker.

    • @fairelectro
      @fairelectro  4 месяца назад

      check wiring and check serial monitor what it shows.

  • @frgicmiasma4340
    @frgicmiasma4340 6 месяцев назад +1

    Hey, I followed the tutorial and it somewhat works, whenever I begin to play my uploaded music, it makes a scrating noise constantly. My teacher said it could be because the speaker cuts out and begins again because of the amount of electricity it gets. Can you help with this?

    • @fairelectro
      @fairelectro  6 месяцев назад

      Connect 3.7v battery with mp3 module. If problem not solved, use 1k resistor on RX pin of mp3 module.

  • @jacopotech
    @jacopotech Год назад +1

    great! can i also use a pair of earphones?

    • @fairelectro
      @fairelectro  Год назад

      Yes, you can use.

    • @jacopotech
      @jacopotech Год назад

      @@fairelectro can you make a tutorial on how to do it?

  • @juandavidhoyosbernate5435
    @juandavidhoyosbernate5435 7 месяцев назад +1

    Hi. i dont know why but it only plays around the first 3 seconds of the song.

    • @fairelectro
      @fairelectro  7 месяцев назад

      Which module you are using? DF player mini or MP3 tf 16?

    • @juandavidhoyosbernate5435
      @juandavidhoyosbernate5435 7 месяцев назад

      @@fairelectro df Player Mini. It now works well until I try to control it using Bluetooth. it seems to be a problem with serial communication

  • @keyurbhataria5406
    @keyurbhataria5406 Год назад

    I am using 8ohm 5W spekar, sound coming is very less, should i use Amplifier? If yes, then what type of Amplifier?

  • @honeybadger2371
    @honeybadger2371 11 месяцев назад +1

    Can i play long musics on it?

  • @johnpaulumpad2734
    @johnpaulumpad2734 2 месяца назад

    my speaker is 4 ohm 3 watts and i the response of the speaker is clicking sound or knocking sound what should i do?

    • @fairelectro
      @fairelectro  Месяц назад

      use 1k resistance on rx pin of mp3 tf module.

    • @johnpaulumpad2734
      @johnpaulumpad2734 Месяц назад

      @@fairelectro still not working man i dont know what to do i tried so many times

    • @johnpaulumpad2734
      @johnpaulumpad2734 Месяц назад

      @@fairelectro im using mp3 mini is stll gonna work? or ig thats the problem why isnt working

    • @fairelectro
      @fairelectro  Месяц назад +1

      @@johnpaulumpad2734 you are using df payer mini?

    • @fairelectro
      @fairelectro  Месяц назад +1

      @@johnpaulumpad2734 watch this video and resistance like this. ruclips.net/video/kZr0vfhMojM/видео.html

  • @walteravila4753
    @walteravila4753 7 месяцев назад +1

    How do I install the libraries?

    • @fairelectro
      @fairelectro  7 месяцев назад

      In arduino IDE, goto sketch > include library > manage library

    • @walteravila4753
      @walteravila4753 7 месяцев назад

      @@fairelectro Whn I'm in manage library, do I have to search for SoftwareSerial.h and DFRobotDFPlayerMini.h in the search bar?

    • @fairelectro
      @fairelectro  7 месяцев назад

      @@walteravila4753 Only search DFRobotDFPlayerMini in search box

  • @brayanpoloche7595
    @brayanpoloche7595 2 месяца назад

    what is de firs library

  • @rwincarreon
    @rwincarreon 7 месяцев назад

    hello, i uploaded the code and the speaker does not produce any sound

    • @fairelectro
      @fairelectro  7 месяцев назад

      connect battery to mp3 module.

  • @aizacraft0
    @aizacraft0 Год назад +1

    Good work👍

  • @walteravila4753
    @walteravila4753 7 месяцев назад +2

    What if I only hear a clicking sound?

    • @fairelectro
      @fairelectro  7 месяцев назад

      Use battery with DF player

    • @walteravila4753
      @walteravila4753 7 месяцев назад

      @@fairelectro Won't I need an amplifier for that? Or would it just be alright with the battery and DF player.

    • @fairelectro
      @fairelectro  7 месяцев назад

      @@walteravila4753 No need to use amplifier if you are using 3watt speaker

    • @fairelectro
      @fairelectro  7 месяцев назад

      @@walteravila4753 First of all check df player is working or not. watch this video ruclips.net/video/TIuCIYey_F0/видео.html

    • @gowrishankar7011
      @gowrishankar7011 6 месяцев назад

      Does it provide enough sound?

  • @cadillacescalade5428
    @cadillacescalade5428 7 месяцев назад

    Hello Good Morning my friend, could you possibly take a look at this code and tell me what I'm missing? Its not working all that great. and needing some help Not sure if i have it correctly.
    #include
    #include
    #include
    Servo myservo;
    int sensor1 = 5;
    int pos = 30;
    int swinging_started = 0;
    static const uint8_t PIN_MP3_TX = 10; // Connects to module's RX
    static const uint8_t PIN_MP3_RX = 11; // Connects to module's TX
    SoftwareSerial softwareSerial(PIN_MP3_RX, PIN_MP3_TX);
    // Create the Player object
    DFRobotDFPlayerMini player;
    void setup() {
    pinMode(sensor1, INPUT);
    myservo.attach(2);

    // Init USB serial port for debugging
    Serial.begin(9600);
    // Init serial port for DFPlayer Mini
    softwareSerial.begin(9600);
    // Start communication with DFPlayer Mini
    if (player.begin(softwareSerial)) {
    Serial.println("OK");
    // Set volume to maximum (0 to 30).
    player.volume(8);
    player.play(1);
    }else{
    Serial.println("Connecting to DFPlayer Mini failed!");
    }
    }
    void loop() {
    if ((digitalRead (sensor1)==HIGH)&& (swinging_started==0)) {
    swinging_started = 1;
    }
    if (swinging_started)
    if ((digitalRead (sensor1)==LOW)&&(swinging_started==1)) {

    for (pos = 30; pos = 30; pos -= 1)
    { myservo.write(pos);
    delay(15);
    }
    }
    }

    • @fairelectro
      @fairelectro  7 месяцев назад

      This code is uploading on Arduino or not? If this code is uploading, does the audio play once?

    • @cadillacescalade5428
      @cadillacescalade5428 7 месяцев назад

      @fairelectro HI, The code uploads fine it just has a bit of weakness when activating the sound.

    • @cadillacescalade5428
      @cadillacescalade5428 7 месяцев назад

      @fairelectro the Audio some times plays not every time the sensor crossed.

    • @cadillacescalade5428
      @cadillacescalade5428 7 месяцев назад

      @@fairelectro Can you help me with my code?

  • @Orledan
    @Orledan 6 месяцев назад

    Hey, how to adjust the volume in the code?

    • @fairelectro
      @fairelectro  6 месяцев назад

      you can set volume from volume function(0 to 30)