Help with BT (HC-06)

This a code for HC-06

#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

That looks like a lottery.

Please remember to use code tags when posting code.

What do you mean?

It's a bit like flipping a coin.

Look at the code I quoted. Carefully.

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

OK, so what do the results show now?

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

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

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?

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...

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.

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

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

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.

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

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

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

  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?

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