通常買來的模組會加一塊子板轉成5V,並加入LED。
一般arduino/8051/pic IO運作在5V,所以買加上子板模組方便許多
主要pin
- TX: 接到控制板的RX
- RX: 接到控制板的TX
- VCC: 接到5V
- GND: 接到GND
- SET: 設定模式
HC-05有兩種模式:
- 控制模式: SET拉high(5V)後將模組上電
- 一般模式: SET拉low(0V)後將模組上電
控制模式中可以下AT command來設定模組,一般模式下如果BT與對方SPP接上,則可以當作無線的UART使用
注意!!!
使用AT command設定時,假設是接到PC設定,須在terminal內設定enter對應到\r\n,這樣HC-05才可以吃AT command
HC-05 所有支援的baud rate,通常預設是9600 or 38400,如果不行就只好全部試試看...
- 4800, 9600, 19200, 38400, 57600, 115200, 23400, 460800, 921600, 1382400
出場預設狀態:
①.设备类:0
②.查询码:0x009e8b33
③.模块工作角色:SlaveMode
④.连接模式:指定专用蓝牙设备连接模式
⑤.串口参数:波特率—38400bits/s;停止位:1位;校验位:无
⑥.配对码:“1234”
⑦.设备名称:“H-C-2010-06-01”
常用AT command:
- AT
- 測試模組是否存在,若存在就會回OK
- AT+ORGL
- 回復出場預設值
- AT+NAME
- 取得目前名稱(藍芽搜尋到的裝置名稱): AT+NAME?
- 設定名稱: AT+NAME="XXXXXX"
- AT+ROLE
- 取得目前工作模式: AT+ROLE?
- 設定目前工作模式: AT+ROLE=X
- 工作模式
- 0: SLAVE
- 1: MASTER
- 2: SLAVE-LOOP(同SLAVE,但會回傳所有收到的字,應該是測試用)
- AT+PSWD
- 查看目前密碼: AT+PSWD?
- 設定密碼: AT+PSWD="XXXX"
- AT+UART
- 設定UART: AT+UART=XXX,Y,Z
- XXX:
- baud rate: 4800, 9600, 19200, 38400, 57600, 115200, 23400, 460800, 921600, 1382400
- Y:
- stop bit
- 0: 1bit
- 1: 2bit
- Z:
- parity bit
- 0: none
- 1: odd
- 2: even
相關文件
- 模組介紹
- http://www.wavesen.com/mysys/db_picture/news3/2013911141224101.pdf
- http://www.exp-tech.de/service/datasheet/HC-Serial-Bluetooth-Products.pdf
- at command
- http://www.wavesen.com/mysys/db_picture/news3/2013911155224101.pdf
- 網路相關文章
- https://mbed.org/users/edodm85/notebook/HC-05-bluetooth/
- http://www.yfrobot.com/forum.php?mod=viewthread&tid=4
- http://taktak.co.uk/2013/bluetooth-module-hc-05-bt_board-1-5-configuration/
- http://www.instructables.com/id/Arduino-AND-Bluetooth-HC-05-Connecting-easily/
沒有留言:
張貼留言