HC06 Module doesn't work properly

I have an HC06 bluetooth module and first when I got it, I connected it directly to my computer through a TTL to USB converter and it worked fine. I even could pair it with my phone and do some stuff using a bluetooth terminal app.

Then, I wrote this piece of code on an arduino uno :

#include <SoftwareSerial.h>

int rxPin = 8;
int txPin = 9;
int ledPin = 13; 

SoftwareSerial BTSerial(rxPin, txPin); 

void setup() {
  // put your setup code here, to run once:
  pinMode(rxPin, INPUT); 
  pinMode(txPin, OUTPUT);
  pinMode(ledPin, OUTPUT); 

  Serial.begin(9600); 
  BTSerial.begin(9600);
  Serial.println("Hello\n------"); 
}

void loop() {
  // put your main code here, to run repeatedly:
  if(BTSerial.available()){
    
    }

}

And then I uploaded the code to my board. Now I have a huge problem. The damn thing doesn't even blink! But when I connect it directly to my computer, it blinks like crazy. What's the problem?

My connections are identical to this and I haven't changed anything.

I updated the code, so it's now this:

#include <SoftwareSerial.h>

int rxPin = 8;
int txPin = 9;
int ledPin = 13; 

SoftwareSerial BTSerial(rxPin, txPin); 

void setup() {
  // put your setup code here, to run once:
  pinMode(ledPin, OUTPUT); 

  Serial.begin(9600); 
  BTSerial.begin(9600);
  Serial.println("Hello\n------"); 
}

void loop() {
  // put your main code here, to run repeatedly:
  if(BTSerial.available()){
      Serial.write(BTSerial.read()); 
    }
   if(Serial.available()){
    BTSerial.write(Serial.read());
    }

}

And I still have no blinking on my module.

And I still have no blinking on my module.

How are ground and Vcc connected?

Yes.
The problem was the cable. Apparently the cable I used for programming the board couldn't provide enough juice for the module. With another cable, it's fine.

I know it's not a big project at all, but it was worth a little video.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.