Bluetooth step-by-step: can you give me an help?

Hi all :slight_smile:
I need a big help understanding how to make connection between arduino and another BT device (let's call it BT DEV).
First of all i explain the specifics of my project:

  • bidirectional communication
  • arduino will stay in "stand by" waiting for connection.
  • The BT DEV will scan for all BT devices near it and when arduino is found begin communication

So, as second step, i'd like to ask you which BT module i must buy?
Reading on web pages i found slave and master module. Which is ok for me? What is the difference? A master module can be setted as slave with AT command?

Reading on web pages i found slave and master module. Which is ok for me?

Isn't that fairly obvious. One issues commands. One reacts to commands. If the Arduino is going to do nothing until something tells is to, it's a slave, by definition.

What is the difference?

Really? Google failed you? That is incredibly hard to believe.

A master module can be setted as slave with AT command?

Some probably can. Some possibly can't. Depends on how cheap you go, mostly. You get what you pay for. A $2 device is going to lack features that a $2oo device has.

PaulS:

Reading on web pages i found slave and master module. Which is ok for me?

Isn't that fairly obvious. One issues commands. One reacts to commands. If the Arduino is going to do nothing until something tells is to, it's a slave, by definition.

What is the difference?

Really? Google failed you? That is incredibly hard to believe.

A master module can be setted as slave with AT command?

Some probably can. Some possibly can't. Depends on how cheap you go, mostly. You get what you pay for. A $2 device is going to lack features that a $2oo device has.

Yeah, i know a slave react to commands given by master device, but Arduino must send back a response too. My dubt is for that.
Is it always a slave device if it send back response?

Is it always a slave device if it send back response?

If it wasn't a slave, what would it be responding to?

Hi Dani88,
as already posted here (for the same question :P):

i suggest you to start to understand BT communication from the documentation and discussions here collected:
http://arduino.cc/forum/index.php/topic,104903.0.html

Ok, so i need a slave module, right?
As i wrote, my only dubt was about the response of the Arduino :wink:

I found the HC-05 BT module on ebay for about $4, do you know it? It's 30FT and is fully configurable with AT cmd.
Datasheet report also:
"These modules have two modes: master and slaver device. The device named after even number is defined to be master or slaver when out of factory and can’t be changed to the other mode. But for the device named after odd number, users can set the work mode (master or slaver) of the device by AT commands."
so as addictional feature on HC-05 i can set M or S mode, right?

@pitusso
Si sto leggendo il primo pdf ma mi era rimasto questo dubbio sul fatto che lo slave potesse solo ricevere e non trasmettere oltre a non poter instaurare una connessione da zero :wink:

Dani88:
so as addictional feature on HC-05 i can set M or S mode, right?

Yes, you can change a HC-05 module to master or slave mode. Just connect it to your computer with a USB serial cable, then connect to the corresponding COM port with a serial console (e.g. the serial monitor tool in Arduino IDE), and send the corresponding AT commands.

The full spec of HC-05 module can be downloaded from the hardware vendor website http://www.wavesen.com/downloadDis.asp?id=30.

By the way, if you don't have a USB serial cable, you can configure your Arduino board to be one, see http://arduino.cc/forum/index.php/topic,18243.0.html.

Dani88:
I need a big help understanding how to make connection between arduino and another BT device (let's call it BT DEV).

Opps... the bluetooth serial module (HC-05) in master mode you talking about is not entirely a master Bluetooth device. For instance, a master Bluetooth device (like your computer) can talk to seven slave bluetooth devices at the same time, HC-05 can only do one at a time. HC-05 can only do serial connection, whereas a master Bluetooth device should be able to do bluetooth headset, mouse, keyboard, printer, etc.

If you are trying to control some existing bluetooth devices (e.g. a bluetooth printer) with Arduino, you probably cannot use HC-05.

ma_hty:

Dani88:
I need a big help understanding how to make connection between arduino and another BT device (let's call it BT DEV).

Opps... the bluetooth serial module (HC-05) in master mode you talking about is not entirely a master Bluetooth device. For instance, a master Bluetooth device (like your computer) can talk to seven slave bluetooth devices at the same time, HC-05 can only do one at a time. HC-05 can only do serial connection, whereas a master Bluetooth device should be able to do bluetooth headset, mouse, keyboard, printer, etc.

If you are trying to control some existing bluetooth devices (e.g. a bluetooth printer) with Arduino, you probably cannot use HC-05.

For my use i thinks it's ok only one device, because i need to communicate between Android/iOS/WP and Arduino.
The smartphone app i wrote use RFCOMM, and trying it with Putty (a serial monitor for Win) and with a standard usb BT adapter on the pc, Putty show commands send by the smartphone.
So it should be work with HC-05 too if it has a serial connection, right?

Dani88:
So it should be work with HC-05 too if it has a serial connection, right?

Yes, it should work. In fact, I am using it to make my Android phone talk to my Arduino board.

Ok, so i'm going to buy it :slight_smile: