HC-05 BTBEE + arduino

Hey guys, I'm using an HC-05 bluetooth module for my project with an arduino UNO but I just keep getting this error once i upload the sketch to it : "avrdude: stk500_getsync(): not in sync: resp=0x00". I tried to remove the wires connected to the TX and RX pins then upload the code again and plug the wires again but I keep getting the error. I would appreciate any help . THANKS

I think ur bootloader got crashed. Need upload bootloader again.

Cross check, whether right board and comport being selected or not

I do not think that the bootloader is crached because if i unplug the arduino change the serial port then plug it in and upload any other simple code like "LED BLINK " it works ok .

above error come only these circumstance

1) boot loader got crashed 2) when u selected improper board and comport 3) if any sheild being connecting still communicating TX & RX line,

Can you post your code.

char val; // variable to receive data from the serial port
int ledpin = 8; // LED connected to pin 48 (on-board LED)
void setup() {
pinMode(ledpin, OUTPUT); // pin 48 (on-board LED) as OUTPUT
Serial.begin(9600); // start serial communication at 9600bps
}
void loop() {
if( Serial.available() ) // if data is available to read
{
val = Serial.read(); // read it and store it in ‘val’
}
if( val == ‘H’ ) // if ‘H’ was received
{
digitalWrite(ledpin, HIGH); // turn ON the LED
} else {
digitalWrite(ledpin, LOW); // otherwise turn it OFF
}
delay(100); // wait 100ms for next reading
}

When i disconnect the TX and RX pins from the arduino then reupload the code i don’t get the error so i don’t think that anything is wrong with the arduino itself

IS blink LED program working fine eventhrough u not connected everything. If that case . I can't say anything. below are 3 case situation the error will occur. i tried ur code. its working fine here.

Just cross check whether u selected proper board and comport.

DID you try it with a bluetooth module ?

You told that your are trying without Bluetooth module. I dont have blue tooth module. unless and untill code compile it should work with module also.

I think u connected bluetoth device and trying to upload. In that case it won,t work. Share me link and pin config for bluetooth module ur using

marcovaldor: I do not think that the bootloader is crached because if i unplug the arduino change the serial port then plug it in and upload any other simple code like "LED BLINK " it works ok .

That contradicts what you said in your first post. So what is it?

this is the configuration

bluetooth.jpg

When i upload the sketch and the Bluetooth module is connected i get that error .
I tried an online solution which i found online :
i disconnect the TX and RX pins of the bluetooth module from the arduino then upload the sketch (i don’t get the error when then) then connect the removed wires again and reupload the sketch , then i shouldn’t get the error but i do.

then connect the removed wires again and reupload the sketch , then i shouldn't get the error

You should get the error and you do get it.

The connection of those wires is stopping any upload by blocking the TX & RX signals. As long as you have the module connected you can never do an upload. This is normal and to be expected.

You can arrange jumpers or a switch to disconnect them to allow upload if you like.

Does the connection between the arduino and the module works if I disconnect th wires upload the sketch the connect them again??

Yes it should work like that.

Ok it didn't work !! I'm kinda new in arduino and i wanted to ask you guys if i need to install anything before i use this bluetooth module???

Ok it didn't work !!

Again that contradicts what you said earlier.

By not work do you mean upload errors? If it can upload a simple blink LED sketch with the module disconnected it can load anything with it disconnected. The arduino does not care what code it is loading.

By not work do you mean will not function? Then you have an error in your sketch.

It didn't work i ment that the connection between the arduino and the bluetooth module failed but i didn't get any error

You dont need to instal anything.

For old arduino . remove your all connection diagram just check simple blink program working or Not.

If you are getting same error means . Definately boot loader got crashed,

marcovaldor: It didn't work i ment that the connection between the arduino and the bluetooth module failed but i didn't get any error

Then your sketch is faulty. Ignore AMPS-N please, not the most sound advice from him.

OK could you send me a sketch that you think could work ?