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.
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 |
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. |
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:
The HC12 can be configured using AT commands sent via the UART interface. For example:
AT+B9600
AT+C005
Below is an example of how to use the HC12 module with an Arduino UNO for basic communication:
// 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
}
}
No Communication Between Modules
Short Communication Range
Module Not Responding to AT Commands
Can the HC12 operate at 5V?
What is the maximum range of the HC12?
How do I reset the HC12 to factory settings?
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.