Hello,
I use Arduino pro mini 3.3V, HC12 modulus to transmit my data and have a problem.
At the beginning the modulu in baut rate 9600 works fine, I received data. After only two hours it did not work. All the data from HC12 are garbled. Then I turn to command mode, send "AT" and the response is also garbled.
I had tried to adjust baut rate. I had lowed baut rate from 9600 to 1200(or2400)). It worked but after 1 hour it happened again. All responses, including command mode were garbled. I have 4 chips and each chip has the same problem.
I will be appreciate for any advise if some one has experience of this HC112 Modulus. I do not find such problem in the internet.
Thanks
Please post your programs (for the sender and the receiver) and also post diagrams to show clearly how you have everything connected. A photo of a simple pencil drawing will be best. See this Simple Image Posting Guide
...R
every one I tried failed in minutes. send it
//based on code from: Tom Heylen
#include <SoftwareSerial.h>
#define rxPin 2
#define txPin 3
#define stPin 7
SoftwareSerial HC12(rxPin, txPin);
long baud = 9600;
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
pinMode(stPin, OUTPUT);
Serial.begin(baud);
Serial.println(); Serial.println();
digitalWrite(stPin, HIGH);
Serial.println("HC-12 Test & configure");
HC12.begin(9600);
Serial.println("HC-12 started");
if (HC12.isListening())
{
Serial.println("HC-12 is Listening ");
}
else
{
Serial.println("NOK");
}
{
if (!HC12.available())
Serial.println("HC-12 is not responding");
//while(1);
}
//test HC-12
digitalWrite(stPin, LOW);
delay(1200);
Serial.println("Sending AT+RX");
HC12.print("AT+RX");
Serial.println("command sent");
Serial.println("setup end"); Serial.println();
delay(500);
digitalWrite(stPin, HIGH);
if (HC12.available())
{
Serial.print("HC12.available()");
}
while (HC12.available()) // If HC-12 has data
{
Serial.write(HC12.read()); // Send the data to Serial monitor
}
digitalWrite(stPin, LOW);
while (Serial.available()) // If Serial monitor has data
{
HC12.write(Serial.read()); // Send that data to HC-12
}
digitalWrite(stPin, LOW);
}
void loop()
{
}
it reads once and never responds again. I tried using a 3.3V level converter on the TX side. no effect