2

Please be gentle with me. I am attempting to modify the configurations of my HC-05 bluetooth module by using the AT command set. The method by which I'm trying to do this is by implementing the following connection:

HC-05 GND --> Arduino GND; HC-05 3.3v --> Arduino 3.3V; HC-05 TX --> Arduino Pin 10; HC-05 RX --> Arduino Pin 11; HC-05 KEY --> Arduino Pin 9

enter image description here

This is the code which I uploaded to my Arduino (btw my arduino uno is an SMD clone): (code's from http://www.instructables.com/id/Modify-The-HC-05-Bluetooth-Module-Defaults-Using-A/step2/The-Arduino-Code-for-HC-05-Command-Mode/)

#include <SoftwareSerial.h>

SoftwareSerial BTSerial(10, 11); // RX | TX


void setup() {
  pinMode(9, OUTPUT);  // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode
  digitalWrite(9, HIGH);
  Serial.begin(9600);
  Serial.println("Enter AT commands:");
  BTSerial.begin(38400);  // HC-05 default speed in AT command more

 }

void loop() {
  // Keep reading from HC-05 and send to Arduino Serial Monitor
  if (BTSerial.available())
    Serial.write(BTSerial.read());

  // Keep reading from Arduino Serial Monitor and send to HC-05
  if (Serial.available())
    BTSerial.write(Serial.read());

}

The problem is I can't seem to activate the AT mode. I don't get any response from the Serial Monitor whatever AT command I try. I double-checked the wiring and it's all good. I can't figure out what the problem is.

  • I have one question, I was told that you need to reduce the voltage of the Rx pin (pin 2) to 3.3V, otherwise it would have some problems because the Arduino's voltage on pin 11 is 5 V. Does it work in your case? – user17217 Feb 10 '16 at 13:53
  • Yes it works fine. My HC05 is not experiencing any problems. Besides, the Rx pin is a serial pin and it is usually wired directly to the Tx pin of the arduino (which produces pulses of 5V) to make serial communications between the board and the hc05, so I don't think you should reduce it to 3.3V. The rx pin might not be able to read the serial data if the pulse level is reduced. – DorkOrc Feb 18 '16 at 2:08
1

After 3 hours I magically solved my pretty simple problem myself. If you wired the HC-05 and arduino correctly, the module should indicate that it's in AT Mode by blinking the LED in an interval of 2 seconds. You should get response in the Serial Monitor by typing the AT commands by switching from "No line ending" to "Both NL and CR". That's about it.

-1

In setup() put pin 9 to low, and delay it for about 1 second and then put it to high.

  • Can you explain how this solves the problem? As written it sounds like a "magic solution" with no explanation about why it works. – Nick Gammon Apr 13 '17 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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