dfplayer, amplifier, arduino uno circuit is not working. I connected rx of df player with 1k resistor on arduino uno's tx(3). I connected rx(2) of arduino directly to tx of dfplayer. I set up a common gnd and 5v line for arduino, df player and amplifier. I connected DAC_R pin of df player to R pin of amplifier, DAC_I pin to L pin of amplifier. I connected T pin of amplifier to common gnd line. I also connected speaker connections to OUT outputs of amplifier. But I did not get any result other than hissing coming from speaker.Please help me
Show your code and a photo of your project. Your description might be correct, but does not follow known, working configurations. Have a look at this and verify your connections.
rx tx connections were compatible with the code in my circuit. I said it wrong in the description. Here is the code:
#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"
// Use pins 2 and 3 to communicate with DFPlayer Mini
static const uint8_t PIN_MP3_TX = 2; // Connects to module's RX
static const uint8_t PIN_MP3_RX = 3; // Connects to module's TX
SoftwareSerial softwareSerial(PIN_MP3_RX, PIN_MP3_TX);
// Create the Player object
DFRobotDFPlayerMini player;
void setup() {
// 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(20);
// Play the first MP3 file on the SD card
player.play(1);
} else {
Serial.println("Connecting to DFPlayer Mini failed!");
}
}
void loop() {
}
Never connect multiple components together and then test them. If the circuit fails to work, you will not know if that is because one or more of your components is faulty or because your wiring or code is faulty.
Start by testing the MP3 player in isolation. Connect it to 5V and ground and connect a small speaker directly to it's 2x SPK pins. Insert your SD card. Connect a wire from ADKEY0 and touch the other end of the wire to ground. This should trigger playback and you should see the blue led light.
If that works correctly, disconnect the small speaker and connect your amplifier module and speakers. Touch ADKEY0 to ground again to test the amplifier.
Finally, connect the Rx & Tx to the Arduino pins and test a simple example code from the DFplayer library.
actually.this circuit is a test project ,i want to add audio to my main project
Obviously need your sketch, but meanwhile I recommend you change your Uno RX/TX pair to avoid 2/3. These can occasionally cause problems because of their use for interrupts. I usually use either 10/11 or 8/9.
I did what you said sir. I connected the IO2 pin (ADKEY0) to the gnd line and the song played. Thank you very much.Do you see any mistake in the code? I will try with rx tx pins and amplifier.Also i have just one speaker.
if it doesn't work, i will try them.Thanks for it
When you have tested the amplifier with ADKEY0 method and then tested with Arduino connected using example code for DFplayer, it will then be time to look at your code.
which pins i should connect to amplifier from df player? i
You would connect the DAC_L, DAC_R and ground.
i connected dacr and dacl pins to R and L pins of amplifier.And i changed speakers + and - pins to amplifiers out pins.i connected amplifier's T pin to gnd .It didn't work
df player is working .the Amplifier is not working.
DAC_L, DAC_R - bad?
SPK_1, SPK_2 good?
i will make it without amplifier.
Maybe the connection to your amplifier is not correct, or the amplifier needs a different signal?
which pins that i should connect instead of dacr and dacl to df player
L, R, GND
Does your amplifier accept this input (from the DFPlayerMini page)
DAC - 24 -bit DAC output, support for dynamic range 90dB , SNR support 85dB
[edit]
From the DFPlayerMini page
// myDFPlayer.enableDAC(); //Enable On-chip DAC
how should i connect without amplifier,arduino uno to dfplayer ?
I/O Mode. You just did that in post #14