title: Arduino HC-05 Bluetooth module disconnects when sending data
body: <p>I'm new to Arduino. I'm trying to build a program to control a breadboard through Arduino using the bluetooth module HC-05. At the moment I don't have anything on the breadboard and I'm just trying to test the connection. This is what I've done so far:</p>
  
  <p>I put the module on the breadboard and I've paired it with the computer. When it's paired, the red led starts blinking slowly. I've connected the bluetooth Rx to Arduino Tx and Arduino Rx to bluetooth Tx following this tutorial: <a href="http://playground.arduino.cc/Learning/Tutorial01" rel="nofollow">http://playground.arduino.cc/Learning/Tutorial01</a></p>
  
  <p>I've also implemented both Java and Arduino programs following that tutorial. Here they are:</p>
  
  <p>JAVA</p>
  
  <pre><code>public class Arduino extends PApplet{
  
  public void connect(){
      String[] serials = Serial.list();
      Serial port = new Serial(this, Serial.list()[0], 9600);
      port.write('H');
      port.dispose();
  }
  </code></pre>
  
  <p>ARDUINO</p>
  
  <pre><code> void setup() {
    Serial.begin(9600);
    Serial.println("Start");
  }
  
  void loop() {
    if(Serial.available()){
     int a = Serial.read();
     Serial.print(a);
   }
  }
  </code></pre>
  
  <p>The Java part should send the letter H to Arduino and Arduino should detect that and print it on the Serial monitor. But what actually happens is that I send data, and the led on the HC-05 starts blinking faster (which means the connection is lost). Why does that happen? I'm pretty confused. For the communication I'm using the port COM6 and COM7. It depends on how it connects. To see what port to use I just run the Java program: if the port is not correct, it will just get stuck and send nothing. </p>
  
  <p>Any help is appreciated. Thanks!</p>