Program upload problem while BTooth module connected not in sync: resp=0x00

Hey. I'm trying to use arduino with Bluetooth module (HC-06).
And also im trying to send/receive data from android with the app (ArduDroid which is in playstore).

But i have the problem while sending program to Arduino uno after successful compilation.
The error Code is when vcc connected to 3.3V

avrdude: stk500_getsync(): not in sync: resp=0x00

When i connected to 5V sometimes error code changes to but usually same as 3.3v

avrdude: stk500_getsync(): not in sync: resp=0x45.

When i unplug the bt device sending program is successful but i cant receive or send anything.
I checked com port and board. Everything is OK.
Please help me to continue my licence project.
Best regards..

The code is as below:

int ledPin = 13; 
int state = 0;
int flag = 0; 

void setup() {
  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, LOW);

  Serial.begin(9600); // Default connection rate for my BT module
}

void loop() {

  if(Serial.available() > 0){
    state = Serial.read();
    flag=0;
  }

  if (state == '0') {
    digitalWrite(ledPin, LOW);
    if(flag == 0){
      Serial.println("LED: off");
      flag = 1;
    }
  }

  else if (state == '1') {
    digitalWrite(ledPin, HIGH);
    if(flag == 0){
      Serial.println("LED: on");
      flag = 1;
    }
  }
}

When i unplug the bt device sending program is successful but i cant receive or send anything.
I checked com port and board. Everything is OK.
Please help me to continue my licence project.

Unplug the device. Upload the code. Reattach the device. Is that so difficult a concept?

I already done what you said a lot of time as i wrote in the question. Firstly read it again and answer again next time.
I solved the problem and i did the same steps as before and its ok but sometimes it doesn't work.
I'll check the system again.

But i have the problem while sending program to Arduino uno

Which is a 5.0V device. Why the hell would you be trying to run it at 3.3V?

Hello and welcome,

I'm not sure if it's the same for a Uno, but with my Mega, I can plug a HC-05 (JY-MCU 1.06) on RX0/TX0 and still be able to upload sketch by USB cable.

It does not work with HC-07 (JY-MCU 1.05), and to be honest I have no idea why it's working with HC-05...

So I see 3 possible solutions for you:

So I see 3 possible solutions for you:

  • Use the SoftwareSerial library
  • Try with a HC-05
  • Buy a Mega so you have 4 Hardware Serials

Or, be content with having to disconnect the bluetooth device while uploading.

guix:
Hello and welcome,

I'm not sure if it's the same for a Uno, but with my Mega, I can plug a HC-05 (JY-MCU 1.06) on RX0/TX0 and still be able to upload sketch by USB cable.

It does not work with HC-07 (JY-MCU 1.05), and to be honest I have no idea why it's working with HC-05...

So I see 3 possible solutions for you:

Thank you for your help but i solved this problem completely. See you on next topic :slight_smile:

You can tell how you fixed it, it may help others :stuck_out_tongue:

As I said unplug the vcc cable from bread board(for bluetooth device) then upload your code. Check the bt device's led should be of. then finishing upload connect again your bt device to the vcc. that's okay your circuit is working :slight_smile:

thank u so much idk how to repay u saved me Edison Member

Hi
I am doing project of bluetooth control car with Arduino UNO unfortunately I have forgotten to unplug the bluetooth and the IDE shows the error after I unplugged the bluetooth I did the same the IDE shows errors
And I did it multiple times I don't know what to do..

Please anyone help me....