HC05 Bluetooth receiving but not sending

This is my first attempt at using Bluetooth. I've got it all wired up and I am using SoftwareSerial to use Serial2, and I'm using one of several Bluetooth terminal apps on my Android phone to test with. This is just a test program based on several of the examples I've seen out there. Note that I originally wired up the KEY and STATE pins to a digital output and input respectively, but very few of the examples I've seen use them, so I'm ignoring them for now and unhooked them (my FC-114 board actually says EN not KEY).

What I'm seeing (after fixing several other mistakes) is the BT is connecting, and I see the text on my phone being sent by the Arduino program, but when I send characters from my phone to the board over Bluetooth, the program never sees them.

Here is the essence of my program:

// Bluetooth on Serial 2
#define LBPIN_BTH_TX 16
#define LBPIN_BTH_RX 17
#define LBPIN_BTH_KEY 32
#define LBPIN_BTH_STATE 33
SoftwareSerial BluetoothHC05(LBPIN_BTH_RX, LBPIN_BTH_TX);
...
void setup() {
  BluetoothHC05.begin(9600);
  while(! BluetoothHC05) {
    Serial.println("Waiting for connect");
    delay(1000);
  }
  Serial.println("Connected");
  
  BluetoothHC05.println("Send 1 to turn on the LED. Send 0 to turn Off");
  //pinMode(LBPIN_BTH_TX, OUTPUT);
  //pinMode(LBPIN_BTH_RX, INPUT);
}
...
void loop() {
  Serial.println("Waiting");
  while (BluetoothHC05.available() == 0) {
    Serial.println(">");
    BluetoothHC05.println(">");
    delay(1000);
  }
  Serial.println("Got key");
  BluetoothHC05.println("Got key");
  Data = BluetoothHC05.read();
  if (Data == '1') {
    Serial.println("Got 1");
    BluetoothHC05.println("Got 1");
  }
  else if (Data == '0') {
    Serial.println("Got 0");
    BluetoothHC05.println("Got 0");
  }
  else {
    Serial.println("Unknown character");
  }
}

When I run this, on the Serial Monitor I see
Connected
Waiting

...

On the Bluetooth terminal in my phone, I see the > constantly being sent. But when I send the 1 or 0, with or without CR/LF, nothing happens on the Arduino.

I verified that TX on the HC05 is connected to RX2 and the RX is connected to TX2 with a multimeter. I see the indicator LED on the HC05 blink twice then long pause, which I've seen in videos, so I think that's expected.

So what else can I check?
Is there some common failure mode for being able to send from the HC05 but not receive?
Is it likely the board is damaged?

Thanks.

I verified that TX on the HC05 is connected to RX2 and the RX is connected to TX2 with a multimeter. I see the indicator LED on the HC05 blink twice then long pause, which I've seen in videos, so I think that's expected.

SoftwareSerial BluetoothHC05(LBPIN_BTH_RX, LBPIN_BTH_TX);

Why are you using SoftwareSerial on hardware serial pins? Use Serial2.begin(9600) and cross connect the module TX,RX to the Serial2 RX,TX as you describe.

You should use a voltage divider on the Arduino TX to HC05 RX to bring the voltage down to 3.3v from 5v.

Thank you cattledog! I see very few examples of using the HC05 with the Arduino which didn't use Serial0, which is clearly the WORST way to do it because you need to disconnect it to update the program. I didn't see ANY exampled using Serial1, Serial2, etc. so I was unaware of how to use them right. I do see it's documented at Serial - Arduino Reference Switching to Serial2 worked perfectly.

Similarly, very few of the examples I saw used a voltage divider to connect to HC05 RX. I found a great page with a full explanation at resistors - Why do you have to use a voltage divider with HC-05 bluetooth module? (Arduino) - Electrical Engineering Stack Exchange . Since this is a simple change, I'll implement it even though it's working without it.

Thank you again.

dj_segfault:
which is clearly the WORST way to do it because you need to disconnect it to update the program

No it isn't. Using hardware serial pins 0,1 means you can prove up your programme using the serial monitor. You don't even need a bluetooth to know it works. This can do wonders for beginners' confidence. Further, it avoids all the limitations of using Software Serial, i.e. speed, and clogging the system. Software Serial is the worst, and only for the desperate, the lazy, and the incompetent. So, boy, aren't you lucky to have a Mega.

Similarly, very few of the examples I saw used a voltage divider to connect to HC05 RX.

Google images of this are about 50/50 with and without. It is clearly good practice, but I have never heard of leaning 5v against Bluetooth Rx being fatal.

Done. I ended up having to mount it on a protoboard because just trying to attach the resistors to the wires got a bit tricky, but it will be more rugged that way anyway.

Thanks again.

picBT on clock shield small.jpg