Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
manual [2020/12/01 15:53]
bgfdsuperadmin [User Manual version 2.3B]
manual [2020/12/01 16:21]
bgfdsuperadmin
Line 1: Line 1:
 ====== HC-12 Wireless Serial Port Communication Module ====== ====== HC-12 Wireless Serial Port Communication Module ======
-=====User Manual version 2.3B =====+===== User Manual version 2.3B =====
 //updated from v1.1 English and v2.3 Chinese// //updated from v1.1 English and v2.3 Chinese//
  
-//Edited by Bluegoldfishdesign 20-Nov-20//+//Edited by Bluegoldfishdesign 01-Dec-20//
 {{ hc12:hc12pcb.png }} {{ hc12:hc12pcb.png }}
  
-=== Product Applications ===+==== Product Applications ====
   * Wireless sensor   * Wireless sensor
   * Community building security   * Community building security
Line 30: Line 30:
   * The number of bytes transmitted continuously is unlimited (FU1 and FU3 modes only)   * The number of bytes transmitted continuously is unlimited (FU1 and FU3 modes only)
   * Update software version through the serial port   * Update software version through the serial port
-=== Product Introduction ===+==== Product Introduction ====
 The HC-12 wireless serial port communication module is a new generation of The HC-12 wireless serial port communication module is a new generation of
 multi-channel embedded wireless data transmission module. Its wireless working multi-channel embedded wireless data transmission module. Its wireless working
Line 57: Line 57:
 maximum working current in any mode is 100mA (in the transmitting state). maximum working current in any mode is 100mA (in the transmitting state).
  
-=== Product Configuration ===+==== Product Configuration ====
 Standard configuration of the HC-12 module only contains one 433MHz-frequencyband Standard configuration of the HC-12 module only contains one 433MHz-frequencyband
 wireless communication module with IPEX20279-001E-03 standard RF socket. wireless communication module with IPEX20279-001E-03 standard RF socket.
Line 65: Line 65:
 application requirements. application requirements.
  
-=== Technical Details ===+==== Technical Details ====
 The HC-12 module uses a Silicon Labs Si4463 to provide the RF communications The HC-12 module uses a Silicon Labs Si4463 to provide the RF communications
 link. This is a high performance, low current, single-chip “EZRadioPRO” family link. This is a high performance, low current, single-chip “EZRadioPRO” family
Line 76: Line 76:
 onboard non-volatile flash memory. onboard non-volatile flash memory.
  
-=== Product Dimensions ===+==== Product Dimensions ====
 {{ hc12:hc12dimensions.png }} {{ hc12:hc12dimensions.png }}
-=== Definition of Pins ===+==== Definition of Pins ====
 The HC-12 module can be patch soldered, or have a 2.54mm-spacing pin header The HC-12 module can be patch soldered, or have a 2.54mm-spacing pin header
 attached and directly inserted onto the user’s PCB. The module has nine pins in attached and directly inserted onto the user’s PCB. The module has nine pins in
Line 103: Line 103:
 pin header that can be plugged into a PCB socket. pin header that can be plugged into a PCB socket.
  
-=== Wireless Serial Port Transparent Transmission ===+==== Wireless Serial Port Transparent Transmission ====
 (1) Simple introduction of working principle (1) Simple introduction of working principle
  
Line 186: Line 186:
 Note: Loopback test time delay means the round trip time taken for data that is sent to the input (RxD pin) of one module, to begin to emerge from the output (TxD pin) of the same module, where a second (remote) module has been configured with the TxD and RxD pins connected together. Note: Loopback test time delay means the round trip time taken for data that is sent to the input (RxD pin) of one module, to begin to emerge from the output (TxD pin) of the same module, where a second (remote) module has been configured with the TxD and RxD pins connected together.
  
-=== Module Parameter Setting AT Commands ===+==== Module Parameter Setting AT Commands ====
 AT commands are used to set module parameters and switch between module functions when the module is in command mode. After being set, these changes AT commands are used to set module parameters and switch between module functions when the module is in command mode. After being set, these changes
 will become valid only after exiting from command mode. Parameters are stored in onboard non-volatile flash memory, so will not be lost when power is removed. will become valid only after exiting from command mode. Parameters are stored in onboard non-volatile flash memory, so will not be lost when power is removed.
  
-(1) Entering command mode+== (1) Entering command mode ==
 There are two ways to enter command mode: There are two ways to enter command mode:
-1. while energized, pull Pin 5 (“SET”) low, +  - while energized, pull Pin 5 (“SET”) low, wait 40ms for command mode to engage 
-wait 40ms for command mode to engage +  disconnect the power supply, connect Pin 5 (“SET”) to GND, re-energize the module 
-2. disconnect the power supply, + 
-connect Pin 5 (“SET”) to GND, +Note: pin 5 has a 10k pullup resistor connected internally, allowing the pin to be driven by an open-collector output from an attached device. 
-re-energize the module + 
-Note: pin 5 has a 10k pullup resistor connected internally, allowing the pin to +Either of the above two methods will place the module in command mode ready to accept AT commands; releasing pin 5 (“SET”) in either case exits from command mode. If the module settings have changed after exiting from command mode, it will be switched to the new settings within 80ms. 
-be driven by an open-collector output from an attached device. + 
-Either of the above two methods will place the module in command mode ready to +When the second method (pin 5 “SET” tied to ground before power is applied), the module always enters command mode with the serial port configured for 9600bps, 8 data bits, no parity, 1 stop bit, irrespective of any previously configured settings. 
-accept AT commands; releasing pin 5 (“SET”) in either case exits from command + 
-mode. If the module settings have changed after exiting from command mode, it +== (2) Command instructions == 
-will be switched to the new settings within 80ms. +  AT
-When the second method (pin 5 “SET” tied to ground before power is applied), the +
-module always enters command mode with the serial port configured for 9600bps, 8 +
-data bits, no parity, 1 stop bit, irrespective of any previously configured +
-settings. +
-(2) Command instructions +
-• AT+
 Test command. Send command “AT” to the module, and the module returns “OK”. Test command. Send command “AT” to the module, and the module returns “OK”.
-• AT+Bxxxx +  * AT+Bxxxx 
-Change the serial port baud rate. The baud rate can be set to 1200bps, 2400bps, +Change the serial port baud rate. The baud rate can be set to 1200bps, 2400bps, 4800bps, 9600bps, 19,200bps, 38,400bps, 57,600bps, or 115,200bps. The default
-4800bps, 9600bps, 19,200bps, 38,400bps, 57,600bps, or 115,200bps. The default+
 value is 9600bps. value is 9600bps.
-e.g: To set the serial port baud rate of the module to 19,200bps, send command + 
-“AT+B19200” to the module, and the module will return “OK+B19200”. After exiting +e.g: To set the serial port baud rate of the module to 19,200bps, send command “AT+B19200” to the module, and the module will return “OK+B19200”. After exiting from command mode, the module will begin to communicate at 19,200bps.  
-from command mode, the module will begin to communicate at 19,200bps. +  AT+Cxxx 
-• AT+Cxxx +Change wireless communication channel, selectable from 001 to 127 (for wireless channels exceeding 100, the communication distance cannot be guaranteed). The default value for the wireless channel is 001, with a working frequency of 433.4MHz. The channel stepping is 400KHz, and the working frequency of channel
-Change wireless communication channel, selectable from 001 to 127 (for wireless +
-channels exceeding 100, the communication distance cannot be guaranteed). The +
-default value for the wireless channel is 001, with a working frequency of +
-433.4MHz. The channel stepping is 400KHz, and the working frequency of channel+
 100 is 473.0MHz. 100 is 473.0MHz.
-e.g: To set the module to work on channel 21, send command “AT+C021” to the + 
-module, and the module will return “OK+C021”. After exiting from command mode, +e.g: To set the module to work on channel 21, send command “AT+C021” to the module, and the module will return “OK+C021”. After exiting from command mode, the module will work on channel 21, with a working frequency of 441.4MHz. Note: As the wireless receiving sensitivity of the HC-12 module is relatively 
-the module will work on channel 21, with a working frequency of 441.4MHz. +high, when the serial port baud rate is greater than 9600bps five adjacent channels should be staggered for use. Even when the serial port baud rate is not 
-Note: As the wireless receiving sensitivity of the HC-12 module is relatively +greater than 9600bps, over short distances (less than 10m) also five adjacent channels should be staggered for use. 
-high, when the serial port baud rate is greater than 9600bps five adjacent +  AT+FUx 
-channels should be staggered for use. Even when the serial port baud rate is not +Change the serial port transparent transmission mode of the module. Four modes are available, namely FU1, FU2, FU3, and FU4. Only when the serial port speed, 
-greater than 9600bps, over short distances (less than 10m) also five adjacent +channel, and transparent transmission mode of two modules is set to be the same, can normal wireless communications occur. For more details, please see the above section “Wireless Serial Port Transparent Transmission”. 
-channels should be staggered for use. +
-• AT+FUx +
-Change the serial port transparent transmission mode of the module. Four modes +
-are available, namely FU1, FU2, FU3, and FU4. Only when the serial port speed, +
-channel, and transparent transmission mode of two modules is set to be the same, +
-can normal wireless communications occur. For more details, please see the above +
-section “Wireless Serial Port Transparent Transmission”.+
 e.g: Send command “AT+FU1” to the module, and the module returns “OK+FU1”. e.g: Send command “AT+FU1” to the module, and the module returns “OK+FU1”.
-• AT+Px +  * AT+Px 
-Set the transmitting power of the module, with x selectable from 1 to 8. The +Set the transmitting power of the module, with x selectable from 1 to 8. The corresponding transmitting power of the module is as shown below: 
-corresponding transmitting power of the module is as shown below: +|x value  |   |   |   |   |   |   |   |   | 
-x value 1 2 3 4 5 6 7 8 +|Transmitting power of module  |  -1 dBm (0.8mW)  |  2 dBm (1.6mW)  |  5 dBm (3.2mW)   |  8 dBm (6.3mW)  |  11 dBm (12mW)  |  14 dBm (25mW)  |  17 dBm (50mW)  |  20 dBm (100mW)  | 
-Transmitting + 
-power of module +The default value is 8, and the higher the transmitting power, the farther the possible wireless communication distance. When the transmitting power level is set to 1, the transmitting power is at the minimum. Generally speaking, every time the transmitting power is reduced by 6dB, the communication distance will be reduced by half. 
--1 dBm + 
-(0.8mW) +e.g: Send command “AT+P5” to the module, and the module returns “OK+P5”. After exiting from command mode, the transmitting power of the module will be set to 11dBm. 
-2 dBm +  AT+Ry 
-(1.6mW) +Obtain a single parameter from the module, where y is any letter among B, C, F, and P, respectively representing: baud rate, communication channel, serial port
-5 dBm +
-(3.2mW) +
-8 dBm +
-(6.3mW) +
-11 dBm +
-(12mW) +
-14 dBm +
-(25mW) +
-17 dBm +
-(50mW) +
-20 dBm +
-(100mW) +
-The default value is 8, and the higher the transmitting power, the farther the +
-possible wireless communication distance. When the transmitting power level is +
-set to 1, the transmitting power is at the minimum. Generally speaking, every +
-time the transmitting power is reduced by 6dB, the communication distance will +
-be reduced by half. +
-e.g: Send command “AT+P5” to the module, and the module returns “OK+P5”. After +
-exiting from command mode, the transmitting power of the module will be set to +
-11dBm. +
-• AT+Ry +
-Obtain a single parameter from the module, where y is any letter among B, C, F, +
-and P, respectively representing: baud rate, communication channel, serial port+
 transparent transmission mode, and transmitting power. transparent transmission mode, and transmitting power.
 +
 Example 1: Example 1:
-Send command “AT+RB” to the module, and if the module returns “OK+B9600” it is +Send command “AT+RB” to the module, and if the module returns “OK+B9600” it is confirmed that the serial port baud rate of the module is 9600bps. 
-confirmed that the serial port baud rate of the module is 9600bps.+
 Example 2: Example 2:
-Send command “AT+RC” to the module, and if the module returns “OK+RC001” it is +Send command “AT+RC” to the module, and if the module returns “OK+RC001” it is confirmed that the communication channel of the module is 001. 
-confirmed that the communication channel of the module is 001.+
 Example 3: Example 3:
-Send command “AT+RF” to the module, and if the module returns “OK+FU3” it is +Send command “AT+RF” to the module, and if the module returns “OK+FU3” it is confirmed that the module is working in serial port transparent transmission
-confirmed that the module is working in serial port transparent transmission+
 mode FU3. mode FU3.
 +
 Example 4: Example 4:
 Send command “AT+RP” to the module, and if the module returns “OK+RP:+20dBm” it Send command “AT+RP” to the module, and if the module returns “OK+RP:+20dBm” it
 is confirmed that the transmitting power of module is set to 20dBm (100mW). is confirmed that the transmitting power of module is set to 20dBm (100mW).
-• AT+RX + 
-Obtain all parameters from the module. Returns serial port transparent +  * AT+RX 
-transmission mode, serial port baud rate, communication channel, and+Obtain all parameters from the module. Returns serial port transparent transmission mode, serial port baud rate, communication channel, and
 transmitting power in that order. transmitting power in that order.
-e.g: Send command “AT+RX” to the module, and the module returns “OK+FU3\r\n + 
-OK+B9600\r\n OK+C001\r\n OK+RP:+20dBm\r\n”. (“\r\n” means return\newline) +e.g: Send command “AT+RX” to the module, and the module returns “OK+FU3\r\n OK+B9600\r\n OK+C001\r\n OK+RP:+20dBm\r\n”. (“\r\n” means return\newline) 
-• AT+Udps + 
-Set data bits (d), parity (p), and stop bits (s) for serial port communication. +  * AT+Udps 
-For parity, N means none, O means odd check, and E means even check. For stop +Set data bits (d), parity (p), and stop bits (s) for serial port communication. For parity, N means none, O means odd check, and E means even check. For stop bits, 1 means one stop bit, 2 means two stop bits, and 3 means 1.5 stop bits.  
-bits, 1 means one stop bit, 2 means two stop bits, and 3 means 1.5 stop bits. + 
-e.g: To set the serial port format to eight data bits, odd parity, and one stop +e.g: To set the serial port format to eight data bits, odd parity, and one stop bit, send command “AT+U8O1” to the module. The module will return “OK+U8O1”. 
-bit, send command “AT+U8O1” to the module. The module will return “OK+U8O1”. + 
-• AT+V+  * AT+V
 Request firmware version information from the module. Request firmware version information from the module.
 +
 e.g: Send command “AT+V” to the module, and the module returns “HC-12_V2.3”. e.g: Send command “AT+V” to the module, and the module returns “HC-12_V2.3”.
-• AT+SLEEP + 
-After receiving this command, the module will enter sleep mode upon exiting from +  * AT+SLEEP 
-command mode, with a working current of about 22uA. This mode doesn’t allow +After receiving this command, the module will enter sleep mode upon exiting from command mode, with a working current of about 22uA. This mode doesn’t allow serial port data transmission. Upon entering command mode again the module will exit from sleep mode automatically. 
-serial port data transmission. Upon entering command mode again the module will + 
-exit from sleep mode automatically. +e.g: When wireless data transmission is not needed, to save power send command “AT+SLEEP” to the module, and the module will return “OK+SLEEP”. Upon exit from command mode the working current will drop to about 22uA. 
-e.g: When wireless data transmission is not needed, to save power send command + 
-“AT+SLEEP” to the module, and the module will return “OK+SLEEP”. Upon exit from +  * AT+DEFAULT 
-command mode the working current will drop to about 22uA. +Set serial port baud rate and configuration, communication channel, power, and serial port transparent transmission mode back to the factory default values. 
-• AT+DEFAULT + 
-Set serial port baud rate and configuration, communication channel, power, and +e.g: Send command “AT+DEFAULT” to the module, and the module returns “OK+DEFAULT”, with the factory default values restored. The factory default serial port baud rate is 9600bps, 8 data bits, no parity, 1 stop bit, communication channel is 001, transmitting power is 20dBm, and serial port transparent transmission mode is FU3. 
-serial port transparent transmission mode back to the factory default values. + 
-e.g: Send command “AT+DEFAULT” to the module, and the module returns +  * AT+UPDATE 
-“OK+DEFAULT”, with the factory default values restored. The factory default +Puts the module in the state of waiting for a software update. After receiving this command the module will not respond to any further AT commands until power
-serial port baud rate is 9600bps, 8 data bits, no parity, 1 stop bit, +
-communication channel is 001, transmitting power is 20dBm, and serial port +
-transparent transmission mode is FU3. +
-• AT+UPDATE +
-Puts the module in the state of waiting for a software update. After receiving +
-this command the module will not respond to any further AT commands until power+
 has been cycled. has been cycled.
-Design Considerations + 
-• Do not connect a light-emitting diode and resistor directly to the +==== Design Considerations ==== 
-module's TxD output as this may affect serial port communication. +  Do not connect a light-emitting diode and resistor directly to the module's TxD output as this may affect serial port communication. 
-• If using a PC or MCU to dynamically modify the module parameters, after +  If using a PC or MCU to dynamically modify the module parameters, after pulling pin 5 (“SET”) low wait at least 40ms before sending any AT commands to the module. After releasing pin 5 (“SET”), wait at least 80ms for the module to return to serial port pass-through mode. 
-pulling pin 5 (“SET”) low wait at least 40ms before sending any AT +  The HC-12 may require up to 100mA of current when transmitting. Ensure sufficient current is available – a USB bridge device may not be able to supply sufficient current. It is recommended that a reservoir capacitor be provided across the power supply of at least 22uF, preferably 1000uF. 
-commands to the module. After releasing pin 5 (“SET”), wait at least 80ms +
-for the module to return to serial port pass-through mode. +
-• The HC-12 may require up to 100mA of current when transmitting. Ensure +
-sufficient current is available – a USB bridge device may not be able to +
-supply sufficient current. It is recommended that a reservoir capacitor be +
-provided across the power supply of at least 22uF, preferably 1000uF.+
 edited by Robert Rozee, 15 January 2016 edited by Robert Rozee, 15 January 2016
 +further edited by Chris Morgan (Bluegoldfish Design), 1 December 2020