HC-12 wireless module
HC-12 wireless module for the 433 MHz band.

The HC-12 is a wireless module for the 433 MHz band, intended for wireless transfer of UART serial data. With two modules it can create a wireless bridge between two applications that communicate through RX and TX lines. A useful advantage is the option to connect an external antenna or use the small spiral antenna supplied with the module.

Technical Specifications

Supply voltage3.3 to 6 V
Current draw80 uA to 22 mA depending on FU mode
CommunicationUART, RX and TX lines
Supported speeds1200 to 115200 bps
Output power-1 to 20 dBm in eight levels
RangeUp to 500 m depending on mode, antenna and environment
ConfigurationAT commands

Use Cases

The main use is replacing a cable serial link with a wireless one. If communication is only one-way, several receiving modules can listen to data from one transmitter. This is useful when the same data should be displayed on multiple remote displays.

Connecting the Module

HC-12 connection to Arduino UNO
Example HC-12 connection to UART-based applications.

The example shows connection to an Arduino UNO and a block diagram of two applications connected using HC-12 modules. TX and RX lines must be crossed between the module and the application.

Configuration

The module is configured using AT commands. AT mode can be entered by pulling pin 5, marked CON or SET, to logic low during operation. In this mode the module communicates at the currently configured speed. When the pin returns to high, the module returns to normal operation.

The second option is to power the module off, hold the SET pin low and power it on again. In that case the UART speed in AT mode is 9600 bps regardless of the normal operating speed. This also means that the SET pin can be controlled by your own application if runtime reconfiguration is needed.

For current use, Sakul Serial Terminal (SST) is a suitable serial terminal. After connecting the module through a USB/TTL converter, find the assigned COM port in Device Manager.

USB TTL converter COM port
USB/TTL converter COM port in Device Manager.

Set the COM port and the baud rate, usually 9600 bps when using the second configuration method, then open the connection. Sending AT should return OK. The AT+RX command prints the current module configuration.

Serial terminal with HC-12 commands
Serial terminal with prepared HC-12 AT commands.

HC-12 AT commands require CR and LF line endings. If you use a different terminal, make sure these characters are sent automatically or add them manually.

Important AT Commands

AT+RX prints the current module settings. Specific values can be queried with AT+Ry, for example channel, output power, baud rate or FU mode.

AT+C sets the channel, for example AT+C001. Before real operation, always verify the currently allowed channels and conditions with the local regulator.

AT+B sets UART speed, for example AT+B19200. Supported speeds are 1200, 2400, 4800, 9600, 19200, 38400, 57600 and 115200 bps.

AT+FU selects the operating mode, affecting current consumption, latency and maximum data rate.

AT+P sets output power. The allowed power can be legally limited, so verify current rules before use.

AT+V prints firmware version.

FU Modes

FU1Medium-power mode with all communication speeds available, around 4 mA.
FU2Low-power mode around 80 uA with high latency and only lower speeds. Suitable for battery applications with low data flow.
FU3Low-latency mode around 10 ms, higher current consumption and all speeds available. Suitable for higher bidirectional data flow.
FU4Long-range mode at 1200 bps with small packets and longer pauses between transmissions. Theoretical range can be much higher in ideal conditions.

Configuration Application

A dedicated configuration application can make setup more comfortable than typing commands manually. After selecting the COM port, it can set baud rate, parity, stop bits, FU mode, output power and channel, then read or write the configuration.

HC-12 configuration application
Example configuration application for the HC-12 module.

Conclusion

The HC-12 is a useful module for data transfer, simple remote control and one-to-many communication such as sending data to multiple displays. The external antenna connector is a strong advantage. The main point to watch is legal configuration of channel and output power.

HC-12 module detail
HC-12 module detail.

Documentation

A documentation package for the HC-12 module is available for download.

Useful Links