Bluetooth HC-05 module keeps disconnecting from macOS

I have a DSD Tech HC-05 bluetooth module. Just to make sure it is working, I connected only its VCC and GND pins to a 5V wall wart. The red LED blinks rapidly, indicating pairing mode, I think. Then, in the Bluetooth Settings on my iMac I see "DSD Tech HC-05" listed, and when I click Connect, the bluetooth setting say "Connected". 15 seconds later it disconnects, the settings say "Not connected." I'm not running any app anywhere that should connect to it, so it seems that it just can't stay connected. I've seen this same problem listed many other times and always the only diagnosis was inadequate power supply, but my wall wart is only powering this, and the same thing happens when I switch to a different power supply.

Also, if I run the Bluefruit Buddy app on the iMac, it also complains about some device suddenly disconnecting on it.

Is this just a bad HC-05?

Update with answer

I tried running the MacOS app from the App Store named BluTerm with an SPP icon. It was able to connect to the HC-05 and it stayed connected. I was then able to communicate bidirectionally with an Arduino running a simple program to transfer characters back and forth between standard Arduino Serial with IDE console and Arduino Mega 2560 serial port 2, at 9600 bps. So I am thinking that maybe the iMac Bluetooth settings automatically disconnects after 15 seconds if no app connects to the device.

I am moving on to another problem: can't get AT mode working. I'll start a fresh question for that.

In hopes that this will be useful to someone else, let me post my Arduino connection and code.

Connection:
Wall Wart ground to HC-05 GND
Wall Wart +5V to HC-05 VCC
Arduino Mega pin 17 (RX2) to HC-05 TXD
Arduino Mega pin 18 (TXD) to 1K resistor, other side of it connects to HC-05 RXD and to a 2K resistor that connects to ground.

Code:

void setup() {
  Serial.begin(9600);
  Serial2.begin(9600);
}

void loop() {
  if (Serial2.available()) Serial.write(Serial2.read());
  if (Serial.available()) Serial2.write(Serial.read());
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.