Pages: [1]   Go Down
Author Topic: Bluetooth step-by-step: can you give me an help?  (Read 2011 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 83
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all smiley
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?
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 633
Posts: 50204
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.

Quote
What is the difference?
Really? Google failed you? That is incredibly hard to believe.

Quote
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.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 83
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.

Quote
What is the difference?
Really? Google failed you? That is incredibly hard to believe.

Quote
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?
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 633
Posts: 50204
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is it always a slave device if it send back response?
If it wasn't a slave, what would it be responding to?
Logged

0
Offline Offline
Edison Member
*
Karma: 24
Posts: 2315
Have you mooed today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Dani88,
as already posted here (for the same question  smiley-razz):
http://arduino.cc/forum/index.php/topic,115084.msg866163.html#msg866163
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
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 83
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, so i need a slave module, right?
As i wrote, my only dubt was about the response of the Arduino smiley-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 smiley-wink
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: October 29, 2012, 08:27:11 pm by ma_hty » Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: October 29, 2012, 09:36:38 pm by ma_hty » Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 83
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 83
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, so i'm going to buy it smiley
Logged

Pages: [1]   Go Up
Jump to: