2
\$\begingroup\$

I am trying to interface with a HC-06 module but I can't talk to the module over serial.

My VCC is connected to 5V (also tried 3.3V) of my Arduino Uno, and GND is connected to ground of it (obviously). I've connected the RXD to pin 11 and TXD to pin 10 (also tried the opposite too). The LED on the module is blinking (waiting for connection) Here is my code:

#define BT_RX 10
#define BT_TX 11
#define BAUD 9600
SoftwareSerial bt(BT_RX, BT_TX);

in setup method:

pinMode(BT_RX, INPUT);
pinMode(BT_TX, OUTPUT);
bt.begin(BAUD);

Then, I'm trying to send the simplest AT command to the HC-06 (without newline character, I do know it's different from HC-05). If everything works, I should get an OK response. I've tried all the baud rates available, both 3.3V and 5V, and tried inverting the RX and TX pins, yet I've got a response from the module. However, the module itself works. When powered on, my Bluetooth devices see it as HC-06 and can connect to it with the default password 1234 (other passwords fail). When my devices connect to it, the blinking light turns to solid ON, meaning that the connection succeeded. My serial console (when I connect using putty or SerialTools etc) can accept input. The Bluetooth module itself does send and receive data. When I short the RXD and TXD pins, I immediately receive what I typed back in my terminal. But I couldn't find any way to talk to the device over Arduino. I've read many tutorials and datasheets of the device, but I just can't talk to it. I am new to electronics (but most of the times understand what's going on easily). What am I doing wrong?

\$\endgroup\$
  • 1
    \$\begingroup\$ I remember one had a pin (key?) that had to be high for AT mode. Not sure that helps... \$\endgroup\$ – carveone Aug 3 '14 at 17:54
  • \$\begingroup\$ I've pulled up the KEY pin. It didn't work. But after some more trials it worked, even though key wasn't pulled up anymore. Not sure if it was the high KEY pin that triggered it to work, or if it was something else. Note, for future reference, it was at baud 9600. \$\endgroup\$ – Can Poyrazoğlu Aug 3 '14 at 19:36
  • \$\begingroup\$ Take a look at this tutorial: Modify The HC-05 Bluetooth Module Defaults Using AT Commands \$\endgroup\$ – user51584 Aug 19 '14 at 7:58
0
\$\begingroup\$

I've pulled up the KEY pin. It didn't work. But after some more trials it worked, even though key wasn't pulled up anymore. Not sure if it was the high KEY pin that triggered it to work, or if it was something else.

Note, for future reference, it was default at baud 9600, and I used 5V VCC from Arduino, not 3.3V.

\$\endgroup\$
0
\$\begingroup\$

The default baud rate is 9600, 8 bit, no parity no flow control (9600,8,N,1). The HC-06 works with 3,3V ... You can connect the HC-06-TX (output) direct to PC-RX (TTL) but the PC-TX (TTL) CAN NOT BE DIRECTLY CONNECTED to HC-06-RX (input), due to 5V, then you have to put a level converter. In this case is enought to use a resistive voltage divider.

PC                 HC-06

RX <-------------- TX

TX --> divider --> RX
\$\endgroup\$

protected by Nick Alexeev May 30 '18 at 15:15

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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