SlideShare a Scribd company logo
2
Most read
10
Most read
13
Most read
HC-05 藍芽模組連線
●軟硬體環境準備
※硬體器材
HC-05 藍芽模組(廢話 XD)
電腦一台-用以編輯、編譯程式
Arduino UNO-用以控制藍芽模組連線
Android 手機一支-用以執行連線 App
USB 線材-用以連接 Arduino UNO 與電腦
杜邦線或其他線材-用以連接藍芽模組與 Arduino UNO
麵包板-用於連接周邊元件
※開發軟體工具
Arduino 開發環境-https://www.arduino.cc/en/Main/Software
Android Studio 和 SDK Tools-
https://developer.android.com/studio/index.html
Eclipse IDE for Java EE Developers-
http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/marsr
●藍芽模組主/從(Master/Slave)模式
藍芽連線控制上,分為主控端(Master)設備與從端(Slave)設備,主控端向從端建立連線,
一台主控端(Master)設備可最多控制 7 台從端(Slave)設備。若將 HC-05 作為從端(Slave)設備,
模組通電時需將 KEY 接腳連接至 Ground(即邏輯「0」),便可正常傳輸;若將 HC-05 作為主
控端(Master)設備,電路連接方式與說明請參考以下「●以 AT Command 控制藍芽模組」內容。
●藍芽模組的 LED 燈號
(參考自 http://jackedu.blogspot.tw/2015/01/hc-05.html)
連續的快閃:藍芽等待配對中。
連續的快閃 2 下後停 1 下:藍芽已配對成功,運作中。
連續慢速閃爍(約兩秒一次):藍芽已進入 AT 模式,準備設定。
●以 AT Command 控制藍芽模組
Step1:電路連接
HC-05 RXD → Arduino pin 11
HC-05 TXD → Arduino pin 10
HC-05 GND → Arduino GND
HC-05 VCC50 → Arduino 5V
HC-05 KEY → Arduino pin 9(亦可直接連接至 Vcc)
電路連接說明:
藍芽模組透過 UART 介面傳輸資料,模組上有一組接腳-TxD 與 RxD,應連接至
Arduino UNO 的 RxD 與 TxD,但因 Arduino UNO 硬體定義之 UART 介面已連接至 PC 電
腦端,因此程式需建立一模擬 UART 通訊埠(詳見 Step2,也就是程式中的 BTSerial),軟體
模擬通訊埠可自行定義,在此將 HC-05 模組之 RxD 連接至 Arduino UNO 之 11 腳,TxD 連
接至 Arduino UNO 之 10 腳,因此 Arduino UNO 執行 UART 模擬時,11 腳為 TxD,10 腳
為 RxD。
HC-05 的 KEY 接腳作為藍芽模組工作模式選擇,若通電時連接至 Vcc(即邏輯「1」),
則藍芽模組進入 AT Command 模式,可輸入 AT Command 控制藍芽模組,亦可作為主控端
(Master);若通電時連接至 Ground(即邏輯「0」),則藍芽模組作為 Slave 端執行正常傳輸;
示意如下圖。
Step2 :上 傳至 Arduino 程式參考 如下 : (from http://www.techbitar.com/modify-the-hc-05-
bluetooth-module-defaults-using-at-commands.html)
/*
AUTHOR: Hazim Bitar (techbitar)
DATE: Aug 29, 2013
LICENSE: Public domain (use at your own risk)
CONTACT: techbitar at gmail dot com (techbitar.com)
*/
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(10, 11); // RX | TX
void setup()
{
pinMode(9, OUTPUT);
// this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode
digitalWrite(9, HIGH);
Serial.begin(9600);
Serial.println("Enter AT commands:");
BTSerial.begin(38400); // HC-05 default speed in AT command more
}
void loop()
{
// Keep reading from HC-05 and send to Arduino Serial Monitor
if (BTSerial.available())
Serial.write(BTSerial.read());
// Keep reading from Arduino Serial Monitor and send to HC-05
if (Serial.available())
BTSerial.write(Serial.read());
}
修正上述程式,使終端機顯示已輸入指令:
/*
AUTHOR: Hazim Bitar (techbitar)
Editor: Jimmy Hu
DATE: May 22, 2016
*/
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(10, 11); // RX | TX
void setup()
{
pinMode(9, OUTPUT);
// this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode
digitalWrite(9, HIGH);
Serial.begin(9600);
Serial.print("Enter AT commands:");
BTSerial.begin(38400); // HC-05 default speed in AT command more
}
void loop()
{
// Keep reading from HC-05 and send to Arduino Serial Monitor
if (BTSerial.available())
{
char BTSerial_read;
// 宣告 BTSerial_read 字元變數,用於記錄 BTSerial.read()回傳字元
BTSerial_read = BTSerial.read();
// 將 BTSerial.read()回傳字元填入 BTSerial_read
Serial.write(BTSerial_read);
if(BTSerial_read == 'n')
{
Serial.print("Enter AT commands:");
}
}
// Keep reading from Arduino Serial Monitor and send to HC-05
if (Serial.available())
{
char Serial_read;
// 宣告 Serial_read 字元變數,用於記錄 Serial.read()回傳字元
Serial_read = Serial.read();
// 將 Serial.read()回傳字元填入 Serial_read
Serial.print(Serial_read);
BTSerial.write(Serial_read);
}
}
修正上述程式,將接腳定義於程式開頭。
/*
AUTHOR: Hazim Bitar (techbitar)
DATE: Aug 29, 2013
LICENSE: Public domain (use at your own risk)
CONTACT: techbitar at gmail dot com (techbitar.com)
http://www.techbitar.com/modify-the-hc-05-bluetooth-module-defaults-using-at-commands.html
Editor: Jimmy Hu
DATE: May 22, 2016
*/
//***函式庫引用區***
#include <SoftwareSerial.h> // 引用<SoftwareSerial.h>函式庫
//***定義變數區***
#define Bluetooth_KEY 9
// 定義藍芽傳輸模組 KEY 接腳連接至 arduino 第 9 接腳
#define Bluetooth_RxD 11
// 定義藍芽傳輸模組 RxD 接腳連接至 arduino 第 11 接腳
#define Bluetooth_TxD 10
// 定義藍芽傳輸模組 TxD 接腳連接至 arduino 第 10 接腳
SoftwareSerial BTSerial(Bluetooth_TxD, Bluetooth_RxD);
// 建立軟體定義串列埠 BTSerial,用以控制藍芽模組
void setup() // setup 程式
{ // 進入 setup 程式
pinMode(Bluetooth_KEY, OUTPUT);
// 設定 arduino 連接藍芽傳輸模組 KEY 之接腳為輸出
digitalWrite(Bluetooth_KEY, HIGH);
// 設定藍芽傳輸模組 KEY 接腳為 HIGH(進入 AT command 模式)
Serial.begin(38400);
// 開啟 Serial Port 透過 USB(uart)方式與電腦通信,鮑率為 38400bps (Bits Per Second)
Serial.print("Enter AT commands:"); // 透過 USB(uart)傳輸字串"Enter AT commands:"
BTSerial.begin(38400);
// 設定控制 HC-05 藍芽模組之串列埠 BTSerial 鮑率為 38400bps,
// 此亦為 HC-05 藍芽模組預設鮑率
} // 結束 setup 程式
void loop() // loop 程式
{ // 進入 loop 程式
// Keep reading from HC-05 and send to Arduino Serial Monitor
if (BTSerial.available()) // 若連接至藍芽模組之 Serialport 接收到字元
{ // 進入 if 敘述
char BTSerial_read;
// 宣告 BTSerial_read 字元變數,用於記錄 BTSerial.read()回傳字元
BTSerial_read = BTSerial.read(); // 將 BTSerial.read()回傳字元填入 BTSerial_read
Serial.write(BTSerial_read); // 將 BTSerial_read 回傳至電腦
if(BTSerial_read == 'n') // 若 BTSerial_read 為換行字元
{ // 進入 if 敘述
delay(10); // 延遲 10ms
if(BTSerial.available() == 0) // 若資料傳輸結束
{ // 進入 if 敘述
Serial.print("Enter AT commands:");
// 透過 USB(uart)傳輸字串"Enter AT commands:"
} // 結束 if 敘述
} // 結束 if 敘述
} // 結束 if 敘述
// Keep reading from Arduino Serial Monitor and send to HC-05
if (Serial.available())
// 若與電腦連線之 Serial Port 接收到字元
{ // 進入 if 敘述
char Serial_read;
// 宣告 Serial_read 字元變數,用於記錄 Serial.read()回傳字元
Serial_read = Serial.read(); // 將 Serial.read()回傳字元填入 Serial_read
Serial.print(Serial_read); // 將 Serial_read 字元回傳至電腦
BTSerial.write(Serial_read); // 將 Serial_read 字元傳送至藍芽模組
} // 結束 if 敘述
} // 結束 loop 程式
Step3:開啟 Arduino IDE 的終端機輸入指令
點選「工具」→「序列埠監控視窗」(或鍵盤之 Ctrl+Shift+M)開啟終端機(如下圖)。
以 Step2 之 Arduino 程式為例,串列傳輸鮑率為 9600baud,故終端機亦選擇相同之鮑率;
另依據參考文件說明,AT command is case- sensitive, should end up with terminator (“enter”
or “rn”),意即「結束字元」需與指令一併傳送,故選擇「Both NL & CR」選項(如下圖)。
看到終端機顯示「Enter AT commands:」即可輸入指令;AT command 說明如下。
※測試(Test)指令-AT
指令格式:
指令 回應 回應參數
AT OK 無
結果如下圖。
※重置(Reset)指令-AT+RESET
指令格式:
指令 回應 回應參數
AT+RESET OK 無
結果如下圖。
※取得軟體版本(soft version)-AT+VERSION?
指令格式:
指令 回應 回應參數
AT+VERSION?
+VERSION: <Param>
OK
Param: Version number
結果如下圖。
※重置藍芽狀態-AT+ORGL
指令格式:
指令 回應 回應參數
AT+ORGL OK 無
藍芽模組重置設定如下:
①.Device type: 0
②.Inquire code: 0x009e8b33
③.Module work mode: Slave Mode
④.Connection mode: Connect to the Bluetooth device specified
⑤.Serial parameter: Baud rate: 38400 bits/s; Stop bit: 1 bit; Parity bit: None.
⑥.Passkey: “1234”
⑦.Device name: “H-C-2010-06-01”
更多指令說明請參考 HC-03/05 Embedded Bluetooth Serial Communication Module AT
command set(http://www.techbitar.com/uploads/2/0/3/1/20316977/hc-05_at_commands.pdf)文件,
或 參 考 Serial Port Bluetooth Module (Master/Slave) : HC-
05(http://wiki.iteadstudio.com/Serial_Port_Bluetooth_Module_(Master/Slave)
_:_HC-05)網頁說明。
●HC-05 藍芽模組從端(Slave)正常傳輸模式
Step1:電路連接
HC-05 RXD → Arduino pin 11
HC-05 TXD → Arduino pin 10
HC-05 GND → Arduino GND
HC-05 VCC50 → Arduino 5V
HC-05 KEY → Arduino 9(亦可直接連接至 GND)
Step2:上傳至 Arduino 程式參考如下:
/*
AUTHOR: Jimmy Hu
DATE: May 23, 2016
*/
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(10, 11); // RX | TX
void setup()
{
pinMode(9, OUTPUT);
// this pin will pull the HC-05 pin 34 (key pin) LOW
digitalWrite(9, LOW);
Serial.begin(9600);
//Serial.print("Receive String:");
BTSerial.begin(115200);
}
void loop()
{
// Keep reading from HC-05 and send to Arduino Serial Monitor
if (BTSerial.available())
{
char BTSerial_read;
// 宣告 BTSerial_read 字元變數,用於記錄 BTSerial.read()回傳字元
BTSerial_read = BTSerial.read();
// 將 BTSerial.read()回傳字元填入 BTSerial_read
Serial.write(BTSerial_read);
}
// Keep reading from Arduino Serial Monitor and send to HC-05
if (Serial.available())
{
char Serial_read;
// 宣告 Serial_read 字元變數,用於記錄 Serial.read()回傳字元
Serial_read = Serial.read();
// 將 Serial.read()回傳字元填入 Serial_read
Serial.print(Serial_read);
BTSerial.write(Serial_read);
}
}
完成電路連接與程式編寫、燒錄至 Arduino 後,即可開啟序列埠監控視窗查看藍芽接收
資料。注意:配合程式設計,鮑率請設定為 9600。
●HC-05 藍芽模組與 Android 手機連線傳輸
在此實驗將 HC-05 藍芽模組作為從端(Slave),由 Android 手機作為主控端(Master)建立連
線。
Android 手機端 APP 專案可參考
★Android example to communicate with Bluetooth device, HC-06 Bluetooth Module(英文網頁)
http://android-er.blogspot.tw/2015/07/android-example-to-communicate-with.html
YouTube 影片:
https://www.youtube.com/watch?v=RepIz0gtkxc
★Android communicate with Arduino + HC-06 Bluetooth Module, part II(英文網頁)
http://android-er.blogspot.tw/2015/10/android-communicate-with-arduino-hc-06.html
YouTube 影片:
https://www.youtube.com/watch?v=ItMWHWPWA14
●兩塊 HC-05 藍芽模組對連-Master × 1 + Slave × 1
本實驗進行兩塊 HC-05 藍芽模組對連,將一塊當主控端(Master),另一塊當從端(Slave)。
從端(Slave)的實作方法同上述「●HC-05 藍芽模組從端(Slave)正常傳輸模式」內容。在此主要
討論 HC-05 由預設的 Slave Mode 切換至 Master Mode 方法,並主動建立連線。
由前述之「●以 AT Command 控制藍芽模組」內容中,討論進入 AT Command 模式步驟;
透過 AT Command 即可將藍芽切換至 Master Mode,指令為「AT+ROLE=1」。完整流程敘述如
下:
Step1:
測試 AT Command 是否可正常輸入。
輸入指令「AT」,收到回應「OK」,表示 AT Command 可正常執行。
Step2:
將藍芽模組設定重置。
輸入指令「AT+ORGL」,收到回應「OK」,表示藍芽模組設定已重置。
Step3:
切換至 Master Mode。
輸入指令「AT+ROLE=1」,收到回應「OK」,表示藍芽模組已進入 Master Mode。
Step4:
再次確認藍芽模式。
輸入指令「AT+ROLE?」,收到回應「+ROLE:1」、「OK」,表示當前藍芽為 Master Mode。
Step5:
指定藍芽連線至 Slave 裝置之位址。
輸入指令「AT+CMODE=0」,收到回應「OK」,表示藍芽將連線至指定裝置(依據設定之位址
連線)。
Step6:
重啟藍芽。
輸入指令「AT+RESET」,收到回應「OK」,表示藍芽重置。
Step7:
初始化 SPP profile lib;SPP 定義兩藍芽裝置連線時建立虛擬串列埠的方法。可參考 Serial Port
Profile (SPP):
https://developer.bluetooth.org/TechnologyOverview/Pages/SPP.aspx
★注意:若未初始化 SPP profile lib,將會顯示 ERROR(16)錯誤。
輸入指令「AT+INIT」,收到回應「OK」,表示藍芽 SPP profile lib 已初始化。
Step8:
觀察藍芽模組 LED,為緩慢閃爍狀態,可設定連線至從端(Slave)裝置配對碼。
輸入指令「AT+PSWD=1234」(在此以 1234 為例,需依照實際連線從端裝置配對碼輸入),收
到回應「OK」,代表設定完成。
Step9:
設定詢問模式(inquiring mode)。
輸入指令「AT+INQM=1,9,48」,收到回應「OK」,表示詢問模式(inquiring mode)設定完成。
Step10:
開始詢問(Inquire),將搜尋周遭藍芽裝置。
輸入指令「AT+INQ」,收到回應「+INQ:12:34:567890:1F1F,7FFF」(該參數為藍芽 Address,不
同模組 Address 亦不同)、「OK」。
輸入指令「AT+STATE?」,收到回應「+STATE:INQUIRING」,表示藍芽狀態為 INQUIRING。
Step11:
結束詢問(Inquire)。
輸入指令「AT+INQC」,收到回應「OK」時,需再次輸入指令「AT+STATE?」確認藍芽狀態,
若藍芽回應為「+STATE:INQUIRING」、「OK」,代表藍芽未結束詢問(Inquire),需重啟藍芽
(Step6)、初始化 SPP profile lib(Step7)後再次確認狀態。
Step12:
配對藍芽裝置。
輸入指令「AT+FSAD=1234,56,abcdef」(在此 Slave 裝置 Address 以 12:34:56:ab:cd:ef 為例,實
作時需依照實際連線之 Slave 裝置修改 Address),收到回應「OK」後,再次輸入指令
「AT+STATE?」確認藍芽狀態,若回應為「+STATE:PAIRED」,代表裝置配對成功。
Step13:
輸入指定連線藍芽裝置 Address。
輸入指令「AT+BIND=1234,56,abcdef」(在此 Slave 裝置 Address 以 12:34:56:ab:cd:ef 為例,實
作時需依照實際連線之 Slave 裝置修改 Address),收到回應「OK」,代表將連線至 Address 為
12:34:56:ab:cd:ef 的藍芽裝置。
Step14:
建立藍芽連線。
輸入指令「AT+LINK=1234,56,abcdef」(在此 Slave 裝置 Address 以 12:34:56:ab:cd:ef 為例,實
作時需依照實際連線之 Slave 裝置修改 Address),收到回應「OK」,代表藍芽已連線。
●參考資料
HC-05 藍芽端
HC-05 模組圖
http://wiki.iteadstudio.com/images/3/38/HC-05.jpg
藍芽無線傳輸(Bluetooth)
http://www.hightech.tw/index.php/2012-06-06-14-12-38/27-wireless-communication/368-
bluetooth
Modify The HC-05 Bluetooth Module Defaults Using AT Commands(英文網頁)
http://www.techbitar.com/modify-the-hc-05-bluetooth-module-defaults-using-at-commands.html
HC-05 藍芽模組設定(中文網頁)
http://jackedu.blogspot.tw/2015/01/hc-05.html
Bluetooth AT Commands(PDF 檔)
http://www.techbitar.com/uploads/2/0/3/1/20316977/hc-05_at_commands.pdf
HC-05 Bluetooth Module(PDF 檔)
http://cc.ee.ntu.edu.tw/~ultrasound/belab/course_files/02_bio_signal/Exp3_HC05.pdf
Arduino : HC-05 藍芽模組的設定(中文網頁)
http://gsyan888.blogspot.tw/2014/03/arduino-hc-05.html
HC-05 與 HC-06 藍牙模組補充說明(一)(中文網頁)
http://swf.com.tw/?p=693
HC-05 AT 模式設定(中文網頁)
http://mowei-tw.blogspot.tw/2014/04/hc-05-at.html
Bluetooth HC05- How to pair two modules(英文網頁)
https://alselectro.wordpress.com/2014/10/21/bluetooth-hc05-how-to-pair-two-modules/
HC-05 bluetooth RSSI not working with Arduino-stackoverflow.com(英文網頁)
http://stackoverflow.com/questions/23221336/hc-05-bluetooth-rssi-not-working-with-arduino
★Problems connecting reliably using HC-05 (as bluetooth master)
http://arduino.stackexchange.com/questions/16954/problems-connecting-reliably-using-hc-05-as-
bluetooth-master
Android 手機端
Android 藍牙開發(中文網頁)
http://fecbob.pixnet.net/blog/post/35503513-
android%E8%97%8D%E7%89%99%E9%96%8B%E7%99%BC
Android--Bluetooth-Connection-Code-Sample(github.com)(英文網頁)
https://github.com/theappguruz/Android--Bluetooth-Connection-Code-Sample
Android - Bluetooth Connection Demo(英文網頁)
http://www.theappguruz.com/blog/android-bluetooth-connection-demo
Android APP 藍芽範例說明 – BluetoothChat(中文網頁)
http://han-ya.blogspot.tw/2015/10/android-app-bluetoothchat.html
其他參考資料
Arduino 入門教學(14) – 以 Amarino 連接 Android 與 Arduino (作者:Cooper Maa)(網
頁)
http://programmermagazine.github.io/201402/htm/article1.html
Getting started with amarino(線上簡報)
http://www.slideshare.net/coopermaa/getting-started-with-amarino
[ARDUINO]_用 ANDROID 手機經 BLUETOOTH 遙控 ARDUINO 小車(2012/8/9
UPDATE)(中文網頁)
http://www.ntex.tw/wordpress/463.html
Android Studio: Add jar as library?(英文網頁)
http://stackoverflow.com/questions/16608135/android-studio-add-jar-as-library
Have no libs directory in Android Studio(英文網頁)
http://stackoverflow.com/questions/26956827/have-no-libs-directory-in-android-studio
DATA TRANSFER BETWEEN ANDROID AND ARDUINO VIA BLUETOOTH(英文網頁)
http://solderer.tv/data-transfer-between-android-and-arduino-via-bluetooth/
★Android example to communicate with Bluetooth device, HC-06 Bluetooth Module(英文網
頁)
http://android-er.blogspot.tw/2015/07/android-example-to-communicate-with.html
★Android communicate with Arduino + HC-06 Bluetooth Module, part II(英文網頁)
http://android-er.blogspot.tw/2015/10/android-communicate-with-arduino-hc-06.html
Connect Arduino Due with HC-06 (Bluetooth Module)(英文網頁)
http://arduino-er.blogspot.tw/2015/07/connect-arduino-due-with-hc-06.html
Raspberry Pi 3 Bluetooth Setup
https://www.raspberrypi.org/forums/viewtopic.php?t=138145&f=28

More Related Content

PDF
Arduino藍牙傳輸應用
PDF
Arduino 底層原始碼解析心得
PDF
PDF
[嵌入式系統] MCS-51 實驗 - 使用 IAR (1)
PDF
Arduino序列通訊應用
PDF
Arduino序列通訊
PPTX
Introduction to Arduino and Hands on to Iot
PDF
mBot 教學10 藍牙控制應用
Arduino藍牙傳輸應用
Arduino 底層原始碼解析心得
[嵌入式系統] MCS-51 實驗 - 使用 IAR (1)
Arduino序列通訊應用
Arduino序列通訊
Introduction to Arduino and Hands on to Iot
mBot 教學10 藍牙控制應用

What's hot (20)

PDF
Verilog HDL CODES
PDF
ESP32 WiFi & Bluetooth Module - Getting Started Guide
PPS
Arduino Uno Pin Description
PDF
エルスピーナヴェインズ株式会社・会社概要
PDF
深入淺出C語言
PDF
Arduino感測應用
PDF
Lcu14 107- op-tee on ar mv8
PPTX
Introduction to Arduino
PPTX
Linux PCI device driver
PDF
Arduino應用系統設計 - 導論
PDF
Linux dma engine
PDF
T-states in microprocessor 8085
PDF
Windows Azure の中でも動いている InfiniBand って何?
PDF
BusyBox for Embedded Linux
PDF
[ZigBee 嵌入式系統] ZigBee Architecture 與 TI Z-Stack Firmware
PPT
BLDC FOC 控制原理
PPTX
Formation Bus de Terrain _Partie 3_2 _ProfiNet
PDF
Kernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMI
PPTX
Introduction to Arduino
PDF
Verilator: Fast, Free, But for Me?
Verilog HDL CODES
ESP32 WiFi & Bluetooth Module - Getting Started Guide
Arduino Uno Pin Description
エルスピーナヴェインズ株式会社・会社概要
深入淺出C語言
Arduino感測應用
Lcu14 107- op-tee on ar mv8
Introduction to Arduino
Linux PCI device driver
Arduino應用系統設計 - 導論
Linux dma engine
T-states in microprocessor 8085
Windows Azure の中でも動いている InfiniBand って何?
BusyBox for Embedded Linux
[ZigBee 嵌入式系統] ZigBee Architecture 與 TI Z-Stack Firmware
BLDC FOC 控制原理
Formation Bus de Terrain _Partie 3_2 _ProfiNet
Kernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMI
Introduction to Arduino
Verilator: Fast, Free, But for Me?
Ad

Similar to HC 05藍芽模組連線 (20)

PDF
Arduino 習作工坊 - Lesson 4 通訊之夜
PPT
認識 RoBoard 硬體
PPT
Robotis Servo 與 RoBoard 之連接介面
PDF
20170415- 智慧空調通訊系統實務_柯大
DOC
嵌入式inux應用專題文件-智慧家庭系統
PDF
Arduino overview
PDF
Arduino overview
PDF
Sy03091说明书
PDF
Arduino Basic
PDF
nodeMCU IOT教學03 - NodeMCU導論
PDF
nodeMCU IOT教學03 - NodeMCU導論
PPTX
物聯網技術分享 使用ESP8266
PDF
Arduino應用系統設計 - Arduino程式快速入門
PDF
Stm32 technical slide_pdf
PDF
Arduino程式快速入門
PPTX
LinkIt ONE tutorial #1- Basics
PDF
AMA 中級術科實作III
PDF
竞赛中C++语言拾遗
PPTX
LinkIt Smart 7688程式開發
PDF
Arduino 習作工坊 - Lesson 4 通訊之夜
認識 RoBoard 硬體
Robotis Servo 與 RoBoard 之連接介面
20170415- 智慧空調通訊系統實務_柯大
嵌入式inux應用專題文件-智慧家庭系統
Arduino overview
Arduino overview
Sy03091说明书
Arduino Basic
nodeMCU IOT教學03 - NodeMCU導論
nodeMCU IOT教學03 - NodeMCU導論
物聯網技術分享 使用ESP8266
Arduino應用系統設計 - Arduino程式快速入門
Stm32 technical slide_pdf
Arduino程式快速入門
LinkIt ONE tutorial #1- Basics
AMA 中級術科實作III
竞赛中C++语言拾遗
LinkIt Smart 7688程式開發
Ad

More from Chen-Hung Hu (12)

PDF
ParallelProgrammingBasics_v2.pdf
PDF
淺談電腦檔案系統概念
PDF
【智慧核心-CPU】第三節:負數、小數的修正機制
PDF
【智慧核心-CPU】第二節:正整數進位制的轉換-編碼
PDF
漫談七段顯示器
PDF
BJT Transistor分壓偏壓電路分析
PDF
淺談類比-數位轉換器
DOCX
感光元件及其相關迴路之研究 --以光敏電阻為例
PDF
穩壓元件及其相關迴路之研究 --以可調式輸出電源供應器為例
PDF
Adc0804及其相關迴路之研究
PDF
可調式電源供應器之研究
PDF
自動功因改善裝置之研究
ParallelProgrammingBasics_v2.pdf
淺談電腦檔案系統概念
【智慧核心-CPU】第三節:負數、小數的修正機制
【智慧核心-CPU】第二節:正整數進位制的轉換-編碼
漫談七段顯示器
BJT Transistor分壓偏壓電路分析
淺談類比-數位轉換器
感光元件及其相關迴路之研究 --以光敏電阻為例
穩壓元件及其相關迴路之研究 --以可調式輸出電源供應器為例
Adc0804及其相關迴路之研究
可調式電源供應器之研究
自動功因改善裝置之研究

HC 05藍芽模組連線

  • 1. HC-05 藍芽模組連線 ●軟硬體環境準備 ※硬體器材 HC-05 藍芽模組(廢話 XD) 電腦一台-用以編輯、編譯程式 Arduino UNO-用以控制藍芽模組連線 Android 手機一支-用以執行連線 App USB 線材-用以連接 Arduino UNO 與電腦 杜邦線或其他線材-用以連接藍芽模組與 Arduino UNO 麵包板-用於連接周邊元件 ※開發軟體工具 Arduino 開發環境-https://www.arduino.cc/en/Main/Software Android Studio 和 SDK Tools- https://developer.android.com/studio/index.html Eclipse IDE for Java EE Developers- http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/marsr ●藍芽模組主/從(Master/Slave)模式 藍芽連線控制上,分為主控端(Master)設備與從端(Slave)設備,主控端向從端建立連線, 一台主控端(Master)設備可最多控制 7 台從端(Slave)設備。若將 HC-05 作為從端(Slave)設備, 模組通電時需將 KEY 接腳連接至 Ground(即邏輯「0」),便可正常傳輸;若將 HC-05 作為主 控端(Master)設備,電路連接方式與說明請參考以下「●以 AT Command 控制藍芽模組」內容。 ●藍芽模組的 LED 燈號 (參考自 http://jackedu.blogspot.tw/2015/01/hc-05.html) 連續的快閃:藍芽等待配對中。 連續的快閃 2 下後停 1 下:藍芽已配對成功,運作中。 連續慢速閃爍(約兩秒一次):藍芽已進入 AT 模式,準備設定。
  • 2. ●以 AT Command 控制藍芽模組 Step1:電路連接 HC-05 RXD → Arduino pin 11 HC-05 TXD → Arduino pin 10 HC-05 GND → Arduino GND HC-05 VCC50 → Arduino 5V HC-05 KEY → Arduino pin 9(亦可直接連接至 Vcc) 電路連接說明: 藍芽模組透過 UART 介面傳輸資料,模組上有一組接腳-TxD 與 RxD,應連接至 Arduino UNO 的 RxD 與 TxD,但因 Arduino UNO 硬體定義之 UART 介面已連接至 PC 電 腦端,因此程式需建立一模擬 UART 通訊埠(詳見 Step2,也就是程式中的 BTSerial),軟體 模擬通訊埠可自行定義,在此將 HC-05 模組之 RxD 連接至 Arduino UNO 之 11 腳,TxD 連 接至 Arduino UNO 之 10 腳,因此 Arduino UNO 執行 UART 模擬時,11 腳為 TxD,10 腳 為 RxD。 HC-05 的 KEY 接腳作為藍芽模組工作模式選擇,若通電時連接至 Vcc(即邏輯「1」), 則藍芽模組進入 AT Command 模式,可輸入 AT Command 控制藍芽模組,亦可作為主控端 (Master);若通電時連接至 Ground(即邏輯「0」),則藍芽模組作為 Slave 端執行正常傳輸; 示意如下圖。 Step2 :上 傳至 Arduino 程式參考 如下 : (from http://www.techbitar.com/modify-the-hc-05- bluetooth-module-defaults-using-at-commands.html) /* AUTHOR: Hazim Bitar (techbitar) DATE: Aug 29, 2013 LICENSE: Public domain (use at your own risk) CONTACT: techbitar at gmail dot com (techbitar.com)
  • 3. */ #include <SoftwareSerial.h> SoftwareSerial BTSerial(10, 11); // RX | TX void setup() { pinMode(9, OUTPUT); // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode digitalWrite(9, HIGH); Serial.begin(9600); Serial.println("Enter AT commands:"); BTSerial.begin(38400); // HC-05 default speed in AT command more } void loop() { // Keep reading from HC-05 and send to Arduino Serial Monitor if (BTSerial.available()) Serial.write(BTSerial.read()); // Keep reading from Arduino Serial Monitor and send to HC-05 if (Serial.available()) BTSerial.write(Serial.read()); } 修正上述程式,使終端機顯示已輸入指令: /* AUTHOR: Hazim Bitar (techbitar) Editor: Jimmy Hu DATE: May 22, 2016 */ #include <SoftwareSerial.h> SoftwareSerial BTSerial(10, 11); // RX | TX void setup() { pinMode(9, OUTPUT); // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode digitalWrite(9, HIGH); Serial.begin(9600); Serial.print("Enter AT commands:"); BTSerial.begin(38400); // HC-05 default speed in AT command more } void loop()
  • 4. { // Keep reading from HC-05 and send to Arduino Serial Monitor if (BTSerial.available()) { char BTSerial_read; // 宣告 BTSerial_read 字元變數,用於記錄 BTSerial.read()回傳字元 BTSerial_read = BTSerial.read(); // 將 BTSerial.read()回傳字元填入 BTSerial_read Serial.write(BTSerial_read); if(BTSerial_read == 'n') { Serial.print("Enter AT commands:"); } } // Keep reading from Arduino Serial Monitor and send to HC-05 if (Serial.available()) { char Serial_read; // 宣告 Serial_read 字元變數,用於記錄 Serial.read()回傳字元 Serial_read = Serial.read(); // 將 Serial.read()回傳字元填入 Serial_read Serial.print(Serial_read); BTSerial.write(Serial_read); } } 修正上述程式,將接腳定義於程式開頭。 /* AUTHOR: Hazim Bitar (techbitar) DATE: Aug 29, 2013 LICENSE: Public domain (use at your own risk) CONTACT: techbitar at gmail dot com (techbitar.com) http://www.techbitar.com/modify-the-hc-05-bluetooth-module-defaults-using-at-commands.html Editor: Jimmy Hu DATE: May 22, 2016 */ //***函式庫引用區*** #include <SoftwareSerial.h> // 引用<SoftwareSerial.h>函式庫 //***定義變數區*** #define Bluetooth_KEY 9 // 定義藍芽傳輸模組 KEY 接腳連接至 arduino 第 9 接腳
  • 5. #define Bluetooth_RxD 11 // 定義藍芽傳輸模組 RxD 接腳連接至 arduino 第 11 接腳 #define Bluetooth_TxD 10 // 定義藍芽傳輸模組 TxD 接腳連接至 arduino 第 10 接腳 SoftwareSerial BTSerial(Bluetooth_TxD, Bluetooth_RxD); // 建立軟體定義串列埠 BTSerial,用以控制藍芽模組 void setup() // setup 程式 { // 進入 setup 程式 pinMode(Bluetooth_KEY, OUTPUT); // 設定 arduino 連接藍芽傳輸模組 KEY 之接腳為輸出 digitalWrite(Bluetooth_KEY, HIGH); // 設定藍芽傳輸模組 KEY 接腳為 HIGH(進入 AT command 模式) Serial.begin(38400); // 開啟 Serial Port 透過 USB(uart)方式與電腦通信,鮑率為 38400bps (Bits Per Second) Serial.print("Enter AT commands:"); // 透過 USB(uart)傳輸字串"Enter AT commands:" BTSerial.begin(38400); // 設定控制 HC-05 藍芽模組之串列埠 BTSerial 鮑率為 38400bps, // 此亦為 HC-05 藍芽模組預設鮑率 } // 結束 setup 程式 void loop() // loop 程式 { // 進入 loop 程式 // Keep reading from HC-05 and send to Arduino Serial Monitor if (BTSerial.available()) // 若連接至藍芽模組之 Serialport 接收到字元 { // 進入 if 敘述 char BTSerial_read; // 宣告 BTSerial_read 字元變數,用於記錄 BTSerial.read()回傳字元 BTSerial_read = BTSerial.read(); // 將 BTSerial.read()回傳字元填入 BTSerial_read Serial.write(BTSerial_read); // 將 BTSerial_read 回傳至電腦 if(BTSerial_read == 'n') // 若 BTSerial_read 為換行字元 { // 進入 if 敘述 delay(10); // 延遲 10ms if(BTSerial.available() == 0) // 若資料傳輸結束 { // 進入 if 敘述 Serial.print("Enter AT commands:"); // 透過 USB(uart)傳輸字串"Enter AT commands:" } // 結束 if 敘述 } // 結束 if 敘述 } // 結束 if 敘述 // Keep reading from Arduino Serial Monitor and send to HC-05 if (Serial.available())
  • 6. // 若與電腦連線之 Serial Port 接收到字元 { // 進入 if 敘述 char Serial_read; // 宣告 Serial_read 字元變數,用於記錄 Serial.read()回傳字元 Serial_read = Serial.read(); // 將 Serial.read()回傳字元填入 Serial_read Serial.print(Serial_read); // 將 Serial_read 字元回傳至電腦 BTSerial.write(Serial_read); // 將 Serial_read 字元傳送至藍芽模組 } // 結束 if 敘述 } // 結束 loop 程式 Step3:開啟 Arduino IDE 的終端機輸入指令 點選「工具」→「序列埠監控視窗」(或鍵盤之 Ctrl+Shift+M)開啟終端機(如下圖)。 以 Step2 之 Arduino 程式為例,串列傳輸鮑率為 9600baud,故終端機亦選擇相同之鮑率; 另依據參考文件說明,AT command is case- sensitive, should end up with terminator (“enter” or “rn”),意即「結束字元」需與指令一併傳送,故選擇「Both NL & CR」選項(如下圖)。
  • 7. 看到終端機顯示「Enter AT commands:」即可輸入指令;AT command 說明如下。 ※測試(Test)指令-AT 指令格式: 指令 回應 回應參數 AT OK 無 結果如下圖。 ※重置(Reset)指令-AT+RESET 指令格式: 指令 回應 回應參數 AT+RESET OK 無 結果如下圖。
  • 8. ※取得軟體版本(soft version)-AT+VERSION? 指令格式: 指令 回應 回應參數 AT+VERSION? +VERSION: <Param> OK Param: Version number 結果如下圖。 ※重置藍芽狀態-AT+ORGL 指令格式: 指令 回應 回應參數 AT+ORGL OK 無 藍芽模組重置設定如下: ①.Device type: 0 ②.Inquire code: 0x009e8b33 ③.Module work mode: Slave Mode ④.Connection mode: Connect to the Bluetooth device specified
  • 9. ⑤.Serial parameter: Baud rate: 38400 bits/s; Stop bit: 1 bit; Parity bit: None. ⑥.Passkey: “1234” ⑦.Device name: “H-C-2010-06-01” 更多指令說明請參考 HC-03/05 Embedded Bluetooth Serial Communication Module AT command set(http://www.techbitar.com/uploads/2/0/3/1/20316977/hc-05_at_commands.pdf)文件, 或 參 考 Serial Port Bluetooth Module (Master/Slave) : HC- 05(http://wiki.iteadstudio.com/Serial_Port_Bluetooth_Module_(Master/Slave) _:_HC-05)網頁說明。
  • 10. ●HC-05 藍芽模組從端(Slave)正常傳輸模式 Step1:電路連接 HC-05 RXD → Arduino pin 11 HC-05 TXD → Arduino pin 10 HC-05 GND → Arduino GND HC-05 VCC50 → Arduino 5V HC-05 KEY → Arduino 9(亦可直接連接至 GND) Step2:上傳至 Arduino 程式參考如下: /* AUTHOR: Jimmy Hu DATE: May 23, 2016 */ #include <SoftwareSerial.h> SoftwareSerial BTSerial(10, 11); // RX | TX void setup() { pinMode(9, OUTPUT); // this pin will pull the HC-05 pin 34 (key pin) LOW digitalWrite(9, LOW); Serial.begin(9600); //Serial.print("Receive String:"); BTSerial.begin(115200); } void loop() { // Keep reading from HC-05 and send to Arduino Serial Monitor if (BTSerial.available()) { char BTSerial_read; // 宣告 BTSerial_read 字元變數,用於記錄 BTSerial.read()回傳字元 BTSerial_read = BTSerial.read(); // 將 BTSerial.read()回傳字元填入 BTSerial_read Serial.write(BTSerial_read); } // Keep reading from Arduino Serial Monitor and send to HC-05 if (Serial.available()) {
  • 11. char Serial_read; // 宣告 Serial_read 字元變數,用於記錄 Serial.read()回傳字元 Serial_read = Serial.read(); // 將 Serial.read()回傳字元填入 Serial_read Serial.print(Serial_read); BTSerial.write(Serial_read); } } 完成電路連接與程式編寫、燒錄至 Arduino 後,即可開啟序列埠監控視窗查看藍芽接收 資料。注意:配合程式設計,鮑率請設定為 9600。
  • 12. ●HC-05 藍芽模組與 Android 手機連線傳輸 在此實驗將 HC-05 藍芽模組作為從端(Slave),由 Android 手機作為主控端(Master)建立連 線。 Android 手機端 APP 專案可參考 ★Android example to communicate with Bluetooth device, HC-06 Bluetooth Module(英文網頁) http://android-er.blogspot.tw/2015/07/android-example-to-communicate-with.html YouTube 影片: https://www.youtube.com/watch?v=RepIz0gtkxc ★Android communicate with Arduino + HC-06 Bluetooth Module, part II(英文網頁) http://android-er.blogspot.tw/2015/10/android-communicate-with-arduino-hc-06.html YouTube 影片: https://www.youtube.com/watch?v=ItMWHWPWA14
  • 13. ●兩塊 HC-05 藍芽模組對連-Master × 1 + Slave × 1 本實驗進行兩塊 HC-05 藍芽模組對連,將一塊當主控端(Master),另一塊當從端(Slave)。 從端(Slave)的實作方法同上述「●HC-05 藍芽模組從端(Slave)正常傳輸模式」內容。在此主要 討論 HC-05 由預設的 Slave Mode 切換至 Master Mode 方法,並主動建立連線。 由前述之「●以 AT Command 控制藍芽模組」內容中,討論進入 AT Command 模式步驟; 透過 AT Command 即可將藍芽切換至 Master Mode,指令為「AT+ROLE=1」。完整流程敘述如 下: Step1: 測試 AT Command 是否可正常輸入。 輸入指令「AT」,收到回應「OK」,表示 AT Command 可正常執行。 Step2: 將藍芽模組設定重置。 輸入指令「AT+ORGL」,收到回應「OK」,表示藍芽模組設定已重置。 Step3: 切換至 Master Mode。 輸入指令「AT+ROLE=1」,收到回應「OK」,表示藍芽模組已進入 Master Mode。 Step4: 再次確認藍芽模式。 輸入指令「AT+ROLE?」,收到回應「+ROLE:1」、「OK」,表示當前藍芽為 Master Mode。 Step5: 指定藍芽連線至 Slave 裝置之位址。 輸入指令「AT+CMODE=0」,收到回應「OK」,表示藍芽將連線至指定裝置(依據設定之位址 連線)。 Step6: 重啟藍芽。 輸入指令「AT+RESET」,收到回應「OK」,表示藍芽重置。 Step7: 初始化 SPP profile lib;SPP 定義兩藍芽裝置連線時建立虛擬串列埠的方法。可參考 Serial Port Profile (SPP): https://developer.bluetooth.org/TechnologyOverview/Pages/SPP.aspx ★注意:若未初始化 SPP profile lib,將會顯示 ERROR(16)錯誤。
  • 14. 輸入指令「AT+INIT」,收到回應「OK」,表示藍芽 SPP profile lib 已初始化。 Step8: 觀察藍芽模組 LED,為緩慢閃爍狀態,可設定連線至從端(Slave)裝置配對碼。 輸入指令「AT+PSWD=1234」(在此以 1234 為例,需依照實際連線從端裝置配對碼輸入),收 到回應「OK」,代表設定完成。 Step9: 設定詢問模式(inquiring mode)。 輸入指令「AT+INQM=1,9,48」,收到回應「OK」,表示詢問模式(inquiring mode)設定完成。 Step10: 開始詢問(Inquire),將搜尋周遭藍芽裝置。 輸入指令「AT+INQ」,收到回應「+INQ:12:34:567890:1F1F,7FFF」(該參數為藍芽 Address,不 同模組 Address 亦不同)、「OK」。 輸入指令「AT+STATE?」,收到回應「+STATE:INQUIRING」,表示藍芽狀態為 INQUIRING。 Step11: 結束詢問(Inquire)。 輸入指令「AT+INQC」,收到回應「OK」時,需再次輸入指令「AT+STATE?」確認藍芽狀態, 若藍芽回應為「+STATE:INQUIRING」、「OK」,代表藍芽未結束詢問(Inquire),需重啟藍芽 (Step6)、初始化 SPP profile lib(Step7)後再次確認狀態。 Step12: 配對藍芽裝置。 輸入指令「AT+FSAD=1234,56,abcdef」(在此 Slave 裝置 Address 以 12:34:56:ab:cd:ef 為例,實 作時需依照實際連線之 Slave 裝置修改 Address),收到回應「OK」後,再次輸入指令 「AT+STATE?」確認藍芽狀態,若回應為「+STATE:PAIRED」,代表裝置配對成功。 Step13: 輸入指定連線藍芽裝置 Address。 輸入指令「AT+BIND=1234,56,abcdef」(在此 Slave 裝置 Address 以 12:34:56:ab:cd:ef 為例,實 作時需依照實際連線之 Slave 裝置修改 Address),收到回應「OK」,代表將連線至 Address 為 12:34:56:ab:cd:ef 的藍芽裝置。 Step14: 建立藍芽連線。 輸入指令「AT+LINK=1234,56,abcdef」(在此 Slave 裝置 Address 以 12:34:56:ab:cd:ef 為例,實 作時需依照實際連線之 Slave 裝置修改 Address),收到回應「OK」,代表藍芽已連線。
  • 15. ●參考資料 HC-05 藍芽端 HC-05 模組圖 http://wiki.iteadstudio.com/images/3/38/HC-05.jpg 藍芽無線傳輸(Bluetooth) http://www.hightech.tw/index.php/2012-06-06-14-12-38/27-wireless-communication/368- bluetooth Modify The HC-05 Bluetooth Module Defaults Using AT Commands(英文網頁) http://www.techbitar.com/modify-the-hc-05-bluetooth-module-defaults-using-at-commands.html HC-05 藍芽模組設定(中文網頁) http://jackedu.blogspot.tw/2015/01/hc-05.html Bluetooth AT Commands(PDF 檔) http://www.techbitar.com/uploads/2/0/3/1/20316977/hc-05_at_commands.pdf HC-05 Bluetooth Module(PDF 檔) http://cc.ee.ntu.edu.tw/~ultrasound/belab/course_files/02_bio_signal/Exp3_HC05.pdf Arduino : HC-05 藍芽模組的設定(中文網頁) http://gsyan888.blogspot.tw/2014/03/arduino-hc-05.html HC-05 與 HC-06 藍牙模組補充說明(一)(中文網頁) http://swf.com.tw/?p=693 HC-05 AT 模式設定(中文網頁) http://mowei-tw.blogspot.tw/2014/04/hc-05-at.html Bluetooth HC05- How to pair two modules(英文網頁) https://alselectro.wordpress.com/2014/10/21/bluetooth-hc05-how-to-pair-two-modules/ HC-05 bluetooth RSSI not working with Arduino-stackoverflow.com(英文網頁) http://stackoverflow.com/questions/23221336/hc-05-bluetooth-rssi-not-working-with-arduino
  • 16. ★Problems connecting reliably using HC-05 (as bluetooth master) http://arduino.stackexchange.com/questions/16954/problems-connecting-reliably-using-hc-05-as- bluetooth-master Android 手機端 Android 藍牙開發(中文網頁) http://fecbob.pixnet.net/blog/post/35503513- android%E8%97%8D%E7%89%99%E9%96%8B%E7%99%BC Android--Bluetooth-Connection-Code-Sample(github.com)(英文網頁) https://github.com/theappguruz/Android--Bluetooth-Connection-Code-Sample Android - Bluetooth Connection Demo(英文網頁) http://www.theappguruz.com/blog/android-bluetooth-connection-demo Android APP 藍芽範例說明 – BluetoothChat(中文網頁) http://han-ya.blogspot.tw/2015/10/android-app-bluetoothchat.html 其他參考資料 Arduino 入門教學(14) – 以 Amarino 連接 Android 與 Arduino (作者:Cooper Maa)(網 頁) http://programmermagazine.github.io/201402/htm/article1.html Getting started with amarino(線上簡報) http://www.slideshare.net/coopermaa/getting-started-with-amarino [ARDUINO]_用 ANDROID 手機經 BLUETOOTH 遙控 ARDUINO 小車(2012/8/9 UPDATE)(中文網頁) http://www.ntex.tw/wordpress/463.html Android Studio: Add jar as library?(英文網頁) http://stackoverflow.com/questions/16608135/android-studio-add-jar-as-library Have no libs directory in Android Studio(英文網頁) http://stackoverflow.com/questions/26956827/have-no-libs-directory-in-android-studio DATA TRANSFER BETWEEN ANDROID AND ARDUINO VIA BLUETOOTH(英文網頁) http://solderer.tv/data-transfer-between-android-and-arduino-via-bluetooth/ ★Android example to communicate with Bluetooth device, HC-06 Bluetooth Module(英文網 頁) http://android-er.blogspot.tw/2015/07/android-example-to-communicate-with.html
  • 17. ★Android communicate with Arduino + HC-06 Bluetooth Module, part II(英文網頁) http://android-er.blogspot.tw/2015/10/android-communicate-with-arduino-hc-06.html Connect Arduino Due with HC-06 (Bluetooth Module)(英文網頁) http://arduino-er.blogspot.tw/2015/07/connect-arduino-due-with-hc-06.html Raspberry Pi 3 Bluetooth Setup https://www.raspberrypi.org/forums/viewtopic.php?t=138145&f=28