Barcode scanner + HC-05 bluetooth module not working together

I am currently trying to combine a barcode scanner and the HC-05 bluetooth module to send data to my phone.

I have both parts working independently, however when I try to put them together I have a problem.

I have the barcode scanner set up so, that it wakes when I press a button.

As soon as I press the button, the HC-05 bluetooth module (using 3.3 V) will simply turn off and stay off until I reset the power source.

I also tried this with an HC-06 with the same result. (Except that this one turns on again after a few seconds but only into pairing mode)

I have also tried it on both an arduino Nano and an arduino Uno without success.

The barcode scanner is using 0.3 mA in sleep mode and <90 mA in operating mode. (Using 3.3 V)

Am I doing something wrong? What could be the issue here?
I have the feeling it is the change in current from the barcode scanner that turns the HC-05 module off. But I am not sure how to fix this.

Any ideas?

A schematic of your connections and the code that fails would help us to help you. Otherwise we waste time guessing. What is the power source?

Here the code I am currently using (with the HC-05 connected to pin 0 and 1).

#include <SoftwareSerial.h>


const int interruptPin  = 2;


bool barCodeScannedFlag = false;
SoftwareSerial barCodeSerial(8, 7); // RX, TX


void setup(){

	Serial.begin(9600);
	barCodeSerial.begin(9600);
             
	pinMode(interruptPin, INPUT);
  attachInterrupt(digitalPinToInterrupt(interruptPin), barCordScanned, FALLING);

}



void loop(){

	if (barCodeSerial.available()) {
    Serial.write(barCodeSerial.read());
  }

  
	if(barCodeScannedFlag){

		
		barCodeScannedFlag = false;
	}
}


void barCordScanned(){
	if(!barCodeScannedFlag)  barCodeScannedFlag = true;
}

Alternatively I tried connecting it to the digitial pins with Software serial with the same problem.

SoftwareSerial BTSerial(10, 11);
BTSerial.begin(9600);
BTSerial.print(sensor_result);

Again, both - the scanner and the HC-05 module work fine when I don't hook them up together.

Even if I have the barcode scanner in sleepmode connected together with the HC-05 I am able to connect it to my phone. Only when I press the button the HC-05 module will turn off.

Any ideas what might be the issue? And how to fix it?

I have the feeling it might be the current spike from 0.3 mA to <90 mA that triggers the shutdown? (The arduino nano stays on, only the HC-05 module turns off)

Or could it be an issue in the code? Maybe

attachInterrupt

?