Bluetooth HC-05 works only one way

Hi guys. I have a bit of a problem with my Bluetooth and arduino UNO R3.

The bluetooth can read and send the data from Arduino via a resistor devider ( 1K Ohm and 2.2K Ohm ) and send the data to a PC ( putty on ubuntu ) or a Android Phone ( Bluetooth Terminal APP ). The problem is when i want to send some data to the arduino. Nothing happens. I've tried it with the LED ON/ LED OFF program when 1 or 0 is send to arduino. This happens on both using SerialSoftware ( pins 10 and 11 ) or the Serial ( pins 0 and 1 ).

Any advice ?

Stay with hardware serial 0,1, disconnect bluetooth, and test the programme with serial monitor. That way, you can ensure that the code is kosher and, if it is, check out the bluetooth.

If it isn't, 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

OK, i will be more precisive.
The main goal is to make my own "arduino" with a ATMEGA 328P.
I acctually am connecting my bluetooth to a ATMEGA 328P and this code below - works.

int counter =0;

void setup() {
  Serial.begin(9600); 
  delay(50);
}

void loop() {
  counter++;
  Serial.print("Arduino counter: ");
  Serial.println(counter);
  delay(500); // wait half a sec
}

I can revice the counter value on putty and on my android phone.

But this code:

char INBYTE;
int  LED = 13; // LED on pin 13

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

void loop() {
  Serial.println("Press 1 to turn Arduino pin 13 LED ON or 0 to turn it OFF:");
  while (!Serial.available());   // stay here so long as COM port is empty   
  INBYTE = Serial.read();        // read next available byte
  if( INBYTE == '0' ) digitalWrite(LED, LOW);  // if it's a 0 (zero) tun LED off
  if( INBYTE == '1' ) digitalWrite(LED, HIGH); // if it's a 1 (one) turn LED on
  delay(50);
}

It sends the information from println but when i write via putty nothing happens.
This is the same at a bluetooth terminal APP on Android.

If i use the LED ON OFF code via USB cable it works fine ( on arduino UNO not on a plai 328P ;] )

The LED itself is working fine, the code send to the 328P via Arduino ISP is also good.

I am struggling with this problem for 2 days now and I am still in the same place ;/

The odd thing is that the sending works but the receiving doesn't. ;/

I've also tested your code : http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino

I can see in the terminal the information from the setup method but nothing else happens ;/

kawa89:
I can see in the terminal the information from the setup method but nothing else happens ;/

Use the serial monitor, not the terminal.