Arduino Mega and HC-06 module problems

Hi everyone,
I am having some problems with my connection between Arduino Mega and HC-06.
I have it connected like this:
Mega side : HC-06 side
RX(15) : TX
TX(14) : RX
5V : VCC
GND : GND

My running code on Arduino Mega contains these:

`
void movement(char data){
  Serial.println(data);
  switch (data){
    case 'a':   //left movement
      x_motor(1, 50);
      break;
    case 'b':   //right movement
      x_motor(0, 50);
      break;

void bluetooth(){
  if(Serial3.available() > 0){
    data = Serial3.read();
    movement(data);
    }
}
 
void setup() {
    Serial3.begin(9600);
void loop() {
    bluetooth();
    delay(100);
}
--------

Basically this code has been working fine on my HC-06 until i lost it, recently I bought a new one and I expected it to work just fine because I haven't edited anything in the code since then.

I have been using my own android app made in android studio which basically checks my paired devices and looks for name "HC-06" then connects to it. Then by pressing buttons I send values through bluetooth. I removed the old HC from my phone and paired it with new one. (Also I tried to connect directly to HC mac address instead of it's name with no success, this method also worked on my old one)

I have a friend that has HC-06 wired to his project so I asked him to test my app and he is able to receive the values through my android app so it should be working fine (it was working with my previous module as well).

Basically, let me know if I am missing something or what might have changed by changing the HC-06 module for a new one, since it previously worked (and still works on my friend's HC-06).
Let me know what I should check.
Thank you in advance for any kind of response that might help.

The HC-06 is a 3.3V only module. Logic level shifters are required to connect 5V outputs to 3.3V inputs.

Oh yeah right, I forgot that imma give it a try.

Might be too late. Both the 5V output and the 3.3V input can be destroyed when directly connected.

Yeha it makes sense, but on my old one i had it on 5v>3.3 and it worked just fine :smiling_face_with_tear:

Sometimes that will work for a while, then it doesn't.

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