# Help with BT (HC-06)

**URL:** <https://forum.arduino.cc/t/help-with-bt-hc-06/934408>\
**Category:** Programming\
**Created:** [December 10, 2021, 5:24pm UTC](https://forum.arduino.cc/t/help-with-bt-hc-06/934408 "2021-12-10T17:24:06Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![arduyeah](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@arduyeah](https://forum.arduino.cc/u/arduyeah)\
**Post date:** [December 10, 2021, 5:24pm UTC](https://forum.arduino.cc/t/help-with-bt-hc-06/934408/1 "2021-12-10T17:24:06Z")

</div>

This a code for HC-06

```arduino
#include <SoftwareSerial.h>
SoftwareSerial BT(11,10);

void setup() {
pinMode(12,OUTPUT);
digitalWrite(12,HIGH);
Serial.begin(9600);
BT.begin (9600);

}

void loop() {

if(BT.available()){
Serial.write(BT.read());
}
if (Serial.available()){
  BT.write(Serial.read());

}
}

```

//////////////////////////////////////////////////////////////////

I dont know why the answer when i enter the AT command into the serial console is ¿¿¿¿¿¿

> Cita

---

<div class="post-metadata">

**Author:** ![anon73444976](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@anon73444976](https://forum.arduino.cc/u/anon73444976)\
**Post date:** [December 10, 2021, 5:27pm UTC](https://forum.arduino.cc/t/help-with-bt-hc-06/934408/2 "2021-12-10T17:27:21Z")

</div>

> [@arduyeah](#):
>
> if(Serial.available()){  
> Serial.write(BT.read());  
> }  
> if (Serial.available()){  
> BT.write(Serial.read());
> 
> }

That looks like a lottery.

Please remember to use code tags when posting code.

---

<div class="post-metadata">

**Author:** ![arduyeah](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@arduyeah](https://forum.arduino.cc/u/arduyeah)\
**Post date:** [December 10, 2021, 5:28pm UTC](https://forum.arduino.cc/t/help-with-bt-hc-06/934408/3 "2021-12-10T17:28:53Z")

</div>

What do you mean?

---

<div class="post-metadata">

**Author:** ![anon73444976](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@anon73444976](https://forum.arduino.cc/u/anon73444976)\
**Post date:** [December 10, 2021, 5:29pm UTC](https://forum.arduino.cc/t/help-with-bt-hc-06/934408/4 "2021-12-10T17:29:57Z")

</div>

It's a bit like flipping a coin.

Look at the code I quoted. Carefully.

---

<div class="post-metadata">

**Author:** ![arduyeah](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@arduyeah](https://forum.arduino.cc/u/arduyeah)\
**Post date:** [December 10, 2021, 5:34pm UTC](https://forum.arduino.cc/t/help-with-bt-hc-06/934408/5 "2021-12-10T17:34:11Z")

</div>

Oh sorry, I dindn`t paste it correctly, look at it now.

---

<div class="post-metadata">

**Author:** ![anon73444976](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@anon73444976](https://forum.arduino.cc/u/anon73444976)\
**Post date:** [December 10, 2021, 5:36pm UTC](https://forum.arduino.cc/t/help-with-bt-hc-06/934408/6 "2021-12-10T17:36:38Z")

</div>

OK, so what do the results show now?

(In future, please don't edit code that has already been quoted - it confuses readers)

---

<div class="post-metadata">

**Author:** ![arduyeah](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@arduyeah](https://forum.arduino.cc/u/arduyeah)\
**Post date:** [December 10, 2021, 5:40pm UTC](https://forum.arduino.cc/t/help-with-bt-hc-06/934408/7 "2021-12-10T17:40:13Z")

</div>

Ok sorry for that. Now when I send the AT code I dont Recieve an answer

---

<div class="post-metadata">

**Author:** ![Brazilino](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/brazilino/32/1198404_2.png) [@Brazilino](https://forum.arduino.cc/u/Brazilino)\
**Post date:** [December 10, 2021, 5:44pm UTC](https://forum.arduino.cc/t/help-with-bt-hc-06/934408/8 "2021-12-10T17:44:13Z")

</div>

> [@arduyeah](#):
>
> serial console is ¿¿¿¿¿¿

By serial console you mean "serial monitor"? Make sure that the baud rate at the serial monitor is also set to 9600.

There´s a chance that you´re not connecting your HC-06 correctly. Are you using an UNO?

Your code sets RX to pin 11 and TX to pin 10. If you´re setting pin 12 as output HIGH, I presume you´re connecting the module directly into the board. Am I right?

---

<div class="post-metadata">

**Author:** ![arduyeah](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@arduyeah](https://forum.arduino.cc/u/arduyeah)\
**Post date:** [December 10, 2021, 5:46pm UTC](https://forum.arduino.cc/t/help-with-bt-hc-06/934408/9 "2021-12-10T17:46:19Z")

</div>

Yes I mean serial monitor and yes, you are right (Im conecting the module directly to the console. All the rates are now set to 9600, but the result is the same...

---

<div class="post-metadata">

**Author:** ![Brazilino](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/brazilino/32/1198404_2.png) [@Brazilino](https://forum.arduino.cc/u/Brazilino)\
**Post date:** [December 10, 2021, 5:50pm UTC](https://forum.arduino.cc/t/help-with-bt-hc-06/934408/10 "2021-12-10T17:50:27Z")

</div>

If I´m not wrong, pin 12 is connected to the module´s GND, you should set it LOW and set pin 13 as OUTPUT HIGH.

---

<div class="post-metadata">

**Author:** ![arduyeah](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@arduyeah](https://forum.arduino.cc/u/arduyeah)\
**Post date:** [December 10, 2021, 5:51pm UTC](https://forum.arduino.cc/t/help-with-bt-hc-06/934408/11 "2021-12-10T17:51:30Z")

</div>

Pin 12 is connected to the hc-06 vcc. Thats why its set on high, in order to power the module...

---

<div class="post-metadata">

**Author:** ![Brazilino](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/brazilino/32/1198404_2.png) [@Brazilino](https://forum.arduino.cc/u/Brazilino)\
**Post date:** [December 10, 2021, 5:58pm UTC](https://forum.arduino.cc/t/help-with-bt-hc-06/934408/12 "2021-12-10T17:58:17Z")

</div>

Something doesn´t fit in my mind... Presuming that you´re using an UNO:

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/8/1/d/81dacfd248f85686742be0311aef63890a8d76b1.jpeg)

Another issue is that some HC-06 works with 3.3V logic, so that you should use a voltage divider on the RX pin of the module.

---

<div class="post-metadata">

**Author:** ![arduyeah](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@arduyeah](https://forum.arduino.cc/u/arduyeah)\
**Post date:** [December 10, 2021, 5:59pm UTC](https://forum.arduino.cc/t/help-with-bt-hc-06/934408/13 "2021-12-10T17:59:44Z")

</div>

Yes im using an UNO. Might be te voltage divider thing, because the module is connected correctly...

---

<div class="post-metadata">

**Author:** ![cattledog](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/cattledog/32/217816_2.png) [@cattledog](https://forum.arduino.cc/u/cattledog)\
**Post date:** [December 10, 2021, 9:01pm UTC](https://forum.arduino.cc/t/help-with-bt-hc-06/934408/14 "2021-12-10T21:01:37Z")

</div>

> [@arduyeah](#):
>
> Pin 12 is connected to the hc-06 vcc. Thats why its set on high, in order to power the module...

I do not think that an output pin will provide enough power for the module. Connect Vcc to the 5v pin on the board.

---

<div class="post-metadata">

**Author:** ![arduyeah](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@arduyeah](https://forum.arduino.cc/u/arduyeah)\
**Post date:** [December 11, 2021, 11:05am UTC](https://forum.arduino.cc/t/help-with-bt-hc-06/934408/15 "2021-12-11T11:05:47Z")

</div>

I have also tryed that, but still dont have a response...

---

<div class="post-metadata">

**Author:** ![cattledog](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/cattledog/32/217816_2.png) [@cattledog](https://forum.arduino.cc/u/cattledog)\
**Post date:** [December 11, 2021, 4:36pm UTC](https://forum.arduino.cc/t/help-with-bt-hc-06/934408/16 "2021-12-11T16:36:02Z")

</div>

1. Are you entering AT from the monitor without any line ending? Have you tried different baud rates?

2)The module can not be connected to a phone or other master when using AT mode.

3). Are you certain the module is an HC06 and not an HC05? Can you post detailed photos of front and back?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [June 9, 2022, 4:36pm UTC](https://forum.arduino.cc/t/help-with-bt-hc-06/934408/17 "2022-06-09T16:36:22Z")

</div>

Closed on June 9, 2022, 4:36pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
