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
Text sent to Bluetooth module - Arduino
I have no idea about the problem.