0

I just purchased some HC-05 Bluetooth devices and I have followed the directions to put the devices in AT command mode by holding EN HIGH when the HC-05 powers up. When I do this the HC-05 goes into the "slow blink" to indicate it is in command mode. However, when I send it "AT" I get odd characters in the response.

Note that when I type "AT" I get exactly 4 characters back. They are just not the "OK" characters I expect. I also verified that the Arduino IDE serial console is sending both NL and CR characters.

BTW, here is the Mel Patrick HC-05 authored setup program I am running:

https://raw.githubusercontent.com/dmccreary/coderdojo-robots/master/src/bluetooth-remote/hc-05-setup/hc-05-setup.ino

HC-05 serial problem

It has been suggested that the data from the HC-05 is only going up to 3.3v and that might be the cause of the problem, since the Arduino is looking for a 0-5 volt signal.

I also note that when I remove the TDX line from the HC-05 that no responses come back. So I suspect that it is getting the "AT" fine through the RTX from the Arduino to the HC-05. It is just some problem in the return data format.

Is there a simple transistor circuit I can hookup to shift the levels back to 0 to 5 volts from the 0 to 3.3 volts?

I am also using an Arduino Nano if that makes any difference.

Thanks - Dan

5
  • How is it wired? Are you using hardware of software serial? Do you have it set at the right baud rate?
    – Majenko
    Commented Mar 20, 2016 at 15:59
  • I have wired the RTX and TDX connections correctly and I have set the correct baud rates. I have another one with similar connections working fine now, but I still don't understand why this device is failing. I have three theories. 1) The defaults were set wrong in this device and got changed back on reset, 2) or the voltages levels were not working.or 3) I have a bad wire... Commented Mar 20, 2016 at 16:49
  • Here is the current dialog: HC-05 BlueTooth Programmer 1. AT test a. Set Device Name (a,name) 2. Version b. Set Role (b,0) 3. Address c. Set Password (c,1234) 4. Name d. Set UART (d,Baud,Stop,Parity) 5. Role m. Display this menu 6. UART 7. State 8. Password 9. Device Reset Blue is what I typed: 1 OK 2 OK +VERSION:2.0-20100601 3 OK +ADDR:98d3:31:fb1d15 4 OK +NAME:t 5 OK +ROLE:0 6 OK +UART:38400,0,0 7 OK +STATE:INITIALIZED 8 OK +PSWD:1234 OK a,DAN_ROBOT_1 OK 4 +NAME:DAN_ROBOT_1 OK Commented Mar 20, 2016 at 16:51
  • are setting the serial monitor to 38400 baud? it s the default speed of AT mode Commented Mar 21, 2016 at 14:57
  • Strange char in serial monitor cames in 90% of the case from a difference in speed between the Arduino and the Serial Monitor. In order to have a correct display Arduino (so Serial.begin), Serial Monitor and the HC have to use the same speed. I think as other replied, default speed is 38400. But, TAKE CARE: as soon as yo change the speed (eg if you change it to 9600), you have to change it on the Arduino and Serial Monitor.
    – Peter
    Commented Feb 8, 2018 at 21:22

6 Answers 6

1

If you use software serial for Bluetooth, you need to set the baud rate and the default baud rate of HC-05 is 38400.

You can change this baud to the desired with AT command.

1
  • This is a comment, not an answer. May I suggest that you flesh out this answer to show exactly how to do these things?
    – SDsolar
    Commented Apr 13, 2017 at 18:18
0

Try setting your baud at 38400. Connect Tx->Tx & Rx->Rx when configuring your module. Tx->Rx & Rx->Tx during execution.

2
  • Why do you need to swap the connections over? Commented Mar 21, 2017 at 12:58
  • I think WaldoK is confused by the fact that, if you connect something on TX/RX on the Arduino, you can't upload the sketch. So maybe he thinks he has to swap the connections when in fact he just need to disconnect while uploading.
    – Peter
    Commented Feb 8, 2018 at 21:19
0

Is there a simple transistor circuit I can hookup to shift the levels back to 0 to 5 volts from the 0 to 3.3 volts?

Yes there are level shifting circuits you can use, resistor dividers and all that stuff, but you will be better off using a proper level shifting circuit, something like this:

Level Shifter

I believe there is something to do with the speed of switching between high and low and getting crisp rise and falls of the signal.

0

Set Baud rate to 38400 in serial monitor.

If you have Arduino UNO with removable Atmega328p - then remove the chip and connect TX of HC05 to TX of Arduino and RX to RX.

Most of the HC05 works perfectly with 5V system (I have one here hooked up to 5V and RX,TX connected directly ( without level shifter) but it's not recommended.

0

If you are indeed receiving something after the AT command, that means you have the baudrate wrong. Change it from the serial monitor to 38400 or something else.

0

My experience with these units...

  1. BAUD rate varies so try them all.
  2. Some expect chars in caps and some don't care
  3. Some expect a question mark after the command and some don't e.g AT?
  4. Some require CR and some don't.
  5. Some only stay in AT mode for a second on boot and thus I found I had to set it up in steps, e.g write program to set PIN, then another to set NAME and so on..

Reason for this is that many clones do not have full software and commands installed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.