Go Down

Topic: Question about connecting bluetooth module to Arduino (Read 11259 times) previous topic - next topic

Sharapolas

Jun 18, 2011, 10:12 pm Last Edit: Jun 18, 2011, 10:13 pm by Sharapolas Reason: 1
Hello everyone,

I've bought the following bluetooth module:

Link1

From what i've googled, i found that these chips were used with basebords like here:

Link2

Now, the question is why do i need such a baseboard (with resistors and etc.) if it said that the chip already has txd, rxd, vcc(+3.3v which arduino can supply) and gnd pins?


BW,
Sharapolas







retrolefty

#1
Jun 18, 2011, 11:33 pm Last Edit: Jun 18, 2011, 11:41 pm by retrolefty Reason: 1
Quote
Now, the question is why do i need such a baseboard (with resistors and etc.) if it said that the chip already has txd, rxd, vcc(+3.3v which arduino can supply) and gnd pins?


I got one from the firm shown in your second link. The base board on mine includes a 3.3vdc regulator, but if you use arduino 3.3v power then there is no technical reason for using the 'baseboard'. The 'baseboard' does include a LED that gives the connection status of the link, and I found that very useful in testing and operation. Also the baseboard makes for an easy .1" spaced interface pins and soldering wires directly to the bluetooth model would otherwise be pretty challenging as there is little room between it's pins. Note that I did wire in a two resistor voltage divider to cut down the arduino +5vdc transmit signal pin to allow connection to the module;s receive pin.

I couldn't get the module to work with my windows XP PC using window's default bluetooth driver software. But a user around here posted about finding a Toshiba bluetooth driver stack software download that did work, it created a com40 serial port and it works well at 57600 baud and I've tested to around 60-70ft range with no errors. The Toshiba driver is a 30day OEM trial version with no means for a end user to buy a license, so it has to be uninstalled and then reinstalled every 30 days, but that doesn't take too long to do.

Lefty

Sharapolas

So I've connected the Bluetooth module (BM) to Arduino (AR) in the following way:

1. BM Uart Rxd <- AR Tx
2. BM Uart Txd -> AR Rx
3. BM 3.3V input <- AR 3.3V output
4. BM GND -> AR GND

I"ve also set up a voltage divider for the second connection in such way:

AR Tx -> 1k Ohm resistor -> Junction A -> BM Uart Rxd
                                         Junction A -> 2.2k Ohm resistor -> BM GND


So, this should change the Arduino Tx signal from 5V to 5V * 2200/(1000+2200)~=3.44V which should be close to being ideal (3.3V). Maybe it should be below 3.3V? I did not find what voltage BM can handle on TX and RX. Only note is that "working voltage is: 2.7-3 .3 V", but as i understand this is about power source.

I've added it to my laptop bluetooth device list (Running Windows 7) and paired it. Next, I uploaded this code to AR:

Code: [Select]
void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println("Everything is OK");
  delay(500);
}


First, when i connect the BM to my PC, in my device list two com ports appear (com7 and com8). When I view it in the device list it shows that it is using com7. But in the arduino software under the tools menu there is only com8 visible. Why? And if I try to monitor the com8 - it shows me nothing. Where did I go wrong?

Also, the arduino TX lights aren't blinking. Should they blink or should they not?

Thanks for your help in advance!


BW,
Sharapolas

retrolefty

#3
Jun 21, 2011, 04:42 am Last Edit: Jun 21, 2011, 04:43 am by retrolefty Reason: 1
When I view it in the device list it shows that it is using com7. But in the arduino software under the tools menu there is only com8 visible. Why? And if I try to monitor the com8 - it shows me nothing. Where did I go wrong?

I don't know, that is what I got also using windows XP and it's default bluetooth driver software. Only when I down loaded the Toshiba bluetooth driver stack did I then get a functional com40 port that worked with either the arduino IDE serial monitor or a serial terminal program (Brey terminal).

Also, the arduino TX lights aren't blinking. Should they blink or should they not?

No, the send and receive leds are driven by the USB serial convertor chip and are only active when there is a USB connection active. The 328 chip can still send and receive serial data from pins 0 and 1 as when you wire them to the BT modem module.

Lefty

max891

I bought this device too so I joint to this thread ;)
I have some question about AT commands - in manual they say that all changes must be done when device is unpaired... So what I must do ? Write some code for arduino  and simply run this (Serial.write() and  setup loop) ?
Can I use voltage regulator for 5V to 3.3V conversion on Tx/Rx ?

Sharapolas

@Max89:

Welcome Max89,

sadly I can tell you nothing about the AT commands. At least for now. I see no reason why you can't use the power regulator, but maybe someone knows some..

@retrofly:

I tried the toshiba BT stack driver, but it won't install on my system so i'm searching for a workaround.

Correct me if i'm wrong. Default win software opens two serial ports for the bluetooth device, one IN and one OUT. The only problem why I can't use the Arduino serial monitor is because it can monitor only one serial port. But if i had software which can read two ports simultaneously, this would be no problem. Am I right?

I have a feeling that in Linux serial communication might be easier...Maybe anyone has experience with it?


max891

Ok, next problem - I Connected this module using 4 wires (Tx/Rx and GND and 3.3 V) how to make it visible for Windows...

Sharapolas

@Max89 - i was able to find the bluetooth module right after powering it. Just go to your bluetooth devices ->> add a device and there you should find "linvor" or smth like that if your device is similar to mine.

This was all i could do up to now. Now i'm waiting for someone to answer my former question about multiple com ports :)

retrolefty

#8
Jun 23, 2011, 05:37 pm Last Edit: Jun 23, 2011, 05:40 pm by retrolefty Reason: 1
Quote
Correct me if i'm wrong. Default win software opens two serial ports for the bluetooth device, one IN and one OUT. The only problem why I can't use the Arduino serial monitor is because it can monitor only one serial port. But if i had software which can read two ports simultaneously, this would be no problem. Am I right?



I tried that too with the default windows bluetooth driver. I opened two instances of my PC terminal program (brey terminal) opened one at one of the comm ports the other to the other comm port, wired a loop back wire between the rec and send pins of the BT modem, but nothing worked, however I suspect the the brey terminal disconnects one instance's comm port when you select the other instance, so maybe not a valid test.

As I said I could get nowhere until I installed the toshiba BT driver stack. With the toshiba it creates a lot of comm ports for various BT applications that it also installs, but the comm40 port it creates seems to work for any application including the Arduino IDE serial monitor.

Lefty

Sharapolas

Ok, I'm back with a set of new problems:

I gave up on trying to connect arduino to Windows 7 via bluetooth. Now i'm running ubuntu 11.04 from USB.  At the moment i have my arduino connected to bluetooth module. On linux the only thing i've done is pushed the bluetooth icon on system tray and pushed "set up new device". Then i've paired my PC with the Bluetooth module. Next, i've uploaded the following code to arduino:

Code: [Select]
void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println(sensorValue, DEC);
}


Next, i tried running this command on linux terminal
Code: [Select]

sudo gtk-term


It starts running, but shows the error:

Code: [Select]
Control signals read: Input/output error

In port configuration i've only changed the bitrate to 9600, everything else is default (Parity = none, Bits= 8, Stopbits=1, flow control=none)

First question is: how to know which port my device is using?
Second question is: how to get it working?

Go Up