Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use HC12: Examples, Pinouts, and Specs

Image of HC12
Cirkit Designer LogoDesign with HC12 in Cirkit Designer

Introduction

The HC12 is a low-cost, low-power, 12-channel RF transceiver module that operates in the 433MHz frequency band. It is widely used for wireless communication in applications such as remote control, data transmission, and sensor networks. The module is designed for ease of use, offering a simple UART interface for communication with microcontrollers and other devices. Its long-range capabilities and configurable settings make it a versatile choice for both hobbyists and professionals.

Explore Projects Built with HC12

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
STM32H7-Based Multi-Sensor Monitoring System with GSM Alert and LCD Display
Image of medical: A project utilizing HC12 in a practical application
This circuit is centered around an STM32H7 microcontroller, which interfaces with a variety of sensors including a DHT11 temperature and humidity sensor, a DS3231 real-time clock, an MQ-2 smoke detector, an IR sensor, a MAX30102 pulse oximeter, and a body temperature sensor. It also includes a GSM module for communication, an LCD display for output, multiple pushbuttons for input, a buzzer, and a speaker for audio signaling. The microcontroller's embedded code suggests that it is programmed to periodically read from the sensors, handle button inputs, update the LCD display, and potentially send alerts via the GSM module.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO-Based Smart Irrigation System with Motion Detection and Bluetooth Connectivity
Image of Copy of wiring TA: A project utilizing HC12 in a practical application
This circuit is a microcontroller-based control and monitoring system. It uses an Arduino UNO to read from a DHT22 temperature and humidity sensor and an HC-SR501 motion sensor, display data on an LCD, and control a water pump and an LED through a relay. The HC-05 Bluetooth module allows for wireless communication.
Cirkit Designer LogoOpen Project in Cirkit Designer
Raspberry Pi Pico-Based Navigation Assistant with Bluetooth and GPS
Image of sat_dish: compass example: A project utilizing HC12 in a practical application
This circuit features a Raspberry Pi Pico microcontroller interfaced with an HC-05 Bluetooth module for wireless communication, an HMC5883L compass module for magnetic field measurement, and a GPS NEO 6M module for location tracking. The Pico is configured to communicate with the HC-05 via serial connection (TX/RX), with the compass module via I2C (SCL/SDA), and with the GPS module via serial (TX/RX). Common power (VCC) and ground (GND) lines are shared among all modules, indicating a unified power system.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32C3 Supermini-Based Smart Environment Monitor and Lighting Control System
Image of Bedside RGB and Lamp: A project utilizing HC12 in a practical application
This is a smart control system featuring an ESP32C3 Supermini microcontroller for interfacing with various sensors and actuators. It includes temperature and humidity sensing, RGB LED strip control, user input via a pushbutton and rotary encoder, and AC power control through a two-channel relay. The system is powered by an AC source converted to DC by the HLK-PM12 module.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with HC12

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of medical: A project utilizing HC12 in a practical application
STM32H7-Based Multi-Sensor Monitoring System with GSM Alert and LCD Display
This circuit is centered around an STM32H7 microcontroller, which interfaces with a variety of sensors including a DHT11 temperature and humidity sensor, a DS3231 real-time clock, an MQ-2 smoke detector, an IR sensor, a MAX30102 pulse oximeter, and a body temperature sensor. It also includes a GSM module for communication, an LCD display for output, multiple pushbuttons for input, a buzzer, and a speaker for audio signaling. The microcontroller's embedded code suggests that it is programmed to periodically read from the sensors, handle button inputs, update the LCD display, and potentially send alerts via the GSM module.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Copy of wiring TA: A project utilizing HC12 in a practical application
Arduino UNO-Based Smart Irrigation System with Motion Detection and Bluetooth Connectivity
This circuit is a microcontroller-based control and monitoring system. It uses an Arduino UNO to read from a DHT22 temperature and humidity sensor and an HC-SR501 motion sensor, display data on an LCD, and control a water pump and an LED through a relay. The HC-05 Bluetooth module allows for wireless communication.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of sat_dish: compass example: A project utilizing HC12 in a practical application
Raspberry Pi Pico-Based Navigation Assistant with Bluetooth and GPS
This circuit features a Raspberry Pi Pico microcontroller interfaced with an HC-05 Bluetooth module for wireless communication, an HMC5883L compass module for magnetic field measurement, and a GPS NEO 6M module for location tracking. The Pico is configured to communicate with the HC-05 via serial connection (TX/RX), with the compass module via I2C (SCL/SDA), and with the GPS module via serial (TX/RX). Common power (VCC) and ground (GND) lines are shared among all modules, indicating a unified power system.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Bedside RGB and Lamp: A project utilizing HC12 in a practical application
ESP32C3 Supermini-Based Smart Environment Monitor and Lighting Control System
This is a smart control system featuring an ESP32C3 Supermini microcontroller for interfacing with various sensors and actuators. It includes temperature and humidity sensing, RGB LED strip control, user input via a pushbutton and rotary encoder, and AC power control through a two-channel relay. The system is powered by an AC source converted to DC by the HLK-PM12 module.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Wireless sensor networks
  • Remote control systems
  • Home automation
  • Industrial monitoring
  • Data logging and telemetry

Technical Specifications

The HC12 module is designed to provide reliable wireless communication with minimal power consumption. Below are its key technical details:

Parameter Value
Operating Frequency 433.4 MHz to 473.0 MHz
Number of Channels 12
Modulation Type GFSK (Gaussian Frequency Shift Keying)
Communication Interface UART (TTL level)
Baud Rate 1200 bps to 115200 bps (default: 9600 bps)
Operating Voltage 3.2V to 5.5V
Transmit Power Up to 100mW (20dBm)
Sensitivity -117 dBm at 5000 bps
Range Up to 1.8 km (in open space)
Current Consumption 16 mA (transmit), 3.6 mA (receive)
Dimensions 27.8mm x 14.4mm x 4mm

Pin Configuration

The HC12 module has a total of 4 pins. The table below describes each pin:

Pin Name Description
1 VCC Power supply input (3.2V to 5.5V). Connect to a regulated power source.
2 GND Ground. Connect to the ground of the circuit.
3 TXD UART Transmit pin. Sends data to the connected microcontroller or device.
4 RXD UART Receive pin. Receives data from the connected microcontroller or device.

Usage Instructions

The HC12 module is straightforward to use and can be easily integrated into a circuit. Below are the steps and best practices for using the HC12:

Connecting the HC12 to a Microcontroller

  1. Power Supply: Connect the VCC pin to a regulated 3.3V or 5V power source and the GND pin to the ground.
  2. UART Communication: Connect the TXD pin of the HC12 to the RX pin of the microcontroller and the RXD pin of the HC12 to the TX pin of the microcontroller.
  3. Antenna: Attach an appropriate 433MHz antenna to the module for optimal range and performance.

Configuring the HC12

The HC12 can be configured using AT commands sent via the UART interface. For example:

  • To set the baud rate to 9600 bps: AT+B9600
  • To set the module to channel 5: AT+C005

Example: Using HC12 with Arduino UNO

Below is an example of how to use the HC12 module with an Arduino UNO for basic communication:

Circuit Diagram

  • Connect HC12 VCC to Arduino 5V.
  • Connect HC12 GND to Arduino GND.
  • Connect HC12 TXD to Arduino RX (pin 0).
  • Connect HC12 RXD to Arduino TX (pin 1).

Arduino Code

// Example code for using HC12 with Arduino UNO
#include <SoftwareSerial.h>

// Define HC12 RX and TX pins
SoftwareSerial HC12(10, 11); // HC12 TX to pin 10, HC12 RX to pin 11

void setup() {
  Serial.begin(9600);       // Start serial communication with PC
  HC12.begin(9600);         // Start serial communication with HC12
  Serial.println("HC12 Test");
}

void loop() {
  // Check if data is received from HC12
  if (HC12.available()) {
    String receivedData = HC12.readString(); // Read data from HC12
    Serial.print("Received: ");
    Serial.println(receivedData);           // Print received data to Serial Monitor
  }

  // Check if data is sent from Serial Monitor
  if (Serial.available()) {
    String sendData = Serial.readString();  // Read data from Serial Monitor
    HC12.print(sendData);                   // Send data to HC12
  }
}

Best Practices

  • Use a regulated power supply to avoid damaging the module.
  • Ensure proper antenna placement for maximum range.
  • Avoid placing the module near sources of interference, such as motors or high-frequency circuits.

Troubleshooting and FAQs

Common Issues

  1. No Communication Between Modules

    • Cause: Mismatched baud rates or channels.
    • Solution: Ensure both modules are configured with the same baud rate and channel using AT commands.
  2. Short Communication Range

    • Cause: Poor antenna connection or interference.
    • Solution: Check the antenna connection and ensure there are no obstacles or interference sources nearby.
  3. Module Not Responding to AT Commands

    • Cause: Incorrect wiring or baud rate.
    • Solution: Verify the wiring and ensure the baud rate matches the module's default (9600 bps).

FAQs

  1. Can the HC12 operate at 5V?

    • Yes, the HC12 supports an operating voltage range of 3.2V to 5.5V.
  2. What is the maximum range of the HC12?

    • The HC12 can achieve a range of up to 1.8 km in open space with a proper antenna.
  3. How do I reset the HC12 to factory settings?

    • Send the AT+DEFAULT command via UART to reset the module to its default settings.

By following this documentation, you can effectively integrate and troubleshoot the HC12 module in your projects.