I built a circuit that plays MP3 files and is controlled by an Arduino. I assembled the circuit on a breadboard, and it worked, but when I fabricated a PCB, the circuit failed. The problem is that the built-in LED of the Arduino blinks, and it doesn't respond.
As an MP3 player, I am using the DFPlayer. It has a sleep function, but it still consumes about 20mA, which is too much for my battery application, so I decided to power it via a P-channel MOSFET controlled by the Arduino. The complete circuit is shown here:
I used a 7805 voltage regulator to regulate the voltage to 5V. The input voltage I provided to the 7805 during testing was a power supply (9-24V). Pin 12 of the Arduino should control the MOSFET, and when it goes low, the MOSFET should conduct, and the DFPlayer should be powered on. Pin 12 goes low when the button on pin 2 is pressed. The MOSFET I used is a logic-level enhancement MOSFET, NDP6020P, which is already obsolete, but I had one in my box, so this is the one I used. The communication of the DFPlayer and the Arduino happens through pins 10 and 11. There's a resistor in the T_x branch because this is specified in the DFPlayer schematics (see the link above).
My PCB is a 4-layer PCB. The middle layers are GND and Vcc planes. The outer layers look like: I apologize that it's a bit messy. Just in case it's too complex, I also included the schematics from the software, which should be the same as the schematics I uploaded above:
When I connect both the Arduino and the DFPlayer to my PCB, the built-in LED of the Arduino blinks and it doesn't respond. When I remove the DFPlayer from the PCB, the LED stops blinking and the Arduino responds (say, lighting a led). To troubleshoot, I wrote a simple Arduino sketch that should make pin 12 go HIGH and LOW every second:
void setup() {
pinMode(12, OUTPUT); // Set the pin as an output
}
void loop() {
digitalWrite(12, HIGH); // Set the pin HIGH
delay(1000); // Wait for the specified interval
digitalWrite(12, LOW); // Set the pin LOW
delay(1000); // Wait for the specified interval
}
It didn't work, however, as pin 12 remained constantly HIGH. Here are the things I tried during my debugging process:
(This was done with my actual sketch and not the test sketch) Shorting V_cc of the DFPlayer to V_cc of the circuit. In this case, the built-in LED stopped blinking, but when I pressed the button to change pin 12 to LOW and start conductivity in the MOSFET, the built-in LED started blinking again, and nothing happened.
Nothing changes when I manually connect the GND of the Arduino and the DFPlayer.
I measured the 7805 voltage, and it's a steady 5V.
If you have any ideas as to where the problem could be or more tests that should be done, I will try them. I would appreciate your help.
Best