EasyManua.ls Logo

Hi-Link HLK-B40 - User Manual

Hi-Link HLK-B40
19 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
Loading...
Shenzhen Hi-Link Electronic co.,Ltd
HLK-B40
Master-slave integrated Bluetooth transparent transmission module
User Manual
VersionV1.2 Verified2020-10-31 Copyright@ Hi-Link
Question and Answer IconNeed help?

Do you have a question about the Hi-Link HLK-B40 and is the answer not in the manual?

Summary

Terminology & Noun Interpretation

Introduction

Pin Definition

Detailed pinout and function mapping for the HLK-B40 module, essential for hardware connections and integration.

Typical Application Circuits

Basic Functional Instructions

Principle of Transmission

Explains how data is transmitted transparently between serial port and Bluetooth, simplifying user interaction.

Module Operating Modes

Covers the two primary operating modes: transmission and AT command mode for configuration and control.

Input and Output Pin Functions

Describes the purpose and behavior of each input and output pin on the module, aiding hardware integration.

Bluetooth Device Roles and Connections

Details the host/slave roles and how connections are established and managed between devices for communication.

Quick Start Guide

Test the Debug Base Plate

Instructions for using the dedicated test board to quickly verify module functionality and setup procedures.

Verify Bluetooth Serial Transmission

Step-by-step guide to test serial port to Bluetooth data transmission using the module and a mobile app.

Low Power Sleep Function

AT Command

AT Instruction Format Description

Outlines the syntax and structure for sending AT commands to configure and control the module's parameters.

AT Instruction List and Description

Comprehensive list of available AT commands, their parameters, and expected responses for module configuration.

Wireless Settings and Queries via Bluetooth

OTA Functionality

Contact Info

Overview

The HLK-B40 is a master-slave integrated Bluetooth transparent transmission module, designed to facilitate wireless data exchange for devices equipped with a serial port. This module simplifies the process of sending and receiving data via Bluetooth, eliminating the need for users to manage complex Bluetooth protocol stacks or RF circuits. It functions as a transparent pipeline between the serial port and a Bluetooth connection, forwarding data received from the serial port to connected Bluetooth devices and vice versa.

Function Description

The core function of the HLK-B40 is transparent serial port to Bluetooth data transmission. It operates in two primary modes: transmission mode and AT command mode.

In transmission mode, the module acts as a direct conduit for serial data and Bluetooth-connected data, enabling bidirectional communication. This means any data sent to the module's serial port is forwarded over Bluetooth, and any data received via Bluetooth is forwarded to the serial port. The module defaults to this mode upon startup.

In AT command mode, users can query and configure the module's parameters by sending AT commands through the serial port. This allows for customization of various operational aspects without interrupting the Bluetooth connection state. To enter AT command mode from transmission mode, a short low-level pulse (0.5 to 3 seconds) must be applied to pin PC5. To exit AT command mode and return to transmission mode, the AT+TS=1 command is used.

The HLK-B40 supports both host and slave roles in a Bluetooth connection. When configured as a slave, it can connect to multiple host devices (up to 20 simultaneously), including other B40 modules acting as hosts. In a multi-to-one connection, data received from the slave module's serial port is forwarded to all connected host devices, and data from each connected host device is forwarded to the slave module's serial port.

The module incorporates Bluetooth Low Energy (BLE 5.1) technology, offering faster transmission speeds and an extended range of 40 to 100 meters in open environments. It also supports low-power modes, with sleep currents as low as 6 µA, and allows for custom connection and broadcast intervals to optimize power consumption.

Usage Features

The HLK-B40 offers several features that enhance its usability and adaptability:

  • Master-Slave Flexibility: The module can be configured as either a host or a slave, providing versatility for different application scenarios. In host mode, it can be set to automatically scan for and connect to a target slave device based on its MAC address, with configurable reconnection intervals if the connection is lost.
  • Binding Encryption: For enhanced security, the module supports a pairing and binding function. When enabled, Bluetooth data can only be exchanged after successful pairing and binding, using a 6-digit PingCode. This feature is applicable in both slave and master modes.
  • Configurable Parameters: Numerous parameters can be adjusted via AT commands, including:
    • Serial Port Baud Rate: Supports a wide range of baud rates from 1200 to 921600.
    • Bluetooth Transmit Power: Adjustable up to 10dBm, with a receive sensitivity of -95dBm, allowing for a balance between transmission distance and power consumption.
    • Auto Sleep Function: Can be enabled to reduce power consumption. When active, the module's sleep state is controlled by an external sleep control input pin (PC6). A high level on PC6 puts the main chip to sleep, while a low level wakes it up for full-speed operation. The module's sleep state is indicated by the PC7 output pin.
    • Broadcast and Connection Intervals: These intervals can be customized to optimize for faster scanning/data beat or lower power consumption.
    • Bluetooth Device Name: The module's Bluetooth name can be customized (up to 28 characters).
    • Broadcast Data: Users can define custom hexadecimal broadcast data (up to 40 characters).
    • Bluetooth GATT Service and Feature UUIDs: The default UUIDs for the Bluetooth GATT service and features (for module send/APP receive and APP send/module receive) can be modified.
    • OTA Access Passwords: An access password (up to 8 characters) can be set for Over-The-Air (OTA) updates.
  • Connection Status Indication: The PA4 pin outputs a high level when not connected and a low level when connected, providing a visual or programmatic indication of the Bluetooth connection status.
  • Operating Mode Indication: The PA5 pin outputs a high level when the module is in master mode and a low level when in slave mode.
  • Reset Functionality: A dedicated RESET pin allows for module restart when a high level is applied.
  • Function Button Input: The PC5 pin serves as a function button input. A short pull-down (0.5 to 3 seconds) switches the module from transmission to AT command mode. A longer pull-down (8 to 20 seconds) restores the module to factory default settings.
  • Rich Output Pins: The module provides a variety of output pins, including UART, I2C, SPI, up to 15 GPIOs, up to 4 ADCs, and up to 6 PWMs, offering flexibility for hardware and software custom development.
  • On-board Ceramic Antenna: The module comes with a high-quality ceramic antenna by default, enhancing transmission distance. It also includes an external antenna output for further flexibility.

Maintenance Features

The HLK-B40 is designed with features that contribute to its reliability and ease of maintenance:

  • Built-in Watchdog: A built-in watchdog ensures long and reliable operation by automatically resetting the module if it becomes unresponsive.
  • Non-Volatile Settings: All AT command settings are stored in non-volatile memory and are not lost after power failure, ensuring that configurations persist across restarts.
  • OTA Firmware Upgrade: The module supports Over-The-Air (OTA) wireless firmware upgrades via Bluetooth, allowing for convenient updates and bug fixes without physical access to the module. This is managed through a dedicated mobile phone APP.
  • Wireless Configuration: Module parameters can be queried and set wirelessly via Bluetooth using a mobile phone APP, simplifying configuration and debugging in deployed systems.
  • Debug Base Plate: A dedicated debug base plate is available to facilitate quick verification and debugging. This board provides USB power, a USB-to-serial function, and indicators for connection status, sleep state, and operating mode, making initial setup and testing straightforward.
  • Clear Pin Definitions: Comprehensive pin definitions and their functions are provided, aiding in correct integration and troubleshooting.
  • Application Circuit References: Basic application circuit diagrams are provided, guiding users in integrating the module into their systems.
  • Technical Support: The manufacturer offers in-depth hardware and software custom development services, as well as support for additional functions beyond the basic application circuits.

Hi-Link HLK-B40 Specifications

General IconGeneral
Output Power4dBm
Modulation TypeGFSK
Transmission Distance10m
Transmit Power4 dBm
AntennaPCB Antenna
Frequency Range2402-2480MHz
Supply Voltage3.3V
Frequency2.4GHz