MP3 Module, HC-05 Bluetooth and arduino uno

I will like to make a proyect connecting a MP3 Modulo a HC-05 Modulo Bluetooth and a Arduino Uno to have the capabiltie to play mp3 files using a smarthphone. Could you please tell me if exists a diagram or an example to achieve this proyect?. Thanks and best regards :slight_smile:

i follow you . i'm starting to do the same thing

Exactly what do you want to do.
Where are the MP3 files stored, on the MP3 module or the smart phone?

If it is the smart phone you will need some smart phone app to transfer the files first. If it is the MP3 module then you need some smart phone app to send a list of messages to determine what file is played.

This is not a simple project and is likely to prove unsatisfactory no matter what your solution.
The other question is why you want to do such a thing as it seems complex, why not just use a bluetooth speaker with your smart phone?

I done it. I am building a BB8 and the head will have some Leds, one RGB Led, a Bluetooth and a mp3 module. First, i bought this mp3 module "Geekcreit® dfplayer mini mp3 player module mp3 voice audio decoder board for supporting tf card u-disk io/serial port/ad Sale - Banggood.com". It is a very good mp3 player.

I connected the mp3 to the pin 5 and 6 of the arduino and the bluetooth to the 0 and 1. I will leave the code here: (It is VERY important to understand that arduino cannot "hear" both, the mp3 module and the bluetooth at the same time. We have to use "bluetoothh.listen()" or "speaker.listen()" to indicate which one to listen)

In my case i did develop an App (with android studio) to control my robot using the bluetooth. Everything work fine with this code.

Arduino Code

#include "Arduino.h"
#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"

SoftwareSerial speaker(5, 6); // RX, TX
DFRobotDFPlayerMini myDFPlayer;
void printDetail(uint8_t type, int value);
int intVolumen = 0;

int bluetoothTx = 0;
int bluetoothRx = 1;
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);

int pos = 0;

void setup() {
//Serial, speaker y Bluetooth
Serial.begin(9600);
bluetooth.begin(9600);
speaker.begin(9600);

speaker.listen();
//Establish the communication
if (!myDFPlayer.begin(speaker)) {
while(true);
}

myDFPlayer.setTimeOut(500);
myDFPlayer.volume(30); //(0~30).
myDFPlayer.EQ(DFPLAYER_EQ_NORMAL);
)

void loop() {
//Siempre se inicia escuchando el bluetooth
bluetooth.listen();

if (bluetooth.available() > 0 ){
pos = bluetooth.read();

//Put your code here
}
}

// Valid commands
//----Mp3 play----
myDFPlayer.next(); //Play next mp3
delay(1000);
myDFPlayer.previous(); //Play previous mp3
delay(1000);
myDFPlayer.play(1); //Play the first mp3
delay(1000);
myDFPlayer.loop(1); //Loop the first mp3
delay(1000);
myDFPlayer.pause(); //pause the mp3
delay(1000);
myDFPlayer.start(); //start the mp3 from the pause
delay(1000);
myDFPlayer.playFolder(15, 4); //play specific mp3 in SD:/15/004.mp3; Folder Name(1~99); File Name(1~255)
delay(1000);
myDFPlayer.enableLoopAll(); //loop all mp3 files.
delay(1000);
myDFPlayer.disableLoopAll(); //stop loop all mp3 files.
delay(1000);
myDFPlayer.playMp3Folder(4); //play specific mp3 in SD:/MP3/0004.mp3; File Name(0~65535)
delay(1000);
myDFPlayer.advertise(3); //advertise specific mp3 in SD:/ADVERT/0003.mp3; File Name(0~65535)
delay(1000);
myDFPlayer.stopAdvertise(); //stop advertise
delay(1000);
myDFPlayer.playLargeFolder(2, 999); //play specific mp3 in SD:/02/004.mp3; Folder Name(1~10); File Name(1~1000)
delay(1000);
myDFPlayer.loopFolder(5); //loop all mp3 files in folder SD:/05.
delay(1000);
myDFPlayer.randomAll(); //Random play all the mp3.
delay(1000);
myDFPlayer.enableLoop(); //enable loop.
delay(1000);
myDFPlayer.disableLoop(); //disable loop.
delay(1000);
//----Read imformation----
Serial.println(myDFPlayer.readState()); //read mp3 state
Serial.println(myDFPlayer.readVolume()); //read current volume
Serial.println(myDFPlayer.readEQ()); //read EQ setting
Serial.println(myDFPlayer.readFileCounts()); //read all file counts in SD card
Serial.println(myDFPlayer.readCurrentFileNumber()); //read current play file number
Serial.println(myDFPlayer.readFileCountsInFolder(3)); //read fill counts in folder SD:/03
*/