Arduino Bluetooth module HC-05 [Eng]
Arduino Bluetooth module HC-05 pdf [Eng]
...
- Introduction
Le module Bluetooth HC-05 est un module Bluetooth SPP (protocole de port série) facile à utiliser, conçu pour la configuration d’une connexion série sans fil transparente. Sa communication s'effectue via une communication série, ce qui facilite l'interface avec le contrôleur ou le PC. Le module Bluetooth HC-05 fournit un mode de commutation entre les modes maître et esclave, ce qui signifie qu’il ne peut utiliser ni la réception ni la transmission de données.
Spécification:
- Modèle: HC-05
- Tension d’entrée: DC 5V
- Méthode de communication: communication série
- Les modes maître et esclave peuvent être changés
VCC + 5V Connecter à + 5V
GND Ground Connect to Ground
TXD UART_TXD,
Envoi de signal série Bluetooth
ÉPINGLE
Connectez-vous avec le code PIN RXD du MCU (microcontrôleur, etc.).
RXD UART_RXD,
Réception du signal série Bluetooth
ÉPINGLE
Connectez-vous avec le code PIN TXD du MCU (Microcontrôleur, etc.).
Entrée du commutateur de mode KEY
Si le niveau d'entrée est bas ou s'il est connecté à l'air, le module est en mode couplé ou en communication. Si le niveau d’entrée est élevé, le module passera en mode AT.
- Exemple d'installation du matériel et exemple de code source
Vous trouverez ci-dessous un exemple d'interface entre Arduino UNO et un PC via le module Bluetooth HC-05. Dans cet exemple, le mode de communication est utilisé.
* Remarque: pour le mode AT (utilisez pour modifier le réglage par défaut, etc.), veuillez vous référer à ce lien Modifier
Les paramètres par défaut du module Bluetooth du HC-05 à l’aide des commandes AT.
Le diagramme ci-dessous montre la connexion matérielle entre le module Bluetooth HC-05 et Arduino UNO. Outre Arduino, il peut s’interfacer avec n’importe quel microcontrôleur, tel que PIC, etc.
- VCC Arduino 5V
- GND Arduino GND
- TXD Arduino Pin RX
- RXD Arduino Pin TX
- KEY Connectez-vous à l'air pour le mode de communication
Une fois l’installation du matériel et du code source effectuée sur Arduino UNO, vous devez maintenant configurer le site PC. Pour communiquer avec Arduino UNO, un périphérique Bluetooth est également nécessaire sur le site de l'ordinateur. Nous vous recommandons d’utiliser une prise USB dans un périphérique Bluetooth sur un site PC. Voir le schéma ci-dessous pour le transfert de données entre Arduino UNO et un PC via des périphériques Bluetooth.
... ....
Pour utiliser un périphérique Bluetooth sur un site PC, le pilote de périphérique Bluetooth est nécessaire pour l'installation sur un PC. Si votre périphérique Bluetooth Plug-in USB ne permet pas l'installation du pilote, vous pouvez télécharger le logiciel Bluetooth de ce site pour PC et l'installer. Branchez votre périphérique Bluetooth sur le PC pendant l’installation et redémarrez-le après l’installation.
Après avoir configuré le site Arduino UNO et le site PC, nous passons à la session suivante, qui indiquera la communication entre Arduino UNO et le PC via des périphériques Bluetooth via le mode de communication.
- Communication entre Arduino UNO et un PC via Bluetooth
Pour communiquer entre Arduino UNO et un PC via Bluetooth, suivez les étapes ci-dessous.
Étape 1
Activez Arduino UNO avec l’installation complète de l’exemple de matériel et du code source.
Étape 2
Allez à [Bureau] Ouvrir [Bluetooth Places]
Étape 3
Allez à [Coin inférieur droit sur le bureau] click cliquez avec le bouton droit de la souris sur [Icône Bluetooth].
Sélectionnez [Activer Bluetooth]
Étape 4
Après avoir allumé le périphérique Bluetooth sur le site du PC,
Allez à [Coin inférieur droit sur le bureau] click Cliquez avec le bouton droit de la souris sur [Icône Bluetooth].
Sélectionnez [Afficher la vue classique]
Étape 5
Double-cliquez sur [Logiciel Center Ball of Bluetooth] pour rechercher le périphérique Bluetooth disponible environnant.
Le module Bluetooth HC-05 sera trouvé et affiché à l’écran.
Étape 6
Sélectionnez le module Bluetooth HC-05 à l'écran et double-cliquez sur l'icône du port série pour vous connecter.
Étape 7
Saisissez les mots de passe par défaut: 1234 sur [Clé de passe] pour connecter le module Bluetooth HC-05.
Après avoir saisi le mot de passe correct, la fenêtre indiquera quel COM série est connecté au HC-05.
Module Bluetooth. Dans cet exemple, «COM8» était connecté.
Étape 8
Pour écrire des données sur Arduino UNO via le module Bluetooth HC-05, ouvrez le logiciel «Série Mybotic
Outil Com ”. Ce logiciel peut être arriver à ici.
Étape 9
- Sélectionnez le bon port série (dans cet exemple, «COM8» est le bon port série).
- Sélectionnez le débit en bauds sur 9600 (par défaut en mode de communication).
- Cliquez sur «Ouvrir».
"COM ouvert avec succès" s'affiche si l'ouverture est réussie.
Étape 10
Maintenant, vous pouvez envoyer ce que vous voulez à Arduino UNO en
- Écrire des données dans une zone de texte, puis
- Cliquez sur écrire.
Sur le site Arduino, les données ont été reçues et affichées sur un écran LCD.
Outre l'envoi de données d'un PC à Arduino UNO, des données peuvent également être envoyées d'Arduino UNO à un PC en appuyant sur le bouton. Le «bouton enfoncé» sera envoyé au PC et affiché sur le Mybotic Serial Com Tool lorsque vous appuierez sur le bouton.
- garantie
- La garantie du produit est valable 3 mois.
- La garantie s’applique uniquement aux défauts de fabrication.
- Les dommages causés par une mauvaise utilisation ne sont pas couverts par la garantie.
- La garantie ne couvre pas les frais d’expédition dans les deux sens.
... ... ... ...
HC-05 embedded Bluetooth serial communication module (can be short for module) has two work modes: order-response work mode and automatic connection work mode. And there are three work roles (Master, Slave and Loopback) at the automatic connection work mode. When the module is at the automatic connection work mode, it will follow the default way set lastly to transmit the data automatically. When the module is at the order-response work mode, user can send the AT command to the module to set the control parameters and sent control order. The work mode of module can be switched by controlling the module PIN (PIO11) input level.
Serial module PINs:
- PIO8 connects with LED. When the module is power on, LED will flicker. And the flicker style will indicate which work mode is in using since different mode has different flicker time interval. 2
. PIO9 connects with LED. It indicates whether the connection is built or not. When the Bluetooth serial is paired, the LED will be turned on. It means the connection is built successfully.
- PIO11 is the work mode switch. When this PIN port is input high level, the work mode will become order-response work mode. While this PIN port is input low level or suspended in air, the work mode will become automatic connection work mode.
- The module can be reset if it is re-powered since there is a reset circuit at the module.
- How to get to the AT mode.
Way 1:
Step 1: Input low level to PIN34. Step 2: Supply power to the module. Step 3: Input high level to the PIN34. Then the module will enter to AT mode. The baud rate is as same as the communication time, such as 9600 etc.
Way 2: Step 1: Connect PIN34 to the power supply PIN. Step 2: Supply power to module (the PIN34 is also supplied with high level since the PIN34 is connected with power supply PIN). Then the module will enter to AT module. But at this time, the baud rate is 38400. In this way, user should change the baud rate at the AT mode, if they forget the communication baud rate. How to get to the communication mode: Step 1: Input low level to PIN34. Step 2: Supply power to the module. Then the module will enter to communication mode. It can be used for pairing.
- How to set this module be the master role.
Step 1: Input high level to PIO11.
Step 2: Supply power to the module. And the module will enter to the order-response work mode.
Step 3: Set the parameters of the super terminal or the other serial tools (baud rate: 38400, data bit:8, stop bit:1, no parity bit, no Flow Control)
Step 4: Sent the characters “AT+ROLE=1\r\n” through serial, then receive the characters “OK\r\n”. Here, “\r\n” is the CRLF.
Step 5: Input low level to PIO, and supply power to the module again. Then this module will become master role and search the other module (slave role) automatically to build the connection.
- Notes.
(1) HC-03 and HC-05’s command should end up with “\r\n”. It means when you finish programming, you should add terminator (“ENTER” or “0x0d 0x0a”) to the program. It’s different from HC-04 and HC-06 (They don’t need terminator). (2) The most common commands for HC-03 and HC-05 are: AT+ROLE (set master –slave), AT+CMODE( set address pairing) , AT+PSWD (set password). If you want the master module has the function of remembering slave module, the most simply way is: First, set AT+CMODE=1. Make the master module pair with the slave module. Second, set AT+CMODE=0. Then the master module just can make pair with that specified slave module. (3) When PIN34 keeps high level, all commands can be used. Otherwise, only some of them can be used.
- Set PIO multiple port output
Command Response Parameter
AT+MPIO= OK
Param: Mask combination of
PIO ports number (Decimal)
HC-05 Bluetooth module provides the ports (PI00~PI07 and PI010) which can extern another input and output ports to the user.
(1) Mask of PIO port number = (1
(2) Mask combination of PIO ports number= (PIO port number mask 1|PIO port number mask 2|……)
Example :
PI02 port number mask=(1
PI010 port number mask =(1
Mask combination of PI02 and PI010 port number=(0x004|0x400)=0x404
Example:
- PI010 and PI02 ports output high level
AT+MPI0=404\r\n
OK
- PI04 port output high level
AT+PI0=004\r\n
OK
- PI010 port output high level
AT+PI0=400\r\n
OK
- All ports output low level
AT+MPI0=0\r\n
OK
- Inquire Bluetooth device
Command Response Parameter
AT+INQ
+INQ: ,,,
……
OK
Param1: Bluetooth address
Param2: device type
Param3: RSSI signal
intensity
Example 1:
at+init\r\n ---- Initialize the SPP profile lib( can’t repeat initialization)
OK
at+iac=9e8b33\r\n ----Inquire Bluetooth device has an access code
OK
at+class=0\r\n ----Inquire the Bluetooth device type
at+inqm=1,9,48\r\n ----Inquire mode: 1) has the RSSI signal intensity indication, 2) stop inquiring if more than 9 Bluetooth devices response, 3) limited time in inquiring is 48*1.28=61.44s.
At+inq\r\n ----inquire the Bluetooth device around
+INQ:2:72:D2224,3E0104,FFBC
+INQ:1234:56:0,1F1F,FFC1
+INQ:1234:56:0,1F1F,FFC0
+INQ:1234:56:0,1F1F,FFC1
+INQ:2:72:D2224,3F0104,FFAD
+INQ:1234:56:0,1F1F,FFBE
+INQ:1234:56:0,1F1F,FFC2
+INQ:1234:56:0,1F1F,FFBE
+INQ:2:72:D2224,3F0104,FFBC
OK
Example 2:
at+iac=9e8b33\r\n ----inquire the Bluetooth device has an access code
OK
at+class=1f1f\r\n ----inquire the Bluetooth device whose device type is 0x1f1f
OK
at+inqm=1,9,48\r\n ----inquire mode: 1) has the RSSI signal intensity indication, 2) stop inquiring if more than 9 Bluetooth devices response, 3) limited time in inquiring is
48*1.28=61.44s
At+inq\r\n ----filter and inquire the Bluetooth device around
+INQ:1234:56:0,1F1F,FFC2
+INQ:1234:56:0,1F1F,FFC1
+INQ:1234:56:0,1F1F,FFC1
+INQ:1234:56:0,1F1F,FFC1
+INQ:1234:56:0,1F1F,FFC2
+INQ:1234:56:0,1F1F,FFC1
+INQ:1234:56:0,1F1F,FFC1
+INQ:1234:56:0,1F1F,FFC0
+INQ:1234:56:0,1F1F,FFC2
OK
Example 3:
at+iac=9e8b3f\r\n ---- inquire the Bluetooth device whose access code is 0x9e8b3f
OK
at+class=1f1f\r\n ----inquire the Bluetooth device whose device type is 0x1f1f
OK
at+inqm=1,1,20\r\n ----inquire mode: 1) Has the RSSI signal intensity indication,
2) stop inquiring if more than 1 Bluetooth device response,
3) limited time in inquiring is 20*1.28=25.6s
At+inq\r\n ----filter and inquire the Bluetooth device around
+INQ:1234:56:ABCDEF,1F1F,FFC2
OK