HC-05 AT Commands - No OK - Retun with foreign charaters

Hello eveyone,

Brand new Arduino user. I've spent some time searching the forums for an answer or solution to my special case. ( because I am not able to find anyone with the same issue)

Issue: HC-05 not connected. Uploaded Sketch for HC-05. Open serial monitor, AT CommandS MODE displays, type AT and press send. return with xxxx?x or quivelant. the characters returned are different with different baud rates. so I know its communicating. Also notice the builtin LED goes DIM after upload.

Hardware:
Adruno UNO R3
HC-05 ZS-040 BT Module
**Wired up with the common schematics I found; 1K & 2K ohm resistors. 2K from ground wire to 1K and RX wire Verified connection with Ohmmeter (module disconnected) 1.01 ohm on the RX wire.

Software:
Windows 10 up to date.
Arduino IDE 1.8.13(windows store 1.18.42.0)

/*
HC05 - Bluetooth AT-Command mode
modified on 10 Feb 2019
by Saeed Hosseini
https://electropeak.com/learnfarsi/guides
*/
#include "SoftwareSerial.h"
SoftwareSerial MyBlue(0, 1); // RX | TX
void setup()
{
Serial.begin(9600);
MyBlue.begin(38400); //Baud Rate for AT-command Mode.
Serial.println("AT commands mode");
}
void loop()
{
//from bluetooth to Terminal.
if (MyBlue.available())
Serial.write(MyBlue.read());
//from termial to bluetooth
if (Serial.available())
MyBlue.write(Serial.read());
}

I've uploaded the blink sketch, changed the blink rate few times to concur communication.

I've looked at my laptop's ports settings, changed them, 9600 - 115200 etc. even searched for the Arduino USB driver.

My last thought, ans will need assist, is the baud rate for the Arduino board? during one upload i noticed the comment, overidding baud rate 115200.

THank you everyone. looking forward to hear everyones thoughts.

Here's one way to troubleshoot

Connect Bluetooth TX to Arduino TX
Connect Bluetooth RX to Arduino RX

Put the Arduino in RESET (connect RESET PIN to GND via a 10K resistor). In this manner, you can talk directly to the Bluetooth from your Arduino USB COMM connection. You can then change the baud to whatever the Bluetooth requires, and use PUTTY or RealTerm to talk AT to it. You can then verify the baud rates are correct and do some connectivity test from there.

Assuming that you have copied it correctly, the code is immediately identifiable as junk, be it in English or Farsi, and you may well conclude that everything else in the link is too. Using software serial on pins 0,1 ( the hardware serial pins) is a recipe for disaster.

This does not mean you have done any permanent damage - just don't do it again!

First thing to do is ensure that you really need to use AT mode??? Quite likely not, therefore don't bother. If you do, either

  1. Use other pins for software serial OR
  2. leave Bluetooth where it is and use hardware serial to talk to it.

The above depends on what you want to use Bluetooth for. As far as AT mode baud rate is concerned, there is only one - 38400. For communications there is either

  1. the default baud rate - 9600 or
  2. the baud rate you have configured it to use by the relevant AT command, which I bet you haven't done, so 9600 it is.

You might find the following background notes useful.

Thank you hzrnbgy and Nick_Pyner!

First, I failed to include that I am adding the HC-05 to my CNC along with android GRBL Controller App
(so I can remove the 20ft USB cable (for power/GCode) in case of an emergency))

Moving on.

Hzrny: I honestly didnt try your reccommedation. When I saw Nick_Pyners response I saw the flipping light! no pun intended :slight_smile:

Basically, once I changed the pins from 0,1 for RX/TX to 2, 3 in the sketch and re-uploaded, I received the OK response!

What I was doing wrong was literally using the pins Identifed in the Sketch (2,3) as the TX/RX pins. Not the actual TX/RX pins on the board.

I Powered up the Arduino with the HC-05 using a wall charger (5v/9v/12v type), connected BT and opened App, Voila! ( no grayed out functions)

Issue resloved.

Please accept my apology, and I don't mean to offend, just coming off of a weeks worth of frustration.

If there are any other suggestions regarding the use of an HC-05 for a CNC Plasma machine with a portable Controller (all inside a Pelican Case), I'm all ears! :slight_smile:

Happy new year!

tmiit71:
I'm all ears! :slight_smile:

That's good. You probably didn't need AT mode, and probably didn't need software serial either, but I imagine 9600 baud is OK for your CNC, so there is no need to change anything.

Thanks Nick!

As of this writing, i am fully wireless using a laptop with UGS! Ran a few files without a problem!

I just want to say, even though a short post, you (eveyone) helped me alot and in the future.

Happy new year.