1
\$\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\$
4
  • 1
    \$\begingroup\$ I remember one had a pin (key?) that had to be high for AT mode. Not sure that helps... \$\endgroup\$
    – carveone
    Commented Aug 3, 2014 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\$ Commented Aug 3, 2014 at 19:36
  • \$\begingroup\$ Take a look at this tutorial: Modify The HC-05 Bluetooth Module Defaults Using AT Commands \$\endgroup\$
    – user51584
    Commented Aug 19, 2014 at 7:58
  • \$\begingroup\$ I have the same problem. The BT comms work ok, but I cannot enter AT commands when it is unpaired. There appears to be different manufactures of the HC06, my one has 2 chips, one of which is a lot larger. I have seen other modules where the 2 chips are the same size. Could be a design issue. \$\endgroup\$ Commented Jul 4, 2021 at 10:31

2 Answers 2

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\$
-1
\$\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\$

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