HC-05 can't read data?

Hey guys,
in my previous post I explained that my HC-06 does not recieve data from my bluetooth terminal (from android phone).

I was told to get the HC-05 module.
So I ordered one.

I use a Arduino Nano
Pinconnection as following:
Bluetooth RX -> To voltage 1.1k ohm and 2k ohm resistor and then to TX on my arduino nano
Bluetooth TX -> To RX on nano
Bluetooth VCC -> to Vout
Bluetooth GND -> GND

I used this code to debug:

int tx=0;
int rx=1;
char junk;
String inputString="";
void setup(){
  Serial.begin(9600);
  pinMode(13,OUTPUT);
  pinMode(tx,OUTPUT);
  pinMode(rx,INPUT);
}

void loop(){
  if(Serial.available()){
    while(Serial.available()){
      char inChar = (char)Serial.read();
      inputString+=inChar;
    }
    Serial.println(inputString);
    while(Serial.available()>0){
      junk=Serial.read();
    }
    if (inputString == "a"){
      digitalWrite(13,HIGH);
    }
    else if(inputString == "b"){
      digitalWrite(13,HIGH);
    }
    inputString = "";
  }
}

If I use the Arduino Terminal and write A or B this works correctly
If I use the bluetooth terminal (tried different apps) on the android and write A or B nothing happens..
If I write A or B on the arduino Terminal it does echo this on the bluetooth terminal.

How can I get this working so that I can write commands in my bluetooth terminal?

All help is appreciated :slight_smile:

Terick

Edit: this is how I connected the Bluetooth RX to Arduino nano TX:

I did wire them to tx and rx on the arduino, not D3 and D2 like in the picture :slight_smile:

Did you try the software serial sketch (Basic Bluetooth sketch HC-05_02) at arduino-with-hc-05 and did it work?

Terick:
Hey guys,
in my previous post I explained that my HC-06 does not recieve data from my bluetooth terminal (from android phone).

I was told to get the HC-05 module.
So I ordered one.

You can pretty well guarantee that the reasons why you are not getting any joy with the HC-05 are exactly the same as the reasons why you didn't get any joy with the HC-06 which, unless it is faulty, should have worked fine. I have no idea why anybody would tell you to get an HC-05 as if it would fix the problem.

I did wire them to tx and rx on the arduino, not D3 and D2 like in the picture

This is the correct procedure, since you do not appear to be using software serial.

Your code looks like junk but it may be merely archaic.

You might find the following background notes useful

http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf
http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino

MartynC:
Did you try the software serial sketch (Basic Bluetooth sketch HC-05_02) at arduino-with-hc-05 and did it work?

I got real angry and resoldered TX and RX to digital pins. THIS WORKS!
I think my nano has broken TX RX pins, because the other way worked great on my arduino uno!