Arduino UNO and Bluetooth

I’d be very very thankful to whoever could help me solve this problem, I’m very frustrated.

I have a Bluetooth module that I’m trying to interface with my Arduino UNO, the module I’m using is the OEM Serial Port Adapter, cB-0907-01 (I attached the data sheet and two more files with the J6 connector, the one I used), for this project I’m using my DELL Inspiron 1525.

The program I’m trying to run is basic, an LED connected to pin 13 which turns on/off when I press ‘y’ or ‘n’ on the keyboard.

I’m afraid the problem is just inexperience about the physical connection between Arduino and the module. Actually, I don’t know much about Bluetooth modules, I only know about the main 4 pins: the RX, TX, power and ground but the module I have has a bunch of pins that I don’t know if I should ever use.

Here’s what I’m doing step by step (possibly wrong):

  1. I load a simple LED program to the Arduino:
char val; // variable to receive data from the serial port
int ledpin = 13;

void setup() {

pinMode(ledpin, OUTPUT); 
Serial.begin(115200); // baud rate according to Bluetooth module
}

void loop() {
if( Serial.available() ) // if data is available to read
{
val = Serial.read(); // read it and store it in 'val'
}
if( val == 'y' ) // if 'y' was received
{
digitalWrite(ledpin, HIGH); // turn ON the LED
} else if(val == 'n'){ //if ‘n’ was received
digitalWrite(ledpin, LOW); // turn it OFF
}
delay(100); // wait 100ms for next reading
}
  1. I run the program in the Arduino IDE to make sure it works and it runs fine (only through USB though).

  2. I connect the Arduino to my AC power adapter.

  3. Then I connect:
    Bluetooth module Arduino UNO
    RX-------------------------------------------? TX
    TX-------------------------------------------? RX
    VSS-----------------------------------------? Ground
    VCC_3V3----------------------------------? 3.3V

  4. The Bluetooth wizard pops up, a few seconds later I can see the new Bluetooth device, then I insert the passkey, I see a new port (in my case the new port is 13).

Now, after connecting those 4 pins I’m having trouble trying to interface the module with the Arduino. I changed the port from 6 to 13 (the new port), I run the program and I get the following error:

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

I’ve read in different forums something about the DTR and RTS pins but honestly, after reading several websites I still don’t understand what those pins do, some Bluetooth modules have it and some others don’t.

What am I doing wrong?

Bluetooth module.pdf (940 KB)

I changed the port from 6 to 13 (the new port), I run the program and I get the following error:

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

You run what program? You shouldn't be trying to upload code over the bluetooth port.

What you should do is open a different serial program (hyperterminal), or the IDE and open the Serial Monitor after selecting COM 13, and entering DATA there to send.

Yes I opened the Serial Monitor in the Arduino IDE , I selected COM 13, entered data but there's no response from the module. I also used a serial program called Putty but no response either.

it is frustrating because I managed to do the hardest thing which (for me) was to establish the connection over Bluetooth, I mean, my laptop can see the Bluetooth device, the program runs fine (over USB), I just don't know how to run the Arduino program without the USB cable.

Is it about the DTR and RTS pins? I didn't connect those.

Problem solved!!!

I'm so embarrassed to say the solution was ridiculously easy, which is something that for some reason I was predicting :stuck_out_tongue:

Believe it or not, in the datasheet I couldn't find the baud rate for Bluetooth module but I did read that most Bluetooth modules (or at elast the most commonly used ones) use 115200, it turns out that it wasn't the correct one, I tried 9600 and it worked :stuck_out_tongue:

Sorry for my stupidity.