sneding data to Android over HC-06 is not working

hello everyone

i am almost done with one of my project

i have done the Android project and set up the Skatch of Ardunio

however, i followed this old post that i came across

https://bytedebugger.wordpress.com/2014/06/27/tutorial-how-to-connect-an-android-device-with-arduino-and-bluetooth/

the funcation bt.conect()

when i am testing it in IF statement i got that the bluetooth is not conected

i am pre working on this so i can know where i am at before sending any data

can someone help

Try this tutorial (untested):

1. Build the following circuit:
hc06-2x.png
Figure-1:

2. Upload the following sketch (untested):

#include<SoftwareSerial.h>
SoftwareSerial myBT(2, 3);  //SRX = 2, STX = 3

void setup()
{
   Serial.begin(9600);
   myBT.begin(9600);
}

void loop()
{
    if(myBT.available() !=0)
    {
         Serial.print(myBT.read());
    }

    if(Serial.available() !=0)
    {
         myBT.print(Serial.read());
    }
}

3. Launch BT Terminal in your Phone.

4. Pair your Phone with BT and set command mode in ASCII.

5. Send A from Phone and check that it has appeared on Serial Monitor of UNO.

6. Send B from the InputBox of UNO and check that it has appeared on BT screen of Phone.

hc06-2x.png

I'm not sure it will work with the HC06 I use the "Bluefruit EZ-link" that can you use to upload your skets
and send/receive data.

i was able to send data from N phone to A computer via HC-06 even tho it is garbage result but the transmission is happening but not the othe way

nothing was sent to phoneor appered on the BT terminal

It could possibly be incompatible Bd; the default Bd of HC05/06 and Android Phone is 9600. Please, use AT command to check the Bd of your HC06 and set it to 9600.

yes i did put it =9600

#include<SoftwareSerial.h>
SoftwareSerial myBT(2, 3); //SRX = 2, STX = 3

void setup()
{
Serial.begin(9600);
myBT.begin(9600);
}

void loop()
{
if(myBT.available() !=0)
{
Serial.print(myBT.read());
}

if(Serial.available() !=0)
{
myBT.print(Serial.read());
}
}

as the above giving sketch

the pin are (2,3)

would the phone be the problem

i am testing it using Samsung Not 3
and Honor 7 both are the same sending data to serial commend but not receiving in AT command

wait...AT command? what is it?

i am using the serial monitor of Arduino IDE when looking at data send/received and in the phone i am looking at BT command terminal

Are you sure that your Android Phone is paired with HC06? When paired, the RED LED of HC06 will blink once a while; else, the LED would be blinking continuously at about 1 blink/sec.

To access the AT commands on a BLE adapter, you have to press one of the on board PCB buttons when you power it up.

aarg:
To access the AT commands on a BLE adapter, you have to press one of the on board PCB buttons when you power it up.

This is not true. BLE devices are in AT mode by default. I don't suppose this matters, as this guy has an HC-06, which is not BLE, and I bet he doesn't need to make any AT commands anyway. Further, the HC-06 is also in AT mode by default, and is most unlikely to have a button. I submit the only reason for any AT commands for this job is that he has made them before, also most unlikely, and now needs to undo the mess.