Hey.
I am trying to use two HC-12 modules to achieve wireless communication between two arduinos. The arduinos are connected like this:
VCC -> 5V
GND -> GND
RXD -> PIN 8
TXD -> PIN 7
SET -> NC
This is my code:
#include <SoftwareSerial.h>
SoftwareSerial HC12(7, 8); // HC-12 TX Pin, HC-12 RX Pin
void setup() {
Serial.begin(9600); // Serial port to computer
HC12.begin(9600); // Serial port to HC12
}
void loop() {
while (HC12.available()) { // If HC-12 has data
Serial.write(HC12.read()); // Send the data to Serial monitor
}
while (Serial.available()) { // If Serial monitor has data
int data = Serial.read();
Serial.print("Sending: ");
Serial.println(data);
HC12.write(data); // Send that data to HC-12
}
}
When running the sketch I am able to send messages one way by typing data in one serial monitor and it showing up in the serial monitor of the other arduino.
When I try to communicate the other way, this shows up in the serial monitor:
(Sent message is "Hey")
Sending: 72
Sending: 101
Sending: 121
Sending: 10
H⸮)
(Pictures should be attached to the post)
It looks like the arduino sending the data is also receiving it, and that the other arduino is not receiving any data.
What could be the problem?
I have also tried to set the SET pin on the HC-12 to GDN and sending an AT command, I get nothing in return.
I have seen through an SDR and an antenna that data is being sent over the air.




