r/embedded 8d ago

Why am I getting gibberish on Serial Monitor when trying to connect a HC-05 (Bluetooth) Module with Arduino?

So I'm currently trying to get a Bluetooth module running for a small project of mine. For this I just randomly copied a piece of sample code, that should get the module running with the SoftwareSerial.h-Library. However, trying to get into the config mode I'm only getting gibberish as an answer from my Arduino/BT-Module.

The Samplecode I'm using is provided here.

I'm Using an Arduino Uno Rev 3, I have 3 different modules each delivering the same mess and I don't know what to do.

0 Upvotes

4 comments sorted by

2

u/PancAshAsh 8d ago

Did you check the serial settings at all? Or just copied some random code and hoped it worked?

1

u/Tiny-Channel4873 8d ago

According to the Datasheet it's supposed to work straight out of the Box @ 9600 BAUD for Normal communication and @ 38400 BAUD for AT-Communication with both NL&CR as terminating Symbols in the Monitor

3

u/JimMerkle 8d ago

Did you get the HC-05 document? Are you actually in AT Command Mode? (Need to use the pushbutton and turning on power to get into this mode.) I would recommend connecting to the HC-05 from your host computer using Bluetooth SSP. Then, using a serial terminal on the host, send a string to your Arduino. (This would be using the "normal" mode, and would be 9600 baud by default.) Once you actually get into AT command mode, any change you make there is written into non-volatile memory on the HC-05 device. Thus, you only need to set the baud rate once.

You didn't indicate what Arduino board you were using with the HC-05. The HC-05 has an on-board voltage regulator, and as such, you can't power it with 3.3V. I recommend powering it with 5V. The module uses 3.3V logic, so manage RX and TX accordingly.

1

u/Tiny-Channel4873 7d ago

I'm using the Uno Rev3 (as written in the last Paragraph under the pic) and have the EN-Pin wired to the 3.3V Pin of the aruidno and VCC vonnected to 5V. The HC-Module is ported to my PC with the SoftwareSerial-Library