Reputation: 1
i cannot understand, when i trying to configure and connect bluetooth with my android device. (i used bluetooth HC-05 from lc-technology and Arduino Mega 2560) I’m trying to connect the arduino and android with bluetooth but it failed. This is a code for arduino
char incomingByte;
int LED = 12;
void setup (){
pinMode(LED, OUTPUT);
Serial.begin(9600);
}
void loop(){
if (Serial.available()){
incomingByte = Serial.read();
if(incomingByte == '1'){
digitalWrite(LED, LOW);
}
if(incomingByte == '0'){
digitalWrite(LED, HIGH);
}
}
}
I try to send data from bluetooth device (i use Bluetooth Terminal and BlueTerm) to Bluetooth Arduino and never give a response i've been trying to uses another pin for tx & rx on Arduino Mega 2560, but it never give a response.
Does someone have a solution on that problem ? Thanks before for your help. I'll apreciate you for your help.
Upvotes: 0
Views: 7369
Reputation: 11
Check the following things:
Upvotes: 1
Reputation: 11
The software you provided is working. I had exactly the same problem as you reported, with Arduino Uno and the Bluetooth module from the same maker. After many test I came to the following conclusion: the problem is in the Bluetooth module itself cause it doesn't properly manage the tension levels of the TX pin. You don't see any response cause Arduino can not handle the tension levels from the bluetooth module. You find more informations about my tests at the following link: Arduino Forum
A picture of the tension levels of an HC-05 Bluetooth device Tx pin (from 3.1 down to 0 Volt)
In the next picture the tension levels of the HC-05 Bluetooth device Tx pin of the maker you and me have used (from 3.3 down to 1.7 Volt), note that the signal can't go down to 0 Volt
Upvotes: 1