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

How to Use HC-12: Examples, Pinouts, and Specs

Image of HC-12
Cirkit Designer LogoDesign with HC-12 in Cirkit Designer

Introduction

The HC-12 is a wireless serial communication module that operates in the 433 MHz frequency range. It is designed for long-range data transmission, with a range of up to 1,000 meters in open space under optimal conditions. The module supports UART (Universal Asynchronous Receiver-Transmitter) communication, making it easy to interface with microcontrollers, such as Arduino, Raspberry Pi, and other embedded systems.

Explore Projects Built with HC-12

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Raspberry Pi and H743-SLIM V3 Controlled Servo System with GPS and Telemetry
Image of Avionics Wiring Diagram: A project utilizing HC-12 in a practical application
This circuit is designed for a UAV control system, featuring an H743-SLIM V3 flight controller connected to multiple servos for control surfaces, a GPS module for navigation, a telemetry radio for communication, and a digital airspeed sensor for flight data. The system is powered by a LiPo battery and includes a Raspberry Pi for additional processing and control tasks.
Cirkit Designer LogoOpen Project in Cirkit Designer
GPS-Enabled Telemetry Drone with Speedybee F405 WING and Brushless Motor
Image of Pharmadrone Wiring: A project utilizing HC-12 in a practical application
This circuit is designed for a remote-controlled vehicle or drone, featuring a flight controller that manages a brushless motor, servomotors for actuation, telemetry for data communication, and a GPS module for positioning. It is powered by a lipo battery and includes a receiver for remote control inputs.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Emergency Alert System with NUCLEO-F072RB, SIM800L, and GPS NEO 6M
Image of women safety: A project utilizing HC-12 in a practical application
This circuit is an emergency alert system that uses a NUCLEO-F072RB microcontroller to send SMS alerts and make calls via a SIM800L GSM module, while obtaining location data from a GPS NEO 6M module. The system is powered by a Li-ion battery and includes a TP4056 module for battery charging and protection, with a rocker switch to control power to the microcontroller.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Automatic Passenger Counter and Temperature Sensor with Wi-Fi Connectivity
Image of Embedded Circuit: A project utilizing HC-12 in a practical application
This circuit is an automatic passenger counter and temperature sensor system powered by a solar charger. It uses an ESP32 microcontroller to interface with two capacitive proximity sensors for counting passengers and a DHT22 sensor for monitoring temperature and humidity, with data being sent to a Blynk mobile app and Google Sheets for real-time tracking and logging.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with HC-12

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 Avionics Wiring Diagram: A project utilizing HC-12 in a practical application
Raspberry Pi and H743-SLIM V3 Controlled Servo System with GPS and Telemetry
This circuit is designed for a UAV control system, featuring an H743-SLIM V3 flight controller connected to multiple servos for control surfaces, a GPS module for navigation, a telemetry radio for communication, and a digital airspeed sensor for flight data. The system is powered by a LiPo battery and includes a Raspberry Pi for additional processing and control tasks.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Pharmadrone Wiring: A project utilizing HC-12 in a practical application
GPS-Enabled Telemetry Drone with Speedybee F405 WING and Brushless Motor
This circuit is designed for a remote-controlled vehicle or drone, featuring a flight controller that manages a brushless motor, servomotors for actuation, telemetry for data communication, and a GPS module for positioning. It is powered by a lipo battery and includes a receiver for remote control inputs.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of women safety: A project utilizing HC-12 in a practical application
Battery-Powered Emergency Alert System with NUCLEO-F072RB, SIM800L, and GPS NEO 6M
This circuit is an emergency alert system that uses a NUCLEO-F072RB microcontroller to send SMS alerts and make calls via a SIM800L GSM module, while obtaining location data from a GPS NEO 6M module. The system is powered by a Li-ion battery and includes a TP4056 module for battery charging and protection, with a rocker switch to control power to the microcontroller.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Embedded Circuit: A project utilizing HC-12 in a practical application
ESP32-Based Automatic Passenger Counter and Temperature Sensor with Wi-Fi Connectivity
This circuit is an automatic passenger counter and temperature sensor system powered by a solar charger. It uses an ESP32 microcontroller to interface with two capacitive proximity sensors for counting passengers and a DHT22 sensor for monitoring temperature and humidity, with data being sent to a Blynk mobile app and Google Sheets for real-time tracking and logging.
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 communication
  • Data logging and telemetry

Technical Specifications

The HC-12 module is highly versatile and offers a range of configurable parameters to suit various applications. Below are its key technical details:

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 bps to 115,200 bps
Transmit Power Up to 100 mW (20 dBm)
Antenna Interface IPEX or soldered wire
Operating Temperature -40°C to +85°C

Pin Configuration and Descriptions

The HC-12 module has a total of 4 pins. Below is the pinout and description:

Pin Name Pin Number Description
VCC 1 Power supply input (3.2V to 5.5V)
GND 2 Ground
TXD 3 UART Transmit pin (connect to RX of MCU)
RXD 4 UART Receive pin (connect to TX of MCU)

Usage Instructions

The HC-12 module is straightforward to use and can be integrated into a variety of projects. Below are the steps and best practices for using the module:

How to Use the HC-12 in a Circuit

  1. Power the Module: Connect the VCC pin to a 3.3V or 5V power source and the GND pin to ground.
  2. Connect UART Pins:
    • Connect the TXD pin of the HC-12 to the RX pin of your microcontroller.
    • Connect the RXD pin of the HC-12 to the TX pin of your microcontroller.
  3. Attach an Antenna: For optimal performance, connect an appropriate antenna to the module's IPEX connector or solder a wire antenna to the designated pad.
  4. Configure the Module (Optional): Use AT commands to configure parameters such as baud rate, channel, and transmission power. This can be done via a serial terminal or directly from your microcontroller.
  5. Write Code: Use UART communication to send and receive data wirelessly.

Important Considerations and Best Practices

  • Power Supply: Ensure a stable power supply to avoid communication issues. Use decoupling capacitors if necessary.
  • Antenna Placement: Place the antenna away from metal objects and other sources of interference for maximum range.
  • Baud Rate Matching: Ensure the baud rate of the HC-12 matches the baud rate of your microcontroller.
  • Channel Selection: If using multiple HC-12 modules, configure them to operate on different channels to avoid interference.

Example Code for Arduino UNO

Below is an example of how to use the HC-12 module with an Arduino UNO for basic wireless communication:

#include <SoftwareSerial.h>

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

void setup() {
  Serial.begin(9600);       // Start Serial Monitor at 9600 baud
  HC12.begin(9600);         // Start HC-12 communication at 9600 baud
  Serial.println("HC-12 Test Initialized");
}

void loop() {
  // Check if data is available from the Serial Monitor
  if (Serial.available()) {
    String input = Serial.readString(); // Read input from Serial Monitor
    HC12.println(input);               // Send input to HC-12
    Serial.println("Sent: " + input);  // Echo back the sent data
  }

  // Check if data is available from the HC-12
  if (HC12.available()) {
    String received = HC12.readString(); // Read data from HC-12
    Serial.println("Received: " + received); // Print received data
  }
}

Notes on the Code

  • Replace 10 and 11 with the appropriate pins if using different connections.
  • Ensure the baud rate in HC12.begin() matches the HC-12's configured baud rate.

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Communication Between Modules

    • Cause: Mismatched baud rates or channels.
    • Solution: Use AT commands to verify and configure the baud rate and channel.
  2. Short Communication Range

    • Cause: Poor antenna placement or interference.
    • Solution: Ensure the antenna is properly connected and placed away from obstructions.
  3. Module Not Responding to AT Commands

    • Cause: Incorrect wiring or baud rate mismatch.
    • Solution: Double-check the wiring and ensure the baud rate matches the module's default (typically 9600 bps).
  4. Data Corruption

    • Cause: Noise or interference in the communication channel.
    • Solution: Use a lower baud rate or switch to a less congested channel.

FAQs

Q: Can I use the HC-12 with a 5V microcontroller?
A: Yes, the HC-12 supports a supply voltage of up to 5.5V and is compatible with 5V logic levels.

Q: How do I reset the HC-12 to factory settings?
A: Send the AT command AT+DEFAULT to the module via a serial terminal.

Q: What is the maximum data rate of the HC-12?
A: The HC-12 supports baud rates up to 115,200 bps, but the effective data rate depends on the environment and configuration.

Q: Can multiple HC-12 modules communicate with each other?
A: Yes, as long as they are configured to the same channel and baud rate.

By following this documentation, you can effectively integrate the HC-12 module into your projects for reliable wireless communication.