This guide only cover the HC05 Bluetooth Module with the breakout module. the HC05 / HC06 Bluetooth module, This modules uses BlueCore is a single chip radio and baseband IC for Bluetooth 2.4GHz system including enhance data rates (EDR) to 3Mbps.
The BC417143B interfaces to 8Mbit of external flash memory. When used with the CSR Bluetooth software stack, it provides a fully compliant Bluetooth system to version 2.0 of the specification for data and voice communication.
The chip BlueCore has been designed to reduce the number of external components required. The device incorporates auto-calibration and built in self-test BIST routine to simplify the development. All hardware and device firmware is fully complaints with the Bluetooth version 2.0 plus EDR specification.
This module default baud rate is 9600, it is very slow for a high-speed transmission, The HC05 module can go as high as 1382400 baud rate according to the datasheet and also it has a default device name of HC-05, even the HC06 the default name is HC-05.
Note: The HC-03-06 Breakout system works only on 3.3 volts, however the shield of the HCXX module uses regulator and logic converter / logic divider to accommodate input voltage of 5v.
HCXX Breakout Pinout Diagram
Wiring Guide with Arduino Board
Getting AT-Command with Arduino IDE
Wiring Guide with TTL UART
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
/***************************** PROGRAMMING THE HC05 WITH TTL/UART USB AS SLAVE 1. Open your serial tools 2. Select communication port 3. Select 38400 boud rate 4. Run 5. Enter the Command Below ******************************/ AT+ADDR? +ADDR:11:3:252016 OK AT+UART? +UART:9600,0,0 OK AT+ROLE? +ROLE:0 OK /***************************** PROGRAMMING THE HC05 WITH TTL/UART USB AS MASTER 1. Open your serial tools 2. Select communication port 3. Select 38400 boud rate 4. Run 5. Enter the Command Below ******************************/ AT+UART? +UART:115200,0,0 OK AT+UART=9600,0,0 OK AT+UART? +UART:9600,0,0 OK AT+ROLE? +ROLE:0 OK AT+ROLE=1 +ROLE:1 OK AT+ROLE? +ROLE:1 OK /***************************** PROGRAMMING THE HC05 WITH TTL/UART USB AS AUTOMATIC CONNECTION TO THE SLAVE CONNECTING 2 HC05 1. Open your serial tools 2. Select communication port 3. Select 38400 boud rate 4. Run 5. Enter the Command Below ******************************/ AT+CMODE? +CMOD:0 OK AT+BIND=11,3,252016 OK AT+BIND? +BIND:11:3:252016 OK |
Software Required
AT Command List & Error Codes
Sketch Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
/* 14CORE TEST CODE FOR BLUETOOTH MODULE SETTING UP AS MASTER or SLAVE MODE http://www.14core.com */ #include <NewSoftSerial.h> // Software Serial Port D2 and D3 #define RxD 2 //Optional if you want to used software serial #define TxD 3 //Optional if you want to used software serial NewSoftSerial blueToothSerial(RxD,TxD); void setup() { Serial.begin(9600); //Serial port for debugging, pinMode(RxD, INPUT); pinMode(TxD, OUTPUT); setupBlueToothConnection(); Serial.println("14CORE HCXX Bluetooth AT Command Utility") Serial.println("You need to set Serial Monitor to 'Both NL & CR' and use '9600 Baud' rate at bottom right"); delay(2000); Serial.println("Input you AT Command Set"); } void loop() { if(blueToothSerial.read() == 'a') { blueToothSerial.println("You are connected to Bluetooth Bee"); //You can write you BT communication logic here } } void setupBlueToothConnection() { Serial.print("14CORE BLuetooth XBEE Test Code"); Serial.print("Setting up Bluetooth link"); //For debugging, Comment this line if not required blueToothSerial.begin(38400); //Set BluetoothBee BaudRate to default baud rate 38400 delay(1000); sendBlueToothCommand("\r\n+STWMOD=0\r\n"); // Set as Slave Mode sendBlueToothCommand("\r\n+STNA=14CORE-MASTER-BL\r\n"); sendBlueToothCommand("\r\n+STAUTO=0\r\n"); //Close the function sendBlueToothCommand("\r\n+STOAUT=1\r\n"); //Open the function sendBlueToothCommand("\r\n+STPIN=0000\r\n"); //Set pin code 0000 delay(2000); // This delay is required. blueToothSerial.print("\r\n+INQ=1\r\n"); delay(2000); // This delay is required. Serial.print("Setup complete"); } void sendBlueToothCommand(char command[]) { char a; blueToothSerial.print(command); Serial.print(command); delay(3000); while(blueToothSerial.available()) { Serial.print(char(blueToothSerial.read())); } } |
Downloads
Download CSRBC417 Datasheet | PDF
Download AT-Command Reference | PDF
Pingback:Wiring Bluetooth HC06 / 4 Channel Relay Switching Automation with Android | 14Core.com