Interfacing of Df player and hx711

Dear all,
I am facing the issue during one of my project, I tried to intefacing the Mini df player and HX711 at one time to the arduino uno but, its not working, when i check it by using serial monitor it stuck on one point which is after printing version of hx711.
i am going to upload the full code and serial monitor window. Please help to find the problem.
Here the full code :

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


HX711 scale;

uint8_t dataPin = 6;
uint8_t clockPin = 7;

float weight =0;

SoftwareSerial mySoftwareSerial(10, 11); // RX, TX
DFRobotDFPlayerMini myDFPlayer;
void printDetail(uint8_t type, int value);

int output;
int button=4;
//---------------------------------------------setup of pins and fuction of arduino -----------------------------------------------------------------------------
void setup()
{
  mySoftwareSerial.begin(9600);
  Serial.begin(115200);
  
  Serial.println();
  Serial.println(F("DFRobot DFPlayer Mini Demo"));
  Serial.println(F("Initializing DFPlayer ... (May take 3~5 seconds)"));
  // -----------------------------------------------------------------------------------------------------------------------------------------------------------
  Serial.println(__FILE__);
  Serial.print("HX711_LIB_VERSION: "); 
  Serial.println(HX711_LIB_VERSION);
  Serial.println();

  scale.begin(dataPin, clockPin);
  scale.set_scale(420.0983);   
  //  reset the scale to zero = 0
  scale.tare(20);
  // -------------------------------------------------------------------------------------------------------------------------------------------------
  if (!myDFPlayer.begin(mySoftwareSerial)) {  //Use softwareSerial to communicate with mp3.
    Serial.println(F("Unable to begin:"));
    Serial.println(F("1.Please recheck the connection!"));
    Serial.println(F("2.Please insert the SD card!"));
    while(true){ //loop 1
      delay(0); // Code to compatible with ESP8266 watch dog.
    }
  }
  
  Serial.println(F("DFPlayer Mini online."));

int sensor=A0;
pinMode(sensor,INPUT);
digitalWrite(sensor,LOW);
    // Set volume to maximum (0 to 30).
myDFPlayer.volume(5);  
myDFPlayer.volume(30);
    // Play the first MP3 file on the SD card
myDFPlayer.loop(2);

}
//----------------------------------infinite loop  ------------------------------------------------------------------------------------------------------------------
void loop() {
  // -----------------------------------------------------------------
    if (scale.is_ready())
  {
    Serial.println(scale.get_units(1));
    weight = scale.get_units(1);
    delay(100);
  
  if(weight > 30 || weight <-30){
    Serial.println("Doctor pressed the jaw !!!");
    Serial.println(weight);
    Serial.println(" Now patient is safe");
      myDFPlayer.stop();
  }
  weight=0;
  }
  // ------------------------------------------------------------------------------------
if(output==0){
  myDFPlayer.play(1);
  while(output!=1){
//    Serial.println("sensor detected");
    output=sensor();
  }
}else{
  myDFPlayer.play(1);
  while(output!=0){
//  Serial.println("sensor not detected");
  output=sensor();
  }
}

if (myDFPlayer.available()) {
    printDetail(myDFPlayer.readType(), myDFPlayer.read()); //Print the detail message from DFPlayer to handle different errors and states.
  }
}

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//-----Function for flex sensor detection- ----------------------------------------------
int sensor(){    //function for sensor detection
int fsrAnalogPin = 0; // FSR is connected to analog 0
int fsrReading;      // the analog reading from the FSR resistor divider
int output =0;
  fsrReading = analogRead(fsrAnalogPin);
  // delay(600);
  Serial.println(digitalRead(button));
  Serial.print("Analog reading = ");
  Serial.println(fsrReading);

  if(fsrReading<200){
    output=0;
    }else{
      output=1;
      }
  return output;
}
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

//Other Error and function of DF player notifications......

void printDetail(uint8_t type, int value){
  switch (type) {
    case TimeOut:
      Serial.println(F("Time Out!"));
      break;
    case WrongStack:
      Serial.println(F("Stack Wrong!"));
      break; 
    case DFPlayerCardInserted:
      Serial.println(F("Card Inserted!"));
      break;
    case DFPlayerCardRemoved:
      Serial.println(F("Card Removed!"));
      break;
    case DFPlayerCardOnline:
      Serial.println(F("Card Online!"));
      break;
    case DFPlayerUSBInserted:
      Serial.println("USB Inserted!");
      break;
    case DFPlayerUSBRemoved:
      Serial.println("USB Removed!");
      break;
    case DFPlayerPlayFinished:
      Serial.print(F("Number:"));
      Serial.print(value);
      Serial.println(F(" Play Finished!"));
      break;
    case DFPlayerError:
      Serial.print(F("DFPlayerError:"));
      switch (value) {
        case Busy:
          Serial.println(F("Card not found"));
          break;
        case Sleeping:
          Serial.println(F("Sleeping"));
          break;
        case SerialWrongStack:
          Serial.println(F("Get Wrong Stack"));
          break;
        case CheckSumNotMatch:
          Serial.println(F("Check Sum Not Match"));
          break;
        case FileIndexOut:
          Serial.println(F("File Index Out of Bound"));
          break;
        case FileMismatch:
          Serial.println(F("Cannot Find File"));
          break;
        case Advertise:
          Serial.println(F("In Advertise"));
          break;
        default:
          break;
      }
      break;
    default:
      break;
  }
}

do the modules work stand alone?
did you check your wiring (twice)?
please post the output as text

Yes, module work stand alone.
Yes i checked the wiring,

here output in text:
���&f �MN �
DFRobot DFPlayer Mini Demo
Initializing DFPlayer ... (May take 3~5 seconds)
C:\Users\admin\Desktop\Verve medi simuhub\Jaw Trust coding testing\Jaw_and_rise_tube_code\Jaw_and_rise_tube_code.ino
HX711_LIB_VERSION: 0.5.2

Unable to begin:
1.Please recheck the connection!���&f �MN �
DFRobot DFPlayer Mini Demo
Initializing DFPlayer ... (May take 3~5 seconds)
C:\Users\admin\Desktop\Verve medi simuhub\Jaw Trust coding testing\Jaw_and_rise_tube_code\Jaw_and_rise_tube_code.ino
HX711_LIB_VERSION: 0.5.2

Unable to begin:
1.Please recheck the connection!
2.Please insert the SD card!
2.Please insert the SD card!

So it is the DFplayer that is complaining as it cannot execute the begin() properly

try to set all parameters manually e.g.

if (!myDFPlayer.begin(mySoftwareSerial, false, true))

1 Like

I don't have an HX711so cannot try reproducing your problem. Can you minimalise it so that it's essentially using only your DFR Player code, but still exhibiting the problem?

BTW, you have two contradictory setting for volume.

Thanks for your help, I found the issue. I just directly connected the RX pin of DF player to pin no 10. after adding a 1K resistance its works properly.