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 wireless transceiver module that operates in the 433MHz frequency band. It is designed for long-range communication and supports a simple serial communication interface, making it easy to integrate into various projects. The module is capable of transmitting data over distances of up to 1,000 meters in open space, making it ideal for applications requiring reliable wireless communication.

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 and Use Cases

  • Remote control systems
  • Wireless sensor networks
  • Home automation
  • Industrial monitoring and control
  • Robotics and UAV communication
  • IoT (Internet of Things) devices

Technical Specifications

The HC12 module is equipped with a powerful wireless transceiver and a built-in microcontroller for handling communication protocols. Below are the key technical details:

Parameter Specification
Operating Frequency 433.4 MHz to 473.0 MHz
Communication Range Up to 1,000 meters (open space)
Modulation Method GFSK (Gaussian Frequency Shift Keying)
Supply Voltage 3.2V to 5.5V
Operating Current 16 mA (transmitting), 3.5 mA (idle)
Baud Rate 1,200 to 115,200 bps (configurable)
Transmit Power Up to 100 mW (20 dBm)
Antenna Interface SMA or spring antenna
Operating Temperature -40°C to +85°C

Pin Configuration and Descriptions

The HC12 module has a 4-pin interface for easy integration with microcontrollers. Below is the pinout:

Pin Name Description
1 VCC Power supply input (3.2V to 5.5V). Connect to the 3.3V or 5V pin of your MCU.
2 GND Ground. Connect to the ground of your circuit.
3 TXD Transmit data. Connect to the RX pin of your microcontroller.
4 RXD Receive data. Connect to the TX pin of your microcontroller.
5 SET Configuration mode pin. Pull LOW to enter setup mode, HIGH for normal operation.

Usage Instructions

The HC12 module is straightforward to use and can be connected to a microcontroller, such as an Arduino UNO, via its serial interface. Below are the steps to use the HC12 in a circuit:

Basic Circuit Connection

  1. Power the Module: Connect the VCC pin to a 3.3V or 5V power source and the GND pin to the ground.
  2. Connect Serial Pins:
    • Connect the TXD pin of the HC12 to the RX pin of the microcontroller.
    • Connect the RXD pin of the HC12 to the TX pin of the microcontroller.
  3. SET Pin Configuration:
    • Pull the SET pin HIGH (or leave it unconnected) for normal operation.
    • Pull the SET pin LOW to enter configuration mode for changing parameters like baud rate or channel.

Example Arduino Code

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

#include <SoftwareSerial.h>

// Define HC12 RX and TX pins
SoftwareSerial HC12(10, 11); // RX = Pin 10, TX = Pin 11

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

void loop() {
  // Check if data is received from the HC12 module
  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 the Serial Monitor
  if (Serial.available()) {
    String sendData = Serial.readString();  // Read data from Serial Monitor
    HC12.print(sendData);                   // Send data to HC12
  }
}

Important Considerations and Best Practices

  • Antenna Selection: Use a proper antenna (SMA or spring) to maximize the communication range.
  • Power Supply: Ensure a stable power supply to avoid communication issues.
  • Baud Rate Matching: The baud rate of the HC12 must match the baud rate of the microcontroller.
  • Interference: Avoid placing the module near sources of electromagnetic interference (e.g., motors, high-frequency circuits).

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Communication Between Modules:

    • Ensure both modules are set to the same channel and baud rate.
    • Verify the TX and RX connections between the HC12 and the microcontroller.
  2. Short Communication Range:

    • Check the antenna connection and ensure it is properly installed.
    • Avoid obstructions and interference in the communication path.
  3. Module Not Responding in Configuration Mode:

    • Ensure the SET pin is pulled LOW during power-up to enter configuration mode.
    • Verify the serial connection and baud rate (default is 9,600 bps).
  4. Data Corruption or Loss:

    • Use a lower baud rate for long-distance communication to improve reliability.
    • Ensure a stable power supply and proper grounding.

FAQs

Q: Can the HC12 communicate with other 433MHz devices?
A: No, the HC12 uses a proprietary protocol and cannot directly communicate with other 433MHz devices unless they use the same protocol.

Q: How do I change the HC12's baud rate or channel?
A: Enter configuration mode by pulling the SET pin LOW, then send AT commands via the serial interface. For example, use AT+B9600 to set the baud rate to 9,600 bps.

Q: Can I use multiple HC12 modules in the same area?
A: Yes, you can use multiple modules by assigning them different channels to avoid interference.

Q: What is the maximum data rate supported by the HC12?
A: The HC12 supports a maximum baud rate of 115,200 bps, but lower rates are recommended for long-range communication.

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