HC12

I purchased 30 HC12’s and designed a simple Eagle CAD PCB which I got in and hooked everything up. I was sure to use a decoupling capacitor and a GP diode since my in voltage to the HC12 was 4.6V. (This dropped the voltage down to 3.9V) so I ran several Codes through it using a Arduino Pro Micro. I double checked the Serial out on it and everything is working fine on the Arduino. However… Out of 30… Not one will transmit. I have to be doing something wrong. Pin 2 (TX) Pin 3 (RX) and I’m running simple code but I can’t get these things to transmit anything. I can’t even get an AT command to respond. Is there something I could be missing? Checked GND… Checked VCC… Checked Voltage at the HC12. I’ve run the simple code and I’ve run more complex codes but nothing works… I even took the HC12’s and ran them on a bread board with the exact same circuit… Still nothing… Not even 1 ft… Any ideas anyone?

Transmit Code:

#include <SoftwareSerial.h>
#define setPin 4

SoftwareSerial HC12(2, 3);         // HC-12 TX Pin, HC-12 RX Pin
byte incomingByte;
String readBuffer = "";

void setup() {
  Serial.begin(9600);                   // Open serial port to computer
  HC12.begin(9600);                     // Open serial port to HC12
  pinMode(setPin, OUTPUT);
  digitalWrite(setPin, LOW);
  delay(250);
  HC12.write("AT+DEFAULT");
  delay(250);
  digitalWrite(setPin, HIGH);           // HC-12 normal, transparent mode
}
void loop() {
  delay(100);
  Serial.println("I am tran'smission");
  while (HC12.available()) {             // If HC-12 has data
    incomingByte = HC12.read();          // Store each incoming byte from HC-12
    readBuffer += char(incomingByte);    // Add each byte to ReadBuffer string variable
  }
  delay(1000);
  while (Serial.available()) {
    HC12.write(Serial.read());
  }
  HC12.write("123");
  Serial.println("Sending Signal...");
  while (HC12.available()) {
    Serial.write(HC12.read());
    Serial.println("");
    Serial.println("***********************");
  }
  readBuffer = "";
  delay(1000);
}

Receive Code:

#include <SoftwareSerial.h>
int setPin = 4;

SoftwareSerial HC12(3, 2);         // HC-12 TX Pin, HC-12 RX Pin
byte incomingByte;
String readBuffer = "";

void setup() {

  Serial.begin(9600);                   // Open serial port to computer
  HC12.begin(9600);                     // Open serial port to HC12
  pinMode(setPin, OUTPUT);
  digitalWrite(setPin, LOW);
  delay(250);
  HC12.write("AT+DEFAULT");
  delay(250);
  digitalWrite(setPin, HIGH);          // HC-12 normal, transparent mode
}
void loop() {
  delay(100);
  while (HC12.available()) {             // If HC-12 has data
    incomingByte = HC12.read();          // Store each icoming byte from HC-12
    readBuffer += char(incomingByte);    // Add each byte to ReadBuffer string variable
  }
  delay(100);
  while (Serial.available()) {
    HC12.write(Serial.read());
  }
  if (readBuffer == "Testing, testing...123") {
    Serial.println("DATA RECEIVED!!!");
    Serial.println("**************************");
    HC12.print(readBuffer);
    delay(100);
  }
  readBuffer = "";
  delay(1000);
}
[Code]

You need to beak the problem down into steps to find out exactly what isnt working.
How do you know the HC12s arnt transmitting?
Do you have a spectrum analyzer or some kind of receiver on 433 Mhz.
You need to test the HC12s by themselves without the Arduino in between.
This will require something to act as a serial terminal like a PC at each end and a ttl serial connection.
Why are you running the HC12s off 3.9 V?

@OP

It is very unusual to have this: HC12(2, 3) for one module and this: HC12(3, 2) for another module though the practice is not wrong; however, symmetrical declarations reduce the chance of connection errors.

I've the same problem with 4 HC-12
have you find the solution ?

RTFM: Wireless Function.

this information is from the HC-11 manual. it may be superseded in the HC-12, but it costs nothing to try it:

V. Wireless IO Function
Module can be set to be wireless IO control function through command.
For the module set to be controller (AT+FCMF command setting), its Pins 3, 4, and 5 can be
directly connected to negative and positive terminals of power supply, to control the level status of
corresponding pin of remote module.
For the module set to be controlled, driving capability of its Pins 3, 4, and 5 is: When the output is
high, and is forced to be low, the current of pin to ground is 18mA. When the level is low, Pins 3, 4
and 5 are connected to ground through an 180R resistance. Pay attention to reducing the output
current of IO port as much as possible, and if the output current is extremely high, normal work of
module cannot be ensured.
This function has two working modes: level following and level turnover.
Level following
One module sends AT+FCMF, and the other module sends AT+FCSF. After these commands are set,
the pin level value of latter module (FCSF) will keep consistent with that of former module (FCMF)
all along. For the former module, the interval between two level jumps of IO port shall be at least
50mS, and of course, this time can be ignored if the module is connected to a button.
Level turnover
When the command is modified, one module sends AT+FCMT, the other module sends AT+FCST,
and they can work in level turnover mode. When falling edge appears to Pins 3, 4 and 5 of the
former module (only respond to falling edge), the level of corresponding pins of latter module will
be turned over (from 0 to 1, or from 1 to 0). The level of controlled module is 0 when it is just
energized.