Hi-Link HLK-B40 Bluetooth Transparent Transmission Module User Manual

June 6, 2024
Hi-Link

Hi-Link HLK-B40 Bluetooth Transparent Transmission Module

HLK-B40
Master-slave integrated Bluetooth transparent transmission module

Terminology&noun interpretation

Name.| Instructions|
---|---|---
Transmission| Transparent transmission is to forward data as is between Bluetooth and serial port|
Bluetooth| A short-range wireless communication technology|
BLE| Bluetooth Low Energy, a new Bluetooth technology specification that consumes less power and has a higher transmission and communication distance|


GATT

| Bluetooth Low Energy (BLE) connections are based on the GATT (Generic

Attribute Profile) protocol and are a common specification for sending and receiving data over Bluetooth connections

|


Bluetooth host

|  |
The roles of the device in the Bluetooth connection, the host to scan the device

slave and actively initiate the connection to the device, etc. in the Bluetooth connection its leading role

One of the roles of the device in a Bluetooth connection, slave to broadcast its own information, passively waiting for the connection

|
Bluetooth from

the machine

|


Bluetooth broadcast

| Bluetooth from the machine device through periodic broadcasting, so that the

surrounding host equipment can scan and identify themselves, the host device according to the scanned slave information can initiate a connection to the

computer

|
Broadcast interval| Bluetooth sends broadcasts slave at intervals that are smaller and faster to scan but the greater the power consumption, the smaller the power consumption|
Connection interval| When two Bluetooth devices are connected, the smaller the beat of the data, the smaller the transmission speed, the smaller the delay but the greater the power consumption|
Pair the binding| A mechanism of communication security in Bluetooth technology, which realizes

The security of Bluetooth link layer

|
OTA| Air upgrade, i.e., the firmware of the module is wirelessly upgraded via Bluetooth|
Re-connect

Intervals

| When the module is the host, when the Bluetooth connection is not connected or disconnected, the interval is automatically reconnected|

Introduction

HLK-B40 is a kind of Master-Slave serial port transmission Bluetooth module based on BLE5.1, All kinds of devices with serial port can use Bluetooth wireless to send and receive data simply and quickly through this module.

The basic functions and features are as follows

  • Main frequency 48MHz, 32-bit ARM Cortex M3 core
  • Fast and stable Bluetooth-serial port transmission, serial port rate up to 921600
  • Master-to-one Bluetooth, which can be set to host or slave mode, supports binding encryption
  • Bluetooth from the machine mode can be connected by up to 20 host devices at the same time, supporting custom broadcast data
  • Based on BLE5.l, it is faster and has a longer transmission distance and can reach 40 to 100 m in an open environment
  • Supports low-power modes, sleep currents of up to6 µA and custom connection and broadcast intervals
  • Bluetooth transmit power can be adjusted up to 1 0dBm and receives up to -95dBm
  • Support for OTA Bluetooth wireless upgrade module firmware, wireless configuration module parameters
  • The default onboard high-quality ceramic antenna increases the transmission distance and includes an external antenna
  • Built-in Watchdog, Long and reliable operation time
  • Ultrasmall size 14mmx9.5mmx2mm
  • Wide operating voltage 1.8 to 4.2V, typical 3.3V
  • Rich output pins (UART, l2C, SPI, up to 15 GPIOs, up to 4 ADCs, up to 6 PWMs) provide flexible and in-depth hardware and software custom development services
Pin definition

Hi-Link HLK-B40 Bluetooth Transparent Transmission
Module-1


Pins

| ****

Symbol.

| IO

Type

| ****

Functions

---|---|---|---
 | GND| GND| Power source
2| MIC BIA|  | Keep the functionality
3| MIC IN|  | Keep the functionality
4| VMID|  | Keep the functionality
5| AOUT P|  | Keep the functionality
6| AOUT N|  | Keep the functionality
7| RESET| I| Reset restart module, high level is effective,
8| VCHG| PWR| Charger input, prohibited without battery
9| VBAT| PWR| The power supply is input to DC3.3V and the
10| GND| GND| Power source
11| VDDIO|  | Keep the functionality
12| PD7|  | Keep the functionality
13| PD6|  | Keep the functionality
14| PD5|  | Keep the functionality
15| PD4|  | Keep the functionality
16| PC7| 0| Module Sleep State Output, High: Full Speed,
17| PC6| I| Module Hibernation Control Input High: Go into hibernation, Low: Exit Hibernation, Suspend as High


18

| ****

PC5

| ****

I

| Function key input, low level is valid, suspension is high
19| PA3|  | Keep the functionality
20| PA2|  | Keep the functionality
21| PAI|  | Keep the functionality
22| PAO|  | Keep the functionality
23| UART0| 0| The module serial output
24| UART0| I| Module serial input


Pins

| ****

Symbol.

| IO

Type

| ****

Functions

---|---|---|---


25

| ****

PA4

| ****

0

| Bluetooth connection status output, high: not connected, low: connected
26| PAS| 0| Current operating mode output, high: master , low: slave
27| LED| –| Keep the functionality
28| GND| GND| Power source
29| ANT|  | External antenna output

Typical application circuits

Below is the basic application circuit reference of this module, if you need more functions, please refer to the module manual or contact our engineers to assist.

Hi-Link HLK-B40 Bluetooth Transparent Transmission
Module-2

The enable and disable of the module’s low-power sleep function can be set by the AT command, which is disabled by default.
If the low-power sleep function is enabled, the module is controlled by the level of the sleep control input pin, which is used to enter or exit hibernation, and the module outputs the current sleep state by the sleep state output pin.

Hi-Link HLK-B40 Bluetooth Transparent Transmission
Module-3

Note:

  1. RESET pin can not be suspended, it need to connect 1 OK drop-down resistance.
  2. Metal object blocking will affect Bluetooth signal sending and receiving, use should make the module as far away from metal objects as possible, PCB design requires modules
    No copper can be laid under the antenna section.
Basic functional instructions

The principle of transmission

HLK-B40 is a cost-effective Master-slave integrated Bluetooth transparent transmission module introduced by Hi-Link, designed to enable only serial user devices to quickly and easily use Bluetooth for wireless transmission, with the help of serial transmission, users do not need to care about complex Bluetooth protocol stack and RF circuit, just a simple serial port transmission, data can be transmitted directly on the Bluetooth wireless connection. Transmission is short for transparent transmission, means the role of the module is equivalent to the serial port and Bluetooth connection between the establishment of a transparent transmission pipeline, the user in the serial port issued data will be forwarded to the device connected through Bluetooth, data sent through Bluetooth will also be forwarded to the serial port, the entire process users do not need to care about complex Bluetooth connection how to achieve, HLK-B40 module from beginning to end is only the original data transfer and transmission of data without the user’s convenience and transmission.
The principle schematic of the Bluetooth-serial port transmission function is as follows, see the quick start guide for the specific test verification method.

Hi-Link HLK-B40 Bluetooth Transparent Transmission
Module-4

This module can be connected by multiple Bluetooth host devices when acting as a Bluetooth accessor, including other B40 modules as hosts. Under a multi-to- one connection, the data received from the serial port of the machine module is forwarded via Bluetooth to each connected host device, each Data from connected host devices is also forwarded to the serial port from the machine module.

Hi-Link HLK-B40 Bluetooth Transparent Transmission
Module-5

Module operating mode (transmission and AT command mode)

HLK-B40 module has both transmission mode and AT command mode.
In AT command mode, you can query and set the parameters of the module by sending the AT command to the module through a serial port.
In transmission mode, the module transfers serial data and Bluetooth-connected data in both directions.
When the module starts, the default is transmission mode. Exiting transmission mode into AT mode will not affect the Bluetooth connection state, string Mouth-Bluetooth pivot is paused, the data received by the serial port is processed by the current AT instruction;

In transmission mode, the 18th pin PCS is entered with a short low level (0.5 to 3s) and the module switches out of transmission to AT command mode.

In AT command mode, the A T-TS-1 command is sent to restore the exit AT command mode to transmission mode.

The conversion logic for transmission mode and AT command mode is as follows:

Hi-Link HLK-B40 Bluetooth Transparent Transmission
Module-6

Description of the input and output pin functions

Name. Chip pin Description

Reset key input

| ****

RESET

| High level is effective and requires an external I OK drop­ down resistor

Enter the high-level module to restart the module

Function button input| PCS| The inside is pulled up and the action is pulled down

Pull down 0.5 to 3 seconds: exit transmission and switch to AT command mode;

Pull down 8 to 20 seconds: restore the factory default settings

The module sleep control input| PC6| Internal pull-up, suspension or input high-level module

automatically into hibernation, input low normal full-speed operation;

    Valid only if the low-power sleep function is enabled

The module hibernate
state output| PC7| High level – full speed work, low level – hibernation
Bluetooth connection status output| PA4|  | High level – not connected , low level – connected , transmission channel has been established; When the pairing binding feature enables, the pairing encryption is

successfully represented on the connection

|
The operating mode

output

| PAS| High level = master, low level = slave

Bluetooth device roles and connections

Devices at both ends of the Bluetooth connection have fixed roles, one is the host role, the other is the slave role. Different roles of equipment define the corresponding operations and responsibilities.

The host discovers the slave device by scanning the slave broadcast and actively initiates a connection to the selected slave device (identified by the MAC address) and Maintain the connection and play a leading role in a Bluetooth connection
The slave broadcasts its own information, such as the device name, etc. The slave passively waits for the connection request initiated by the master and accepts the request to connect to Bluetooth Successfully established. This module can be connected to multiple host devices at the same time as a slave.
The B40 module defaults to the slave mode and the settings can be switched through the AT +ROLE command. After the two devices establish a Bluetooth connection, they can send data to each other via Bluetooth (GATT).

The Bluetooth GA TT service and feature UUID of this module can be modified by AT command, the default values are as follows:

Service UUID : 0000fff0-0000-1000-8000-00805f9b34fb

Feature UUID

|

Action permissions

| The function

definition

---|---|---
0000fffl-0000-1000-8000-00805f9b34fb| Read/Notify| Module send , APP receive
0000fff2-0000-1000-8000-00805f9b34fb| Write Without Response| APP send, module receive

You can choose to tum on the pairing and binding function of the Bluetooth connection. After it is turned on, the security can be increased, but the operation steps are increased accordingly. It is valid in slave or master mode. The pairing method is PASSKEY ENTRY, 6-digit PingCode. After the binding function is turned on, Bluetooth data can be sent and received only after pairing and binding. Unpaired devices cannot transparently transmit data through Bluetooth and the module.
In the master mode, you need to set the MAC address of the target slave to be connected. After the module starts, it will automatically scan and connect to the target slave device and will automatically reconnect and reconnect if the slave is not found or the connection is disconnected. The interval time can be set by the
AT +RECONNI command, the default is 5s, that is, when it is not connected, it will try to reconnect every 5 seconds until it is connected.

A quick start guide

Test the debug base plate

In order to enable users to quickly verify and debug the module, our company has developed a dedicated B40 test board. It is recommended that you choose to use this test board when you use this module for the first time.
The test board is directly powered by USB and comes with a USB-to-serial function. After connecting to the computer through the USB cable, you can connect to the module’s serial port through the USB-to-serial port. No additional serial cable is required, which is easy to use.

Read User Manual Online (PDF format)

Read User Manual Online (PDF format)  >>

Download This Manual (PDF format)

Download this manual  >>

Related Manuals