BLE 쉴드 -HM-11
(BLE Shield -HM-11)
개요
- 본 제품은 HM-11을 탑재한 BLE 쉴드입니다
특징
- operating frequency : 2.4GHz ISM band
- Modulation : GFSK
- Transmit Power :-23dbm,-6dbm, 0dbm, 6dbm ( via AT command selection )
- Sensitivity : ≤-84dBm at 0.1% BER
- Transfer Rate : Asynchronous: 6K bytes, Synchronous: 6k Bytes
- Support Services : Central & Peripheral UUID FFE0, FFE1
- Power consumption : Operating current of less than 15mA, search current of less than 30mA, sleep mode is less than 3mA
- Power supply : 5V DC
- Working temperature : -5 ~ +65 C
- Communication distance: 100m maximum theoretical value
- Size : 68mm x 43mm
문서
- HM-11
-
Soft serial communication
When you use a different code , Duinofun BLE Shield can be used as master or slave . When using the soft serial communication, namely the use of software code to communicate BLE module , jumper cap should be chosen as : BLE_TX -> D2, BLE_RX -> D3.
Then open the Ardui-no IDE v1.0.5, copy the following master or slave code and download it to the motherboard .Master-Slave code
#include //Software Serial Port
#define RxD 2
#define TxD 3#define DEBUG_ENABLED 1
SoftwareSerial BLE(RxD,TxD);
void setup()
{
Serial.begin(9600);
pinMode(RxD, INPUT);
pinMode(TxD, OUTPUT);
setupBleConnection();}
void loop()
{
char recvChar;
while(1){
if(BLE.available()){//check if there\'s any data sent from the remote BLE shield
recvChar = BLE.read();
Serial.print(recvChar);
}
if(Serial.available()){//check if there\'s any data sent from the local serial terminal, you can add the other applications here
recvChar = Serial.read();
BLE.print(recvChar);
}
}
}void setupBleConnection()
{
BLE.begin(9600); //Set BLE BaudRate to default baud rate 9600
BLE.print("AT+CLEAR"); //clear all previous setting
BLE.print("AT+ROLE0"); //set the bluetooth name as a slaver
BLE.print("AT+SAVE1"); //don\'t save the connect information
}
Master Code:
#include //Software Serial Port
#define RxD 2
#define TxD 3#define DEBUG_ENABLED 1
SoftwareSerial BLE(RxD,TxD);
void setup()
{
Serial.begin(9600);
pinMode(RxD, INPUT);
pinMode(TxD, OUTPUT);
setupBleConnection();}
void loop()
{
char recvChar;
while(1){
if(BLE.available()){//check if there\'s any data sent from the remote BLE shield
recvChar = BLE.read();
Serial.print(recvChar);
}
if(Serial.available()){//check if there\'s any data sent from the local serial terminal, you can add the other applications here
recvChar = Serial.read();
BLE.print(recvChar);
}
}
}void setupBleConnection()
{
BLE.begin(9600); //Set BLE BaudRate to default baud rate 9600
BLE.print("AT+CLEAR"); //clear all previous setting
BLE.print("AT+ROLE1"); //set the bluetooth name as a master
BLE.print("AT+SAVE1"); //don\'t save the connect information
}Hard serial communication
Of course, you can operate directly on the BLE module via AT commands , without using any code. But note jumper cap position : BLE_TX -> D1, BLE_RX -> D2.
Then open the serial port tools, such as MAC Edition users can open CoolTerm assistant serial , PC users can open Sscom32 serial version of the tool . Set serial instruments are as follows : Baudrate: 9600 (default), Data Bits: 8, Parity: none, Stop Bits: 1You can send commands "AT" test , if the return "OK", i.e., can communicate. If you do not return any values, the user can try to burn an empty program to the motherboard , and then send the command "AT" for testing.
void setup()
{
}void loop()
{
}After confirmation you can communicate , you can send AT commands to the BLE module . Such as setting BLE module from the machine , sending commands "AT + ROLE0", if it returns "OK + Set: 0", it means that BLE module has been successfully set .
연관제품
- 연관제품 1