# Issues with HC-12 module

**URL:** <https://forum.arduino.cc/t/issues-with-hc-12-module/898802>\
**Category:** Networking, Protocols, and Devices\
**Created:** [August 24, 2021, 3:52pm UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802 "2021-08-24T15:52:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![cosmicprankster](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cosmicprankster](https://forum.arduino.cc/u/cosmicprankster)\
**Post date:** [August 24, 2021, 3:52pm UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802/1 "2021-08-24T15:52:53Z")

</div>

Hi, I recently purchased 2 HC-12 modules (originals) for a project I'm doing that requires reliable comms for ~100m.  
These boards in particular have given me a great deal of trouble and I cannot seem to get anything out of them. I am still at the stage of verifying that these modules work and am close to concluding that they don't.  
I have follow a lot of tutorials online to try and get these two modules to communicate to each other (connected to separate computers a few meters apart) with no success.  
Most recently i set the SET pin to LOW and tried to get some information off of the device, again to no avail.  
I tried powering the device straight from the Arduino before putting a capacitor in parallel to the power source/ground.  
Any help would be greatly appreciated as I am not sure where to go from here.  
Thank you very much.

P.S. I used very basic code from tutorials so don't feel it necessary to post the code here, but let me know if you think it'd help. Same with the wiring, I can upload a picture if needed.

---

<div class="post-metadata">

**Author:** ![paulpaulson](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulpaulson/32/363643_2.png) [@paulpaulson](https://forum.arduino.cc/u/paulpaulson)\
**Post date:** [August 24, 2021, 4:02pm UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802/2 "2021-08-24T16:02:21Z")

</div>

Hello  
Did you connect and solder the arial to the moduls?  
Did you connect the RX/TX lines correct?

---

<div class="post-metadata">

**Author:** ![cosmicprankster](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cosmicprankster](https://forum.arduino.cc/u/cosmicprankster)\
**Post date:** [August 24, 2021, 4:15pm UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802/3 "2021-08-24T16:15:59Z")

</div>

Yes! The arial that came with the module is soldered as well as a 5 pin header.  
RX/TX lines are connected directly to digital 2/3 and the serial is initalised as:  
SoftwareSerial HC12(RXPin,TXPin);

---

<div class="post-metadata">

**Author:** ![cosmicprankster](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cosmicprankster](https://forum.arduino.cc/u/cosmicprankster)\
**Post date:** [August 24, 2021, 4:17pm UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802/4 "2021-08-24T16:17:59Z")

</div>

Please note I have also tried initialising as SoftwareSerial HC12(TXPin,RXPin); as opinions seem to change in which (if either) is correct

---

<div class="post-metadata">

**Author:** ![GolamMostafa](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/golammostafa/32/239011_2.png) [@GolamMostafa](https://forum.arduino.cc/u/GolamMostafa)\
**Post date:** [August 24, 2021, 4:38pm UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802/5 "2021-08-24T16:38:50Z")

</div>

@cosmicprankster  
Giving below the setup (Fig-1) and codes of a working project. You may try this example to check the functionalities of your HC12 Modules. Here, the TX receives a charcater L or R from the InputBox (Fig-2) of Serial Monitor and sends to RX. The RX Module receives the charcater and turns on LEDL or LEDR.  
**Setup**

 ![hc12-2](https://europe1.discourse-cdn.com/arduino/original/4X/1/9/4/194c34649342f39f2a0bdc49a6c01f59174b4365.png)  
Figure-1:

**Sender Sketch/TX**

```cpp
#include<SoftwareSerial.h>
SoftwareSerial SUART(10, 11); //SRX = DPin-10, STX = DPin-11

void setup() 
{
  Serial.begin(9600);
  SUART.begin(9600); //activate Software Serial Port (SUART)
}

void loop() 
{
  byte y = Serial.available();//check if a charcater has come from Serial Monitor
  if(y != 0) //a charcater hhas arrived
  {
    char x = Serial.read(); //read the charcater
    SUART.print(x); //send the charcater to NANO-2
  }
}

```

**Receiver Sketch/RX:**

```cpp
#include<SoftwareSerial.h>
SoftwareSerial SUART(10, 11); //SRX = DPin-10, STX = DPin-11

void setup()
{
  Serial.begin(9600);
  SUART.begin(9600); //activate Software Serial Port (SUART)
  pinMode(7, OUTPUT); //DPin-7 works as output line
  pinMode(8, OUTPUT);
}

void loop()
{
  byte y = SUART.available();//check if a charcater has come from NANO-1 via SUART Port
  if (y != 0) //a charcater has arrived
  {
    char x = SUART.read(); //read the charcater
    if (x == 'L')
    {
      digitalWrite(7, HIGH); //L has arrived; ignite LEDL
      digitalWrite(8, LOW); //LEDR is OFF
    }
    if (x == 'R')
    {
      digitalWrite(7, LOW); //R has arrived; ignite LEDR
      digitalWrite(8, HIGH); //LEDR is ON
    }
  }
}

```

 ![SerialMonitorX](https://europe1.discourse-cdn.com/arduino/original/4X/2/7/9/27926cb41c7dd58754722945a3dc517f429c7bbc.png)  
Figure-2:

---

<div class="post-metadata">

**Author:** ![cosmicprankster](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cosmicprankster](https://forum.arduino.cc/u/cosmicprankster)\
**Post date:** [August 24, 2021, 4:51pm UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802/6 "2021-08-24T16:51:38Z")

</div>

Thank you very much for the example. It does look similar to the ones I have tried before but will nevertheless try this one as well! Thank you. Do you think there is any merit to using a Nano over an UNO?

---

<div class="post-metadata">

**Author:** ![GolamMostafa](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/golammostafa/32/239011_2.png) [@GolamMostafa](https://forum.arduino.cc/u/GolamMostafa)\
**Post date:** [August 24, 2021, 5:13pm UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802/7 "2021-08-24T17:13:11Z")

</div>

> [@cosmicprankster](#):
>
> Do you think there is any merit to using a Nano over an UNO?

No! I used them as they were already placed in my breadboards.

---

<div class="post-metadata">

**Author:** ![Nick\_Pyner](https://avatars.discourse-cdn.com/v4/letter/n/e8c25b/32.png) [@Nick\_Pyner](https://forum.arduino.cc/u/Nick_Pyner)\
**Post date:** [August 25, 2021, 3:23am UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802/8 "2021-08-25T03:23:22Z")

</div>

> [@cosmicprankster](#):
>
> I have also tried initialising as SoftwareSerial HC12(TXPin,RXPin); as opinions seem to change in which (if either) is correct

No, there is a correct way, Rx \< Tx and Tx \> Rx, and there is an opinion, which is erroneous, and I think you can safely conclude that the diagram in reply #5 is amongst the latter. Until you get that firmly sorted, there is no point in proceeding. This may indeed have been your only problem in the first place......

You will find a comprehensive tutorial [here](https://create.arduino.cc/projecthub/franciscomoreirapcb/how-to-communicate-two-hc12-module-with-arduino-a0b5fa)

> **[Arduino Project Hub](https://projecthub.arduino.cc)**
>
> Arduino Project Hub is a website for sharing tutorials and descriptions of projects made with Arduino boards

in which the code is clear, along with pictures, and a manual which leaves you in no doubt about how to connect it properly \>\>\> [here](https://r.search.yahoo.com/_ylt=AwrWnHp2sSVhslQAOwQ36At.;_ylu=Y29sbwNncTEEcG9zAzEEdnRpZAMEc2VjA3Ny/RV=2/RE=1629889015/RO=10/RU=http%3a%2f%2fstatics3.seeedstudio.com%2fassets%2ffile%2fbazaar%2fproduct%2fHC-12_english_datasheets.pdf/RK=2/RS=nZbfGriFpU6YQTeXXJ6X56U1To0-)

---

<div class="post-metadata">

**Author:** ![cattledog](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/cattledog/32/217816_2.png) [@cattledog](https://forum.arduino.cc/u/cattledog)\
**Post date:** [August 25, 2021, 7:10am UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802/9 "2021-08-25T07:10:53Z")

</div>

> [@cosmicprankster](#):
>
> Most recently i set the SET pin to LOW and tried to get some information off of the device, again to no avail.

I set my devices using a usb/ttl converter connected to the header pins of the hc12 and a terminal program on the pc. rx\>tx and tx\>rx.

I have had very good range through walls with 2400 baud and straight wire 1/4 wavelength antennas.

Factory original modules are important, and many clones are defective with either bad frequency crystals, or a board error which limits range.

---

<div class="post-metadata">

**Author:** ![cosmicprankster](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cosmicprankster](https://forum.arduino.cc/u/cosmicprankster)\
**Post date:** [August 25, 2021, 3:53pm UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802/10 "2021-08-25T15:53:22Z")

</div>

Thank you for clarification! I suspected that RX \< TX, TX \> RX so I don't believe that is my issues. I will make the above example following the connection suggestions from the project that you have attached and will update the thread on my progress!  
I suspect I will run into the same issue as I have already tried a very similar solution to no avail.  
Is there anything I could've accidentally done to fry the board?

---

<div class="post-metadata">

**Author:** ![paulpaulson](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulpaulson/32/363643_2.png) [@paulpaulson](https://forum.arduino.cc/u/paulpaulson)\
**Post date:** [August 25, 2021, 4:14pm UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802/11 "2021-08-25T16:14:20Z")

</div>

Hello  
You may check your sketch running without the HF-Mdule.

---

<div class="post-metadata">

**Author:** ![Geek\_Emeritus](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/geek_emeritus/32/238995_2.png) [@Geek\_Emeritus](https://forum.arduino.cc/u/Geek_Emeritus)\
**Post date:** [August 25, 2021, 4:14pm UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802/12 "2021-08-25T16:14:55Z")

</div>

Every HC-12 I tried fried in seconds. A few may have lasted long enough to get programmed, but fried when I tried to read the setup data. It may be that the serial ports require 3.3 volts

---

<div class="post-metadata">

**Author:** ![Nick\_Pyner](https://avatars.discourse-cdn.com/v4/letter/n/e8c25b/32.png) [@Nick\_Pyner](https://forum.arduino.cc/u/Nick_Pyner)\
**Post date:** [August 25, 2021, 4:29pm UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802/13 "2021-08-25T16:29:44Z")

</div>

> [@cosmicprankster](#):
>
> Is there anything I could've accidentally done to fry the board?

I don't know much about them. Connecting Rx,Tx the wrong way round won't do any damage. Power consumption varies but is very frugal, so running it off Arduino is clearly OK. Maybe you have other peripherals you don't mention that are getting into the act.

---

<div class="post-metadata">

**Author:** ![cattledog](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/cattledog/32/217816_2.png) [@cattledog](https://forum.arduino.cc/u/cattledog)\
**Post date:** [August 25, 2021, 4:40pm UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802/14 "2021-08-25T16:40:13Z")

</div>

> [@Geek\_Emeritus](#):
>
> It may be that the serial ports require 3.3 volts

The HC12's are 5v devices.

---

<div class="post-metadata">

**Author:** ![cosmicprankster](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cosmicprankster](https://forum.arduino.cc/u/cosmicprankster)\
**Post date:** [August 25, 2021, 4:48pm UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802/15 "2021-08-25T16:48:23Z")

</div>

This is from the datasheet about power supply:  
Power supply input,  
DC3.2V-5.5V, with load capacity not less than 200mA.  
Not sure if my issue is stemming from there but as you note, 5V is clearly okay

---

<div class="post-metadata">

**Author:** ![cosmicprankster](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cosmicprankster](https://forum.arduino.cc/u/cosmicprankster)\
**Post date:** [August 25, 2021, 4:51pm UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802/16 "2021-08-25T16:51:55Z")

</div>

Yeah I'm not sure! I'm frustrated because I feel there is no absolute way to check if they are actually functional or not... As I said, I can't seem to even communicate through the SET pin which is indicative that the module is fried... There were other components in the circuit to begin with (potentiometers/LEDs) but I have since tried the boards on their own with no peripherals so I am logically at a loss.

---

<div class="post-metadata">

**Author:** ![cosmicprankster](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cosmicprankster](https://forum.arduino.cc/u/cosmicprankster)\
**Post date:** [August 25, 2021, 4:52pm UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802/17 "2021-08-25T16:52:50Z")

</div>

How did you determine that they were fried? Have you tried with them connected to 3.3V?

---

<div class="post-metadata">

**Author:** ![cattledog](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/cattledog/32/217816_2.png) [@cattledog](https://forum.arduino.cc/u/cattledog)\
**Post date:** [August 25, 2021, 5:27pm UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802/18 "2021-08-25T17:27:54Z")

</div>

> [@cosmicprankster](#):
>
> I'm frustrated because I feel there is no absolute way to check if they are actually functional or not... As I said, I can't seem to even communicate through the SET pin which is indicative that the module is fried...

Do you have a USB/TTL serial adaptor? Using a terminal program on the PC and the adaptor you should be able to communicate with the module in SET mode.

---

<div class="post-metadata">

**Author:** ![Geek\_Emeritus](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/geek_emeritus/32/238995_2.png) [@Geek\_Emeritus](https://forum.arduino.cc/u/Geek_Emeritus)\
**Post date:** [August 25, 2021, 6:01pm UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802/19 "2021-08-25T18:01:37Z")

</div>

They do not respond when I ask them how to tell me how they are set up. They do not respond when first connected. This is all irrelevant, because the 432 MHz band is not an ISM band in America, so they are useless to me.

---

<div class="post-metadata">

**Author:** ![cosmicprankster](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cosmicprankster](https://forum.arduino.cc/u/cosmicprankster)\
**Post date:** [August 25, 2021, 6:16pm UTC](https://forum.arduino.cc/t/issues-with-hc-12-module/898802/20 "2021-08-25T18:16:05Z")

</div>

No unfortunately I do not. Im thinking of moving to using a NRF24L01 for now, then returning to the HC12 in some time when the project has sufficiently progressed (at which point I might consider getting a USB/TTL serial adaptor.

[Next page](https://forum.arduino.cc/t/issues-with-hc-12-module/898802.md?page=2)
