- 2Specifications
- 4AT command Default
Overview
HC-05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module, designed for transparent wireless serial connection setup.
Serial port Bluetooth module is fully qualified Bluetooth V2.0+EDR (Enhanced Data Rate) 3Mbps Modulation with complete 2.4GHz radio transceiver and baseband. It uses CSR Bluecore 04-External single chip Bluetooth system with CMOS technology and with AFH(Adaptive Frequency Hopping Feature). It has the footprint as small as 12.7mmx27mm. Hope it will simplify your overall design/development cycle.
Go shopping Serial Port Bluetooth Module (Master/Slave):HC-05 (IM120723009)
HC-05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module, designed for transparent wireless serial connection setup. Serial port Bluetooth module is fully qualified Bluetooth V2.0+EDR (Enhanced Data Rate) 3Mbps Modulation with complete 2.4GHz radio transceiver and baseband. Bluetooth membuat orang dapat bertukar informasi dan data tanpa harus terhubung dan dihubungkan dengan kabel apapun. Dua alat (device) yang berbeda dan ingin bertukar data hanya perlu terhubung atau terknoneksi terlebih dahulu satu sama lain, dan mereka akan bisa saling bertukar data.
Specifications
Hardware Features
![Device Device](/uploads/1/2/5/5/125526251/656378703.png)
- Typical -80dBm sensitivity
- Up to +4dBm RF transmit power
- Low Power 1.8V Operation ,1.8 to 3.6V I/O
- PIO control
- UART interface with programmable baud rate
- With integrated antenna
- With edge connector
Software Features
- Default Baud rate: 38400, Data bits:8, Stop bit:1,Parity:No parity, Data control: has.
Supported baud rate: 9600,19200,38400,57600,115200,230400,460800.
- Given a rising pulse in PIO0, device will be disconnected.
- Status instruction port PIO1: low-disconnected, high-connected;
- PIO10 and PIO11 can be connected to red and blue led separately. When master and slave
are paired, red and blue led blinks 1time/2s in interval, while disconnected only blue led blinks 2times/s.
- Auto-connect to the last device on power as default.
- Permit pairing device to connect as default.
- Auto-pairing PINCODE:”0000” as default
- Auto-reconnect in 30 min when disconnected as a result of beyond the range of connection.
Hardware
PIN Name | PIN # | PAD Type | Description | Note |
GND | 13,21,22 | VSS | Ground Pot | |
3.3 VCC | 12 | 3.3V | Integrated 3.3V(+) supply with On-chip linear regulator output within 3.15-3.3V | |
AIO0 | 9 | Bi-directional | Programmable input/output line | |
AIO1 | 10 | Bi-directional | Programmable input/output line | |
AIO0 | 23 | Bi-directional RX EN | Programmable input/output line, control output for LNA (if fitted) | |
AIO1 | 24 | Bi-directional TX EN | Programmable input/output line, control output for PA (if fitted) |
PIN Name | PIN # | PAD Type | Description | Note |
PIO2 | 25 | Bi-directional | Programmable input/output line | |
PIO3 | 26 | Bi-directional | Programmable input/output line | |
PIO4 | 27 | Bi-directional | Programmable input/output line | |
PIO5 | 28 | Bi-directional | Programmable input/output line | |
PIO6 | 29 | Bi-directional | Programmable input/output line | |
PIO7 | 30 | Bi-directional | Programmable input/output line | |
PIO8 | 31 | Bi-directional | Programmable input/output line | |
PIO9 | 32 | Bi-directional | Programmable input/output line | |
PIO10 | 33 | Bi-directional | Programmable input/output line | |
PIO11 | 34 | Bi-directional | Programmable input/output line |
PIN Name | PIN # | PAD Type | Description | Note |
RESETB | 11 | CMOS input with weak internal pull-up | Reset of low.input debouncde so must be low for >5MS to cause a reset | |
UART_RTS | 4 | CMOS output, tri-stable with weak internal pull-up | UART request to send, active low | |
UART_CTS | 3 | CMOS input with weak internal pull-down | UART clear to send, active low | |
UART_RX | 2 | CMOS input with weak internal pull-down | UART Data input | |
UART_TX | 1 | CMOS output, tri-stable with weak internal pull-up | UART Data output | |
SPI_MOSI | 17 | CMOS input with weak internal pull-down | Serial peripheral interface data input |
PIN Name | PIN # | PAD Type | Description | Note |
SPI_CSB | 16 | CMOS input with weak internal pull-up | Chip select for serial peripheral interface, active low | |
SPI_CLK | 19 | CMOS input with weak internal pull-down | Serial peripheral interface clock | |
SPI_MISO | 18 | CMOS input with weak internal pull-down | Serial peripheral interface data output | |
USB_- | 15 | Bi-directional | ||
USB_+ | 20 | Bi-directional | ||
NC | 14 | |||
PCM_CLK | 5 | Bi-directional | Synchronous PCM data clock | |
PCM_OUT | 6 | CMOS output | Synchronous PCM data output | |
PCM_IN | 7 | CMOS input | Synchronous PCM data input | |
PCM_SYNC | 8 | Bi-directional | Synchronous PCM data strobe |
AT command Default
How to set the mode to server (master):
1. Connect PIO11 to high level.
2. Power on, module into command state.
3. Using baud rate 38400, sent the “AT+ROLE=1rn” to module, with “OKrn” means setting successes.
4. Connect the PIO11 to low level, repower the module, the module work as server (master).
AT commands: (all end with rn)
1. Test command:
Command | Respond | Parameter |
AT | OK | - |
2. Reset
Command | Respond | Parameter |
AT+RESET | OK | - |
3. Get firmware version
Command | Respond | Parameter |
AT+VERSION? | +VERSION:<Param> OK | Param : firmware version |
Example:
AT+VERSION?rn
+VERSION:2.0-20100601
OK
4. Restore default
Command | Respond | Parameter |
AT+ORGL | OK | - |
Default state:
Slave mode, pin code :1234, device name: H-C-2010-06-01 ,Baud 38400bits/s.
5. Get module address
Command | Respond | Parameter |
AT+ADDR? | +ADDR:<Param> OK | Param: address of Bluetooth module |
Bluetooth address: NAP: UAP : LAP
Example:
AT+ADDR?rn
+ADDR:1234:56:abcdef
OK
6. Set/Check module name:
Command | Respond | Parameter |
AT+NAME=<Param> | OK | Param: Bluetooth module name (Default :HC-05) |
AT+NAME? | +NAME:<Param> OK (/FAIL) | Param: Bluetooth module name (Default :HC-05) |
Example:
AT+NAME=HC-05rn set the module name to HC-05
OK
AT+NAME=ITeadStudiorn
OK
AT+NAME?rn
+NAME: ITeadStudio
OK
7. Get the Bluetooth device name:
Command | Respond | Parameter |
AT+RNAME?<Param1> | 1. +NAME:<Param2> OK 2. FAIL | Param1,Param 2 : the address of Bluetooth device |
Example: (Device address 00:02:72:od:22:24,name:ITead)
AT+RNAME? 0002,72,od2224rn
+RNAME:ITead
OK
8. Set/Check module mode:
Command | Respond | Parameter |
AT+ROLE=<Param> | OK | Param: 0- Slave 1-Master 2-Slave-Loop |
AT+ ROLE? | +ROLE:<Param> OK | Param: 0- Slave 1-Master 2-Slave-Loop |
9. Set/Check device class
Command | Respond | Parameter |
AT+CLASS=<Param> | OK | Param: Device Class |
AT+ CLASS? | 1. +CLASS:<Param> OK 2. FAIL | Param: Device Class |
10. Set/Check GIAC (General Inquire Access Code)
Command | Respond | Parameter |
AT+IAC=<Param> | 1.OK 2. FAIL | Param: GIAC (Default : 9e8b33) |
AT+IAC | +IAC:<Param> OK | Param: GIAC (Default : 9e8b33) |
Example:
AT+IAC=9e8b3frn
OK
AT+IAC?rn
+IAC: 9e8b3f
OK
11. Set/Check -- Query access patterns
Command | Respond | Parameter |
AT+INQM=<Param>,<Param2>, <Param3> | 1.OK 2. FAIL | Param: 0——inquiry_mode_standard 1——inquiry_mode_rssi Param2: Maximum number of Bluetooth devices to respond to Param3: Timeout (1-48 : 1.28s to 61.44s) |
AT+ INQM? | +INQM :<Param>,<Param2>, <Param3> OK | Param: 0——inquiry_mode_standard 1——inquiry_mode_rssi Param2: Maximum number of Bluetooth devices to respond to Param3: Timeout (1-48 : 1.28s to 61.44s) |
Example:
AT+INQM=1,9,48rn
OK
AT+INQMrn
+INQM:1, 9, 48
OK
12. Set/Check PIN code:
Command | Respond | Parameter |
AT+PSWD=<Param> | OK | Param: PIN code (Default 1234) |
AT+ PSWD? | + PSWD :<Param> OK | Param: PIN code (Default 1234) |
13. Set/Check serial parameter:
Command | Respond | Parameter |
AT+UART=<Param>,<Param2>,<Param3> | OK | Param1: Baud Param2: Stop bit Param3: Parity |
AT+UART? | +UART=<Param>,<Param2>, <Param3> OK | Param1: Baud Param2: Stop bit Param3: Parity |
Example:
AT+UART=115200,1,2,rn
OK
AT+UART?
+UART:115200,1,2
OK
14. Set/Check connect mode:
Command | Respond | Parameter |
AT+CMODE=<Param> | OK | Param: 0 - connect fixed address 1 - connect any address 2 - slave-Loop |
AT+ CMODE? | + CMODE:<Param> OK | Param: 0 - connect fixed address 1 - connect any address 2 - slave-Loop |
15. Set/Check fixed address:
Command | Respond | Parameter |
AT+BIND=<Param> | OK | Param: Fixed address (Default 00:00:00:00:00:00) |
AT+ BIND? | + BIND:<Param> OK | Param: Fixed address (Default 00:00:00:00:00:00) |
Example:
AT+BIND=1234,56,abcdefrn
OK
AT+BIND?rn
+BIND:1234:56:abcdef
OK
16. Set/Check LED I/O
Command | Respond | Parameter |
AT+POLAR=<Param1,<Param2> | OK | Param1: 0- PIO8 low drive LED 1- PIO8 high drive LED Param2: 0- PIO9 low drive LED 1- PIO9 high drive LED |
AT+ POLAR? | + POLAR=<Param1>,<Param2> OK | Param1: 0- PIO8 low drive LED 1- PIO8 high drive LED Param2: 0- PIO9 low drive LED 1- PIO9 high drive LED |
17. Set PIO output
Command | Respond | Parameter |
AT+PIO=<Param1>,<Param2> | OK | Param1: PIO number Param2: PIO level 0- low 1- high |
Example:
1. PIO10 output high level
AT+PI0=10,1rn
OK
18. Set/Check – scan parameter
Command | Respond | Parameter |
AT+IPSCAN=<Param1>,<Param2>,<Param3>,<Param4> | OK | Param1: Query time interval Param2 : Query duration Param3 : Paging interval Param4 : Call duration |
AT+IPSCAN? | +IPSCAN:<Param1>,<Param2>,<Param3>,<Param4> OK | Param1: Query time interval Param2 : Query duration Param3 : Paging interval Param4 : Call duration |
Example:
AT+IPSCAN =1234,500,1200,250rn
OK
AT+IPSCAN?
+IPSCAN:1234,500,1200,250
19. Set/Check – SHIFF parameter
Command | Respond | Parameter |
AT+SNIFF=<Param1>,<Param2>,<Param3>,<Param4> | OK | Param1: Max time Param2: Min time Param3: Retry time Param4: Time out |
AT+ SNIFF? | +SNIFF:<Param1>,<Param2>,<Param3>,<Param4> OK | Param1: Max time Param2: Min time Param3: Retry time Param4: Time out |
20. Set/Check security mode
Command | Respond | Parameter |
AT+SENM=<Param1>,<Param2> | 1. OK 2. FAIL | Param1: 0——sec_mode0+off 1——sec_mode1+non_secure 2——sec_mode2_service 3——sec_mode3_link 4——sec_mode_unknown Param2: 0——hci_enc_mode_off 1——hci_enc_mode_pt_to_pt 2——hci_enc_mode_pt_to_pt_and_bcast |
AT+ SENM? | + SENM:<Param1>,<Param2> OK | Param1: 0——sec_mode0+off 1——sec_mode1+non_secure 2——sec_mode2_service 3——sec_mode3_link 4——sec_mode_unknown Param2: 0——hci_enc_mode_off 1——hci_enc_mode_pt_to_pt 2——hci_enc_mode_pt_to_pt_and_bcast |
21. Delete Authenticated Device
Command | Respond | Parameter |
AT+PMSAD=<Param> | OK | Param: Authenticated Device Address |
![Bluetooth Bluetooth](/uploads/1/2/5/5/125526251/135210197.jpg)
Example:
AT+PMSAD =1234,56,abcdefrn
OK
22. Delete All Authenticated Device
Command | Respond | Parameter |
AT+ RMAAD | OK | - |
23. Search Authenticated Device
Command | Respond | Parameter |
AT+FSAD=<Param> | 1. OK 2. FAIL | Param: Device address |
24. Get Authenticated Device Count
Command | Respond | Parameter |
AT+ADCN? | +ADCN:<Param> OK | Param: Device Count |
25. Most Recently Used Authenticated Device
Command | Respond | Parameter |
AT+MRAD? | + MRAD:<Param> OK | Param: Recently Authenticated Device Address |
26. Get the module working state
Command | Respond | Parameter |
AT+ STATE? | + STATE:<Param> OK | Param: 'INITIALIZED' 'READY' 'PAIRABLE' 'PAIRED' 'INQUIRING' 'CONNECTING' 'CONNECTED'DISCONNECTED' 'NUKNOW' |
27. Initialize the SPP profile lib
Command | Respond | Parameter |
AT+INIT | 1. OK 2. FAIL | - |
28. Inquiry Bluetooth Device
Command | Respond | Parameter |
AT+INQ | +INQ: <Param1>, <Param2>, <Param3> …. OK | Param1:Address Param2 : Device Class Param3 : RSSI Signal strength |
Example:
AT+INITrn
OK
AT+IAC=9e8b33rn
OK
AT+CLASS=0rn
AT+INQM=1,9,48rn
At+INQrn
+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
29. Cancel Inquiring Bluetooth Device
Command | Respond | Parameter |
AT+ INQC | OK | - |
30. Equipment Matching
Command | Respond | Parameter |
AT+PAIR=<Param1>,<Param2> | 1. OK 2. FAIL | Param1 :Device Address Param2:Time out |
31. Connect Device
Command | Respond | Parameter |
AT+LINK=<Param> | 1. OK 2. FAIL | Param : Device Address |
Example:
AT+FSAD=1234,56,abcdefrn
OK
AT+LINK=1234,56,abcdefrn
OK
32. Disconnect
Command | Respond | Parameter |
AT+DISC | 1. +DISC:SUCCESS OK 2. +DISC:LINK_LOSS OK 3. +DISC:NO_SLC OK 4. +DISC:TIMEOUT OK 5. +DISC:ERROR OK | Param : Device Address |
33. Energy-saving mode
Command | Respond | Parameter |
AT+ENSNIFF=<Param> | OK | Param : Device Address |
34. Exerts Energy-saving mode
Command | Respond | Parameter |
AT+ EXSNIFF =<Param> | OK | Param : Device Address |
Application Example
This is a demo that HC-05 is a master device and communicates to hc-06.
Step 1. Push the mode switch to CMD
Step 2. Power on, module enter command state
Step 3. Using baud rate 38400, send the ―AT+ROLE=1rn‖ to module, with ―OKrn‖ means setting successes.
Step 4. Send ―AT+CMODE=1rn‖, set HC-05 connect to any address, with ―OKrn‖ means setting successes.
Download
Useful Links
Retrieved from 'https://www.itead.cc/wiki/index.php?title=Serial_Port_Bluetooth_Module_(Master/Slave)_:_HC-05&oldid=5846'
Bluetooth Problems
A have an older Lenovo Thinkpad W520 notebook computer running Windows 10 Professional that for the most part has been an ultra reliable workhorse. When it was new from the factory I installed a Samsung 500gb SSD to eliminate the weakest link a Western Digital mechanical hard drive. Life was good until about two years ago when I decided I wanted to regularly pair my Amazon Tap, Sharkk Boombox and a pair of Jabra bluetooth earbuds to the system. Unfortunately the Bluetooth 3.0 on the Thinkpad was flaky. Devices would stop working and I would need to remove them from the system and add them again along with several other tap dances to keep things working. Up until a few days ago I lived with this problem because it was not a big deal. Recently though I have a renewed interest in Lynda.com training courses so I bought an awesome set of Hiearcool L-1 Bluetooth Headphones. I had to solve this problem once and for all.
Frustrated I headed to Amazon and set out to find a new Bluetooth 4.0 USB dongle.
My research on Amazon showed me that there were many USB Bluetooth 4.0 Dongles to choose from and many seemed to be re-branded CSR 4.0 so I bought the one that was actually branded CSR 4.0 for about $12 and in two day Amazon prime had it in my hands.
Installing the CSR 4.0 USB Bluetooth Dongle
Being a Windows 10 computer the Bluetooth adapter should have been plug and play but unfortunately that was not the case. A quick check in Windows 10 device manager showed me the CSR 4.0 was installed but there was an error message. Here we go a simple task is now a project.
My initial thought was that maybe there was a driver needed after all but my research told me that the CSR 4 USB Bluetooth adapter does not require any driver other than what is included with the Windows 10 operating system.
My second thought was there was another device interfering with the installation so I removed my iPhone, Sharkk Boombox and Amazon Tap.Then in Windows Device manager I selected “Show Hidden Devices” and removed any additional Bluetooth devices that are no longer being used. Once that was done I rebooted the computer and reinstalled the CSR Bluetooth adapter. The installation failed again. That was when the answer hit me.
(Solved) CSR 4.0 USB Adapter Won’t Install
The solution is simple. Windows 10 can’t operate two Bluetooth radios at the same time. The Lenovo notebooks internal Bluetooth radio needs to be disabled in order to use the CSR 4 and probably any other USB Bluetooth Adapter.
Update: Hamish Blackall commented the following “USB 3 ports are not recommended” That is worth noting.
USB Bluetooth Installation Guide
In the Windows Search box at the bottom of the screen type “Device Manager” and select the Device Manage from the results
Expand the Bluetooth section
Right click your existing Bluetooth radio and select “Disable device” from the available choices
Insert the CSR 4 or any other USB Bluetooth Adapter into an available USB or USB 2.0 port (USB 3 ports are not recommended)
(Solved) USB Bluetooth Adapter Doesn't Work
Description
Learn how I got a CSR 4 USB Bluetooth adapter to work on a Lenovo W520 Windows 10 notebook computer. The fix should work with numerous other brands as most share the same chipset.
Author
Solved That!
Publisher Logo