Description

HC-12 are cheap 433MHz wireless serial port communication modules with a range up to 1800m in open space. They are SI4463 based. Each costs about $5 when bought from China, and 2 of them can create wireless UART link that can be used, for example, to transfer telemetry data from UAV. Or drive IoT device. Or connect sensors. Or whatever else one can think of.

HC-12 433MHz wireless serial communication module

It is based on SI4463 RF chip, has built in microcontroller, can be configured using AT commands and allows to use an external antenna. Working frequency is divided into 100 channels starting from 433,4MHz up to 473,0MHz with 400kHz channel separation. Maximum output power is 100mW (20dBm) and receiver sensitivity differs from -117dBm to -100dBm, depending on transmission speed. It accepts 3,2V-5,5V power supply and can be used with 3.3V and 5V UART voltage devices (5V safe).

HC-12 serial port supports the following baud rates:

  1. 1200bps
  2. 2400bps
  3. 4800bps
  4. 9600bps (default)
  5. 19200bps
  6. 38400bps
  7. 57600bps
  8. 115200bps

Each HC-12 can work in one of the following modes:

  1. FU1 - moderate power saving mode with 250000bps "over the air" baud rate. Serial port baud rate can be set to any supported value
  2. FU2 - extreme power saving mode with 250000bps "over the air" speed. Serial port rate is limited to 1200bps, 2400bps, 4800bps
  3. FU3 - default, general purpose mode. "Over the air" speed differs depending on serial port speed. The same goes for maximum range:
    • 1200bps ~ 1000m
    • 2400bps ~ 1000m
    • 4800bps ~ 500m
    • 9600bps ~ 500m
    • 19200bps ~ 250m
    • 38400bps ~ 250m
    • 57600bps ~ 100m
    • 115200bps ~ 100m
  4. FU4 (available in version 2.3 or newer) - long-range mode. "Over the air" speed is limited to 500bps and serial port speed to 1200bps. Because airspeed is lower than port speed, only small packets can be sent: max 60 bytes with the interval of 2 seconds. In this mode, range is increased to 1800m.

Pair of HC-12 that creates a wireless link has to work in the same mode (FU1, FU2, FU3, FU4) and with the same speed.

Configuration

HC-12 can be configured using AT command. The best way to do it, is to use USB-to-serial converter like CP2102. To put HC-12 into AT mode, pull SET pin to GND like this:

USB-To-Serial HC-12
Vcc Vcc
GND GND
TX RX
RX TX
GND SET

Then, telnet to device:

  • Linux and Mac usually has preinstalled screen command that does that. In my case (MacBook Pro) syntax was: screen /dev/tty.usbserial-A50285Bl 9600
  • In case of Windows machines you can use excellent Putty and open serial port (COM1-COM4 depending on your setup) with speed 9600bps

    Now we can start sending commands. The only problem here is that you can not just type them. Wireless module will expect that each command will enter very fast. So the best option here is to open a text editor, type commands there and then copy them one by one into the serial software.

Most important commands:

  1. AT - test command. It will return OK if AT interface is enabled
  2. AT+Bxxxx - set serial port baud rate. For example, AT+B57600 set the baud rate to 57600bps
  3. AT+Cxxx - set radio channel. Channels start at 001 at 433,4MHz. Each next channel adds 400kHz. Channel 100 is 473,0MHz. AT+C002 will set a frequency to 433,8MHz. Two HC-12 devices that create a wireless link have to operate on the same frequency
  4. AT+FUx - set device mode: FU1, FU2, FU3 or FU4. Two HC-12 devices that create a wireless link have to use the same mode
  5. AT+Px - set device transmitting power. For example AT+P2 sets power to 2dBm (1.6mW)
    1. -1dBm (0.8mW)
    2. 2dBm (1.6mW)
    3. 5dBm (3.2mw)
    4. 8dBm (6.3mW)
    5. 11dBm (12mW)
    6. 14dBm (25mW)
    7. 17dBm (50mW)
    8. 20dBm (100mW)
  6. AT+RX - retrieve all parameters: mode, channel, baud rate, power
  7. AT+V - retrieve module version
  8. AT+DEFAULT - reset module parameters to default settings

You can get HC-12 433MHz serial wireless modules from Banggood and Aliexpress