Issues with HC-12 module

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.

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

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);

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

@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


Figure-1:

Sender Sketch/TX

#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:

#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
    }
  }
}


Figure-2:

1 Like

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?

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

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

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

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.

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?

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

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

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.

The HC12's are 5v devices.

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

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.

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

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.

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.

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.