I recently decided to start working with wireless communication with Arduino UNO. I decided to go with the HC-12 wireless communication board and bought it. I could not find a proper tutorial oh how to use it. I would be pleased if you could give me a simplest circuit like turning on an led wirelessley with the code. I will be able to develop it afterwards. Thank you in advance.
You have tried google ? For example:
1. Build the HC12 + UNO + NANO based circuit as follows.
2. Upload the following Sketches in UNO and NANO.
UNO Codes:
#include <SoftwareSerial.h>
SoftwareSerial SUART(10, 11); //RX, TX
void setup()
{
Serial.begin(9600);
SUART.begin(9600);
}
void loop()
{
if (Serial.available() > 0)
{
byte x = Serial.read(); //x = 0x35
SUART.write(x); //goes 0x35
}
}
NANO Codes:
#include <SoftwareSerial.h>
SoftwareSerial SUART(10, 11); //RX, TX
void setup()
{
Serial.begin(9600);
SUART.begin(9600);
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
}
void loop()
{
if(SUART.available()>0)
{
byte x = SUART.read(); //x = 0x35
//Serial.print(x, HEX);
//while(1);
x = (x - '0');
for (int i= 0; i<x; i++)
{
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000);
}
digitalWrite(13, LOW);
}
}
3. Open SM1 at 9600 Bd with 'No line ending' tab enabled.
4. Enter 5 in the InputBox of UNO and click on send Button.
5. Check that L (built-in LED of NANO) blinks for 5 times.
6. Repeat Step-4 with some other value <= 9.