Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Using AT Command on HC06 bluetooth and arduino.

Status
Not open for further replies.

Marceleo M

New Member
Hello, I tried many ways from internet that i could find to use AT command for changing the baud rate of HC06 bluetooth but nothing seems to work. Can anybody show me the right way? im120710006_8.jpg I use this type of bluetooth module and a Arduino UNO. Thanks.
 
I'm no programmer, but doesn't this code (from the second link in post #2) set the baud rate?
Code:
void setup()  {
  bluetooth.begin(9600);
 
Again, easy with google :D

https://42bots.com/tutorials/hc-06-bluetooth-module-datasheet-and-configuration-with-arduino/

Code:
    One of the more useful attributes is the Bluetooth baud rate. You can set that by sending a command like AT+BAUD4, where the last number (4 in this case) is defining the rate as follows:

AT+BAUD1———1200
AT+BAUD2———2400
AT+BAUD3———4800
AT+BAUD4———9600 (Default)
AT+BAUD5———19200
AT+BAUD6———38400
AT+BAUD7———57600
AT+BAUD8———115200
AT+BAUD9———230400
AT+BAUDA———460800
AT+BAUDB———921600
AT+BAUDC———1382400

If you enter AT+BAUD4 you should receive a response OK9600.

Why do you want to change the baud rate anyway?.
 
I configured my HC05 and HC06 Bluetooth modules by just using the USB to serial interface on the Arduino Uno board.
These are the instructions.

Using the Arduino Uno to configure an HC05 Bluetooth module.


Either remove the ATMEGA328P or program it with this sketch which will not enable the TX pin on the ATMEGA328P. (It just runs a tight loop doing nothing.)


Connect the RX pin on the Aduino board to the RX on the HC05 module via a potential divider consisting of a 5K6 resistor from the RX pin on the Arduino and a 10 K resistor to ground. NOTE Connecting the RX pin to the RX pin seems strange but the RX pin on the Arduino board is actually the TX pin on the ATMEGA16U2. (Used as a USB to serial converter.)

Connect the TX pin on the Arduino to the TX pin on the HC05 together with a 3.3 volt zenner to ground. (+ to TX pin - to ground.)


In the Arduino window click on the "Tools" dropdown box and select "Serial monitor"

In the "serial monitor window" set the baud rate to 38400 bauds. In the box to the left of the baud rate box select "Both NL & CR"
Type the required AT command in the send window then click send.
You will see the response in the main part of the serial monitor window.

NOTE The baud rate for AT commands is always 38400


Link to HC05 data on Dropbox. **broken link removed**

Edit
After entering this post I remembered that I had a problem with the HC06 modules. I found that typing in a command manually does not seem to work.
Type the command into notepad etc then copy and paste it into the terminal program. The HC-06 seems to need all the characters of the command to be sent very quickly.

Les.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top