Garbage charcters using Blueotooth HC05

Hey dear community,
I am a futur embeded enginneer and I was working on an arduino project with hc05 bluetooth module when I had a serious issue with it.
I am using on one hand, an arduino UNO board with a HC05 bluetooth module connected to it and on another hand I am using HC05 Bluetooth Terminal APP,
In fact, the problem is that when I want to print a character sent by the Bluetooth terminal on arduino's serial monitor, I get garbage characters that don't even belong to the ASCII table.

Here is my code:

#include <SoftwareSerial.h>

//Declaration of variables:

SoftwareSerial Bluetooth(2,3);//the bluetooth object
//Bluetooth(RX_pin,TX_pin);
char c =' ';

void setup() {

Serial.begin(9600);
Serial.println("ready");
Bluetooth.begin(38400);
}

void loop() {
if(Bluetooth.available())
{
c = Bluetooth.read();
Serial.write(c);
}
if(Serial.available())
{
c = Serial.read();
Bluetooth.write(c);
}
}

Here is the display I have on the serial monitor:
image

And that happened when I sent the caracter 'c' from the HC05 Bluetooth terminal APP

Isn't software serial at 38400 a little ambitious?

1 Like

38400 is the AT mode baud rate. The default baud rate for HC05 communication mode is 9600. Did you change the communication mode baud rate?

1 Like

You are right, Indeed, 38400 BAUDS is little ambitious!
Thank you

Thank you for the tip!

No it isn't, 38400 in software serial should be fine. It is, after all, the standard baud rate for AT mode and, if that was a problem, everybody would know about it.. Your real problem may simply be that you failed to properly configure HC-05 to run at that rate.

Having said that, if you've got it all working OK, there is surely no point in changing the rate, but you shouldn't be deterred if you come across a device that requires you to use 38400.

38400 baud is the highest baud rate that I have been able to get reliable reception with software serial.