BLE2 click es una excelente opción si buscas una conectividad sencilla y temporal con sus dispositivos inteligentes mediante Bluetooth 4.1.
BLE2 click incorpora el módulo RN4020 de Microchip, que integra RF, un controlador de banda base y un procesador API de comandos, lo que lo convierte en una solución completa de Bluetooth de bajo consumo. El click se comunica con el MCU de la placa de destino a través de las líneas mikroBUS™ RX, TX y AN (CMD), PWM (con.) y RST (activación). La placa está diseñada para funcionar únicamente con una fuente de alimentación de 3,3 V.
Perfil de datos de bajo consumo de Microchip
El RN4020 cuenta con el Perfil de datos de bajo consumo de Microchip (MLDP), que permite una conexión de datos serie asíncrona entre dos dispositivos RN4020 (que podrían ser dos BLE2 click). El módulo puede ser controlado o actualizado remotamente por otro módulo mediante una conexión segura, o puede ser controlado o actualizado a través de su interfaz UART.
Antena de trazas PCB
El módulo RN4020 a bordo del BLE2 click incorpora una antena PCB con un alcance de al menos 30 m.
Bluetooth 4.1
Bluetooth 4.1 está diseñado para IoT, tiene un bajo consumo de energía y permite que cualquier dispositivo funcione como periférico y concentrador a la vez.
Specifications
| Type | Bluetooth,BLE |
| Applications | Bluetooth Low Energy is becoming a pervasive standard for IoT applications in any number of domains (home automation, fitness, health and so on). Because of MLDP support, BLE2 click works great in pairs |
| On-board modules | MicroChip RN4020 |
| Key Features | N4020 Bluetooth 4.1 module. PCB antenna. Integrated TCP/IP stack |
| Key Benefits | MLDP support makes it easy to connect a pair of BLE2 clicks. Can be setup both as a client or a server |
| Interface | UART,GPIO |
| Input Voltage | 3.3V |
| Compatibility | mikroBUS |
| Click board size | S (28.6 x 25.4 mm) |
Pinout diagram
This table shows how the pinout on BLE2 click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Programming
The code sets up the BLE2 click board, and sends messages through Bluetooth low energy every 5 seconds. If the BLE2 click board receives messages over Bluetooth low energy, the code displays the message and updates the buffer.
01 void main() { 02 Display_Init(); 03 MCU_Init(); 04 #ifdef INIT_BLE 05 BLE_Init(); 06 delay_ms(2000); 07 #else 08 RN_WAKE = 1; 09 wait_response("CMD"); 10 #endif 11 DrawFrame(); 12 InitTimer2(); 13 while(1) 14 { 15 if(data_ready) 16 { 17 //If characteristic is configured as write 18 //received messages come here 19 Display_Message(); 20 reset_buff(); 21 } 22 else 23 { 24 //Test: every 5sec increase baterry level (0 to 100%) 25 //and send value via Bluetooth Low Energy 26 if (tmr_flg) 27 { 28 batt_level++; 29 if(batt_level > 100) 30 { 31 batt_level = 0; 32 } 33 Display_BatteryLevel(); 34 if(RN_CONN) 35 { //send battery level value if BLE connected 36 shorttohex(batt_level, batt_level_txt); 37 ltrim(batt_level_txt); 38 ble2_write_server_characteristic_value_via_UUID("2A19",batt_level_txt); 39 } 40 tmr_flg = 0; 41 } 42 } 43 } 44 }
MIKROE-1715
30 g
