3

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.

Thomas S.
5663 gold badges8 silver badges21 bronze badges
asked Oct 18, 2015 at 12:09
2
  • 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? Commented Feb 10, 2016 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. Commented Feb 18, 2016 at 2:08

2 Answers 2

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.

answered Oct 18, 2015 at 17:16
-1

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

gre_gor
1,6824 gold badges18 silver badges28 bronze badges
answered Apr 13, 2017 at 10:30
1
  • Can you explain how this solves the problem? As written it sounds like a "magic solution" with no explanation about why it works. Commented Apr 13, 2017 at 21:42

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.