HC-12 no transmission

I'm trying to transfer data between two HC-12 wireless serial devices. I am following this tutorial: click here

I can't get the basic sketch (first sketch on that link) to work; when I upload the code to the Arduinos there is no reaction to me sending data through the serial monitor.

I checked the connections multiple times in order to confirm it is correct. I am following exactly as the tutorial I linked (except the antennas, I am using external ones).

Can you please help me to get to the bottom of this issue? Cheers.

Code:

#include <SoftwareSerial.h>

SoftwareSerial HC12(10, 11); // 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
    HC12.write(Serial.read());      // Send that data to HC-12
  }
}

Please post the code (using code tags), a wiring diagram (not Fritzing) and a photo of your setup.

Done :grin:

Your drawing of the connections does not follow the comment. The software serial constructor is (rx,tx) and the connections should go rx>tx and tx>rx. transmitter to receiver and receiver to transmitter

The module Tx should go to Arduino 10 and the module Rx to Arduino 11.

Please show a picture of your antennas. I have had very good results with my HC12's with a 17cm piece of straight wire. (1/4 wavelength 433 MHz).

The devices should not be too close when testing.

There have been issues with clone modules and crystal frequency mismatches giving poor performance. Where did you source yours from?

Your drawing of the connections does not follow the comment. The software serial constructor is (rx,tx) and the connections should go rx>tx and tx>rx. transmitter to receiver and receiver to transmitter
The module Tx should go to Arduino 10 and the module Rx to Arduino 11.

Ah so this was the culprit; cheers for that.

While we are on this topic; I am using standard 2.4ghz antenna from my old wifi card and nrf24.

However I was wondering; is it correct to use these antennas or should I be using different ones?

Cheers

I would doubt it. The HC12's are 433MHz devices.

If you dont want to destroy your modules, use the correct antennas, i.e. ones designed for 433Mhz.

Is there much difference between using an external antenna or the spring antenna that comes with the HC12?

A 17 cm straight piece of wire is much better than either the spring, or the wrong (2.4 GHz) antenna.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.