1
votes

I have a problem which I have been working on for some time. I have an Arduino Uno board and an HC-05 Bluetooth transceiver with TTL outputs.

The connections are as follows:

RX (HC_05)  --> TX (Arduino UNO)

TX (HC_05)  --> RX (Arduino UNO)

GND (HC-05) --> GND (Arduino UNO)

+5V (HC-05) --> +5V (Arduino UNO)

I have the following Arduino code:

char data = 0; // Variable for storing received data

void setup() {
  Serial.begin(9600);
  pinMode(13, OUTPUT);
}

void loop() {
  if(Serial.available() > 0) {
    // Send data only when you receive data:
    data = Serial.read(); // Read the incoming data & store into data
    Serial.print(data); // Print Value inside data in Serial monitor
    Serial.print("\n");
    if(data == '1')
      // Checks whether value of data is equal to 1
      digitalWrite(13, HIGH); // If value is 1 then LED turns ON
    else if(data == '0')
      //  Checks whether value of data is equal to 0
      digitalWrite(13, LOW); // If value is 0 then LED turns OFF
  }
}

I connect to the Bluetooth module through the Bluetooth Terminal Android app. Everything works fine (even the lights on the Bluetooth module). But when I send a character from the phone to Arduino, I get the following output:

Text sent to Bluetooth module - a

Enter image description here

Text sent to Bluetooth module - Arduino

Enter image description here

I have no idea about the problem.

1
Serial confiuration issue.Martin James
@MartinJames can you please elaborate.likith sai
It may be the app. I published a similar app that I used to connect my Android to an HC-06 module. You can give it a try : PlayStoreOmar Aflak
Check the baud rate on the Bluetooth module, your serial open should match it.Utkarsh Bais

1 Answers

1
votes

change the baudrate to 38400 instead of 9600 this works fi