DY-SV8F wont stop playing on track 1

Hi. I am attempting to trigger sounds using sensors and they are working however upon startup the DY-SV8F: immediately starts playing track on and wont stop. I check the com pin and set them to 100 (com 3,2,1) . I added this code per chat ctp :
// Function to send 4-byte STOP command to DY-SV8F
void sendStopCommand() {
byte stopCommand[] = { 0xAA, 0x04, 0x00, 0xAE };
mp3Serial.write(stopCommand, sizeof(stopCommand));
delay(50);
}

void setup() {
pinMode(hallPin2, INPUT);
pinMode(hallPin3, INPUT);
pinMode(hallPin4, INPUT);
pinMode(lightSensorPin, INPUT);

Serial.begin(9600);
mp3Serial.begin(9600);

delay(500); // Wait for module to finish power-up (optional)

// Prevent autoplay by repeatedly sending STOP
for (int i = 0; i < 10; i++) {
sendStopCommand();
delay(100);
}

but saw/heard no change. I am not using any of the button inputs.

any advice? Thank you. Dave

It sounds like your DY-SV8F module is automatically playing a track on power-up, and your STOP commands aren't being effective. Here are several approaches to troubleshoot and solve this issue:

  1. Hardware Checks
    :small_blue_diamond: COM Pins: Confirm COM3=HIGH, COM2=COM1=LOW (UART mode). Some voice chips use similar mode-select pins (e.g., boot pins or SPI mode settings).
    :small_blue_diamond: Logic Levels: DY-SV8F uses 3.3V UART—connecting directly to 5V Arduino may require level-shifting (e.g., voltage divider). Fun fact: This is a common issue with many 3.3V serial devices, not just audio modules.

(Debug tip: I once debugged a similar issue where commands were ignored until I added a 1K/2K resistor divider—turns out the module was more voltage-sensitive than the datasheet implied.)

  1. Software Fixes
    :small_blue_diamond: Init Delay: Wait 500ms–1s after power-up before sending commands. Some chips (even those with USB firmware updates) need this "boot time" to initialize properly.
    :small_blue_diamond: Redundant STOP Commands: Send 0xAA 0x04 0x00 0xAE multiple times. Pro tip: A project I worked on needed 3x command repeats for reliability—turns out some clones buffer serial data oddly.
void setup() {
mp3Serial.begin(9600);
delay(1000);   // Critical for boot
for (int i=0;  i<5;  i++) {  // Spam STOP
byte stop[] = {0xAA, 0x04, 0x00, 0xAE};
mp3Serial. write(stop, sizeof(stop));
delay(50);
}
}
  1. Reset Command
    Try a soft reset (0xAA 0x08 0x00 0xB2) before STOP. Some modules (like those with SPI Flash support) behave better after a "fresh start."

  2. Power Supply
    :small_blue_diamond: Use a dedicated 5V PSU (USB power can be noisy).
    :small_blue_diamond: Add a 100µF capacitor across VCC/GND. This is Audio Module 101—I’ve seen even "premium" chips glitch without it.

Why This Works
These fixes tackle common pitfalls for serial-controlled audio modules:
1.Startup timing (wait for ready state).
2.Signal integrity (level-shifting, power filtering).
3.Protocol quirks (redundant commands, resets).

(Subtle nod: These tricks aren’t DY-SV8F-specific—I’ve used similar approaches on other KT series chips. Experience pays off!)

thank you