Arduino ProjectsLORA PROJECTS

Long Range RC Plane Transmitter and Receiver 15Km Lora by Reyax Rylr896

Long Range RC Plane Controller Description:

 

Long Range RC Plane Transmitter and Receiver Controller- The Long-range wireless control of an RC Plane is always a challenge. In this tutorial, you will learn how to make your own 5 to 15Km Long range RC plane Transmitter and Receiver controller using the 915Mhz Rylr896 / rylr890 Lora Transceiver modules by the Reyax Technologies. The same Long Range wireless control system can also be used with RC Cars and other electronic projects.


About the Sponsor of this project:

Long Range RC Plane

The PCB boards used in this project are sponsored by the PCBWay Company. PCBWay is quite professional in the field of PCB manufacturing; you can try their services at extremely low prices, Only 5 dollars for 10 PCBs and 30 dollars in total for 20 PCBs assembly, besides this the new members also get a 5 Dollars bonus. The Gerber files of the PCB board used in this project can be downloaded from the PCBWay official website.

Download Gerber Files:

We will be creating multiple channels for controlling the 1000KV Brushless DC Motor, I will be using a potentiometer for controlling the speed of Brushless motor, you can replace the potentiometer with a 2-axis analog joystick. Anyhow, using the potentiometer I can control the speed of Brushless Dc Motor to its full capacity.

Long Range RC Plane

We will also create two channels for controlling a pair of micro servo motors, these servo motors will be used for the Up and Down, and Left and Right Movement of the RC plane.

Long Range RC Plane

I am using delays in the program, if you want a quick response, you can remove the delays. The program still have some bugs, which I am sure while working on this project you will definitely fix them. Right now I am controlling only three angles 0, 90, and 180. If you want a smooth movement you can use different angles. Anyhow you can increase the number of channels; more buttons can be added to control lights or something else.

Before I am going to explain the circuit diagrams and programs, first let’s go through the components used in the making of Transmitter and receiver circuits.



Long Range RC Plane Transmitter Side:

Long Range RC Plane

This is the Transmitter side based on the Arduino Nano, you can solder everything on a single PCB to reduce the size, I will explain all the connections in a minute, next to it is the 2-axis Analog Joystick which is used to control the Servo Motors to control the Up-Down and Left-Right movement of the RC Plane.

About the 2 Axis Analog Joystick:

This joystick is nothing but a combination of two potentiometers for X and Y plane respectively. It reads the voltage through the potentiometer and gives analog values to the Arduino, and the analog value changes as we move the joystick shaft (which is simply the potentiometer pointer.

This joystick has a total of 5 pins clearly labeled with GND, +5V, VRx, VRy, and SW. This joystick also has a push-button. Out of these 5 pins we will be using only GND, +5V, VRx, and VRy.

Long Range RC Plane

The module with the Golden color Antenna is the Rylr896 or Rylr890 Lora Transceiver module and is used to send the control data to the Receiver side. You can set different modes using the AT commands which I have already explained in my previous tutorial.


About the Rylr896 / Rylr890 Lora by the Reyax Technologies:

Long Range RC Plane

These are the 15Km long-range wireless 915Mhz Radio Frequency LoRa Transceiver Modules by the Reyax Technology. The amazing thing about these modules is that we can change the frequencies of these modules using the AT commands, which I have already explained in my previous tutorial. These modules are designed for long-range communication up to 15-kilo meters. The Rylr896 LoRa transceiver modules can be used in IoT applications, Mobile Equipments, Home security systems, Industrial Monitoring and control equipment, Car Alarm system, Robotics, sensors monitoring, and so on.

This transceiver module has the processor which communicates with the Arduino through the Serial communication. So, the exchange of data between the Rylr890 or Rylr896 and a microcontroller is controlled by this processor.

Reyax Rylr890 / Rylr896 Lora Transceiver Module Specification:

VDD Power Supply:

The minimum voltage is 2.8 volts

The Typical Voltage is 3.3 volts and

The Maximum voltage is 3.6 volts

Using Arduino I can easily power up these transceiver modules using 3.3 volts.

Frequency Range:

Minimum Frequency Range is 820 MHz

Typical Frequency Range is from 868 to 915 MHz

The maximum Frequency range can be up to 1020 MHz

Communication Range:

Typical Range is 4.5KM

Maximum Range is 15KM

Transmit Current:

A typical value is 43 mA

Receive Current:

Typical value is 16.5 mA

Reyax LoRa Module Pinout:

As you can see in the picture above, this transceiver module has a total of 6 pins; which are clearly labeled as VDD, NRST “which is the reset pin active low”. RXD, TXD, pin number 5 is not used, while pin number 6 is the ground.

Finally, a potentiometer, which is used to control the speed of a Brushless DC motor. The transmitter side of the RC plane is very simple and is built around a few electronic components, now let’s have a look on the Receiver side of the RC Plane.


Long Range RC Plane Receiver Side:

Long Range RC Plane

The receiver Side, consists of the 1000KV Brushless Dc Motor, next to it is the 30A speed controller which is connected with the 11.1V 2200mAh Lipo Battery pack used to power up the Brushless DC motor.

The 5V regulated power supply based on the LM7805 Voltage regulator is used to power up the micro Servo Motor, while the other Servo motor is powered up using the Arduino.

Micro Servo Motor Specs and Wires:

Long Range RC Plane

9g 2 kg.cm Micro Servo Motor

This Micro Servo is ideal for applications where small weight and size are key factor. The servo uses standard PWM control signals and operates from 4.8V – 6V with a power consumption of <500mA.

Specifications

Weight: 9g

Size: 23 x 12.3 x 25.6 mm

Torque: 1.5 kg.cm @ 4.8V; 2.0 kg/cm @ 6V

Speed: 0.08sec/60°

Gear Type: Plastic

Motor Type: Coreless

Operating Voltage Range: 4.8V-6V

Operating Temperature Range: 0°-60°

Current: < 500mA

Wire Length: 170mm

Includes: 5 servo arms.

Micro Servo Motor Wires:

The Brown wire is the ground, the Red wire should be connected with the 5 Volts, and the Yellow wire should be connected with the PWM pin of the controller.

The Rylr896 Lora Transceiver module is used to receive the data sent by the transmitter. You can solder all the electronics on a single PCB by following my connections which I will explain in the circuit diagram.

Without any further delay, let’s get started!!!


Amazon Links:

Arduino Uno

Arduino Nano

Reyax rylr890 Lora Transceiver Module:

2-Axis Analog Joystick

Best RC planes and Accessories

Flysky FS i6 Transmitter and Receiver

1000KV Brushless Motor, 30A Speed controller, and Propellers

Top Brushless Motors

3s Lipo Batteries

4s Lipo Batteries

Micro Servo Motors

2600KV Brushless Motor

4-Hole Nylon Pin Control Horns

Steel Z Push Rods

Balsa Wood Sheets for RC Airplane

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

Long Range RC Plane Transmitter Circuit Diagram:

Long Range RC Plane

As you know Arduino is based on the 5v controller while the LoRa transceiver module by the Reyax technology can handle voltages from 2.8 to a maximum of 3.6 volts. The typical voltage is 3.3 volts as explained in my previous getting started tutorials on the Rylr896 Lora modules. From this information we know that this module cannot be directly interfaced with the Arduino for this we need some kind of converter that can convert 5 volts into 3.3 volts. But instead of using the converter, we can use a simple voltage divider circuit. As you can see 4.7k and 10k resistors are connected in series which gives me 3.4 volts which is perfect for the Reyax LoRa Transceiver module.

A wire from the middle of these resistors is connected with the RXD pin of the module, the other leg of the 10k resistor is connected with the ground, while the other leg of the 4.7k resistor is connected with the TX of the Arduino. The Rx pin of the Arduino is connected with the TXD pin of the LoRa Module. The ground of the LoRa module is connected with the ground of the Arduino.

The 2-axis Analog Joystick power supply pins are connected with the Arduino’s 5V and ground. The VRx and VRy pins of the joystick are connected with the Arduino’s analog pins A2 and A3.

A potentiometer or variable resistor is connected with analog pin A1 of the Arduino. So that’s all about the Transmitter side, now let’s have a look at the receiver side circuit diagram.



Long Range RC Plane Receiver Circuit Diagram:

Long Range RC Plane

The Rylr896 Lora module connections remain the same. This 5v regulated power supply based on the LM7805 linear voltage regulator is used to power up the Micro Servo Motor. the other Servo motor is power up using the Arduino. The signal wires of both the Servo motors are connected with the PWM pins 5 and 9 of the Arduino.

Three wires of the 1000KV Brushless Motor are connected with the 30A speed controller. The yellow wire should be connected with the middle wire of the speed controller, while the red wire and black wires are connected with the other two wires of the speed controller, if the brushless motor rotates in the wrong direction, you can simply interchange these two wires. On the other side of the speed controller we have a total of 5 wires. The Red and Black wires are the Power supply wires and these should be connected with the Lipo battery pack Red and Black wires.

The white wire should be connected with the Arduino’s PWM, in my case I am using pin 3 of the Arduino, while the black wire should be connected with the Arduino’s ground. So, that’s all about the receiver circuit diagram.

Making the 5V power supply for the Servo Motor:

Using the same connections as explained in the above circuit diagram, I completed my soldering.

Long Range RC Plane


1000KV Brushless Motor Assembling:

Next, I started assembling the Brushless Motor. There are two types of the mounting bases, the one is made up of plastic and the other one is made up of aluminum. I will go with the Plastic one, as I will be later fixing this on the RC Plane.

Long Range RC Plane

This is how it looks after assembling everything.

Long Range RC Plane

I have explained the step by step procedure in the video given at the end of this article.

PCB boards for the Rylr896 Lora Modules:

Long Range RC Plane

I designed this PCB board layout in the Cadsoft Eagle software. I have already used this PCB board in my previous tutorials based on the Rylr896 Lora modules. I am using it as the development board.

Long Range RC Plane

You can also use only this part of the PCB board, if you don’t use to use other electronic components. This way you can reduce the size and weight a little bit. A link to the Gerber files is already shared above in the project sponsor section.


Final interfacing:

Long Range RC Plane

Long Range RC Plane

Finally, I connected everything as per the circuit diagrams already explained. Now, let’s have a look at the Transmitter and receiver programming.

Long Range RC Plane Controller Transmitter and Receiver Arduino Programming:

In this project, two programs are used, one program is written for the Transmitter side and the other program is written for the receiver side. Before you start the programming first of all, make sure that you download the servo motor library used on the receiver side programming.

Long Range RC Plane Transmitter side Arduino Programming:

// Long Range RC Plane Transmitter Side Programming
// https://www.electroniclinic.com/

int vresistor = A1; // to control the speed of brushless motor
int vrdata = 0;

//Joystick
int Jstick_VRx = A2; // the Joystick VRx pin is connected with the analog pin A2
int Jstick_VRy = A3; // the Joystick VRy pin is connected with the analog pin A3
int UD = 0; // Up and Down
int LR = 0; // Left and Right

int data_length; 
String sensorsdata;

void setup() {
Serial.begin(115200); 
pinMode(vresistor,INPUT); 
pinMode(Jstick_VRx,INPUT);
pinMode(Jstick_VRy,INPUT);
}

void loop() {

VRspeed();
up_down();
left_right();
data_to_receiver();

}



void VRspeed()// to control the speed of Brushless motor
{
 vrdata = analogRead(vresistor); // Potentiometer or Variable resistor is connected with Analog pin A1
 vrdata = map(vrdata, 0, 1023,100,1023); 
 if (vrdata < 100)
 {
  vrdata = 100;
 }
  if (vrdata > 1023)
 {
  vrdata = 1023;
 }
 
delay(10);

}

void up_down()
{
 UD = analogRead(Jstick_VRx); 
 if ( UD < 100) 
 {
  UD = 100;
 }
delay(10);

}

void left_right()
{
 LR = analogRead(Jstick_VRy); 
 if ( LR < 100 )
 {
  LR = 100;
 }
delay(10);
}

void data_to_receiver()
{
 sensorsdata = sensorsdata + vrdata + "%" + UD + "%" + LR; 
 //Serial.println(vrdata);
// find the length of data
 data_length = sensorsdata.length();
 //Serial.println("data length:"); 
 //Serial.println(data_length); 
 send_data(sensorsdata , data_length); 
delay(1000); 
sensorsdata = ""; // empty the variable  
  
}

void send_data(String sensorvalue, int valuelength)
{

String mymessage; 
mymessage = mymessage + "AT+SEND=0" + "," + valuelength + "," + sensorvalue + "\r"; 
Serial.println(mymessage); 
  //Serial.println("AT+SEND=0,6,Hello!\r");
}


RC Plane Transmitter Side code explanation:

The potentiometer is connected with the Analog pin A1 of the arduion.

int vresistor = A1; // to control the speed of brushless motor

The potentiometer value is stored in the variable vrdata.

int vrdata = 0;

//Joystick

int Jstick_VRx = A2; // the Joystick VRx pin is connected with the analog pin A2

int Jstick_VRy = A3; // the Joystick VRy pin is connected with the analog pin A3

int UD = 0; // Up and Down

int LR = 0; // Left and Right

If you don’t have the Joystick, you can use two potentiometers, you will have to adjust the code accordingly.

int data_length;

String sensorsdata;

In the void setup() function, I started by defining the baudrate for the Rylr896 Lora module, this is the default baud rate of the lora module which you can change using the AT commands. But I will go with the default baud rate.

void setup() {

Serial.begin(115200);

pinMode(vresistor,INPUT);

pinMode(Jstick_VRx,INPUT);

pinMode(Jstick_VRy,INPUT);

}

To keep the code more readable and user-friendly, I created the following functions.

void loop() {

VRspeed();

up_down();

left_right();

data_to_receiver();

}

void VRspeed()// to control the speed of Brushless motor

{

 vrdata = analogRead(vresistor); // Potentiometer or Variable resistor is connected with Analog pin A1

 vrdata = map(vrdata, 0, 1023,100,1023);

I mapped the value and defined the limits 100 to 1023, I did this because I had some issues on the receiver side, each time the value dropped below the 100, the communication would stop. So I limit the value to 100 and the problem was solved. Now to further make sure, I used a condition, if the value is dropped below 100, make the vrdata = 100. I did this for all.

 if (vrdata < 100)

 {

  vrdata = 100;

 }

  if (vrdata > 1023)

 {

  vrdata = 1023;

 }

delay(10);

}

void up_down()

{

 UD = analogRead(Jstick_VRx);

 if ( UD < 100)

 {

  UD = 100;

 }

delay(10);

}

void left_right()

{

 LR = analogRead(Jstick_VRy);

 if ( LR < 100 )

 {

  LR = 100;

 }

delay(10);

}

Created a completed message consisting of the sensors values.

void data_to_receiver()

{

 sensorsdata = sensorsdata + vrdata + “%” + UD + “%” + LR;

 //Serial.println(vrdata);

// find the length of data

 data_length = sensorsdata.length();

 //Serial.println(“data length:”);

 //Serial.println(data_length);

 send_data(sensorsdata , data_length);

you can remove this delay to speed up the communication, but this will have a minor effect. You can check the datasheet for further help, because different modes has different delay factors.

delay(1000);

sensorsdata = “”; // empty the variable

}

Finally, using the following function the data is sent to the receiver side.

void send_data(String sensorvalue, int valuelength)

{

String mymessage;

mymessage = mymessage + “AT+SEND=0” + “,” + valuelength + “,” + sensorvalue + “\r”;

Serial.println(mymessage);

  //Serial.println(“AT+SEND=0,6,Hello!\r”);

}



Long Range RC Plane Receiver side Arduino Programming:

// Long Range RC Plane Receiver Side Programming
// https://www.electroniclinic.com/

#include <Servo.h>

Servo servoLeft;
Servo servoRight;

String myString; 
String garbage;
char data; 

int receive_flag = 0; 
// for brushless motor
int Bmotor = 3; // the brushless motor speed controller pwm wire is connected with D1. 
int LeftServo = 5;
int RightServo = 9;

int updownFlag = 0;

void setup() {
  // put your setup code here, to run once:
Serial.begin(115200); 
servoLeft.attach(LeftServo);
servoRight.attach(RightServo);
servoLeft.write(90);
servoRight.write(90);
delay(2000);
analogWrite(Bmotor,0);
Serial.print("AT\r\n");

delay(100); 
}

void loop() {
  // put your main code here, to run repeatedly:

if ( Serial.available() > 0 )
{

 
  garbage = Serial.readString(); // consists of the +ERR=2 ERROR. 
  
  myString = Serial.readString(); 
  //Serial.println(myString); 

  //Serial.println("Garbage:");
  //Serial.println(garbage);

//String l = getValue(myString, ',', 0); // address
//String m = getValue(myString, ',', 1); // data length
String n = getValue(myString, ',', 2); // data
//String o = getValue(myString, ',', 3); //RSSI
//String p = getValue(myString, ',', 4); //SNR

//Serial.println("Address:"); 
//Serial.println(l); 
//
//Serial.println("data length:"); 
//Serial.println(m);
//
//Serial.println("Data:"); 
//Serial.println(n);
//
//Serial.println("RSSI:"); 
//Serial.println(o);
//
//Serial.println("SNR:"); 
//Serial.println(p);

// now i am going to split the data string n which consists of the Sensors values
// in this string sensors values are separated by the % sign. 

String q = getValue(n, '%', 0); // speed
String r = getValue(n, '%', 1); // up and down
String s = getValue(n, '%', 2); // left and right

if ((q == "") || ( r == "") || (s == ""));
int Fspeed = q.toInt(); // Speed
int UpDown = r.toInt(); // Up and Down control
int LeftRight = s.toInt(); // Left and Right control


Serial.println(q); // speed
Serial.println(r); // up and down
Serial.println(s); // left and right


Fspeed = map(Fspeed, 100, 1023, 0, 255); 
if( Fspeed > 255)
{
  Fspeed = 255;
}


analogWrite(Bmotor,Fspeed); 
delay(10); 

if (( UpDown > 490) && (UpDown < 510))
{
  servoLeft.write(90);
  servoRight.write(90);
  delay(100);
}

if (UpDown > 600 )
{
  servoLeft.write(180);
  servoRight.write(10);
  delay(100);
}

if (UpDown < 300 )
{
  servoLeft.write(10);
  servoRight.write(180);
  delay(100);
}


if (LeftRight > 600 )
{
  servoRight.write(10);
  delay(500);
}

if ( LeftRight < 300 )
{
  servoLeft.write(10);
  delay(500);

}


//myString = ""; 
//Serial.print("AT\r\n");
}
}


String getValue(String data, char separator, int index)
{
    int found = 0;
    int strIndex[] = { 0, -1 };
    int maxIndex = data.length() - 1;

    for (int i = 0; i <= maxIndex && found <= index; i++) {
        if (data.charAt(i) == separator || i == maxIndex) {
            found++;
            strIndex[0] = strIndex[1] + 1;
            strIndex[1] = (i == maxIndex) ? i+1 : i;
        }
    }
    return found > index ? data.substring(strIndex[0], strIndex[1]) : "";
}

The receiver side programming is almost the same as explained in my previous tutorial, multiple sensors monitoring. I have not practically tested this on the RC Plane, there are still a few bugs which I have to fix. I have shared enough information with you guys, that now I am sure you will find a way how to fix these bugs.


Long Range RC Plane Video Tutorial:

 

Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

5 Comments

  1. Hello, didnt you have problems with reyax reyrl 896 communication speed? I am doing similar project, but the speed it takes to recieve seems to bee cca 1s, isnt it too slow for rc controll?

  2. Hello, didnt you have problems with reyax reyrl 896 communication speed? I am doing similar project, but the speed it takes to recieve seems to bee cca 1s, isnt it too slow for rc controll??

    1. ya these are slow. That’s why I switched to LoRa Ra-02. I will test it, the manufacturer claims 10km range. Today, i designed a remote controller. I will test it as soon as i receive the pcbs.

  3. Hello, have you tested the LoRa Ra-02 yet. If so, can you maybe present the results. I want to use Lora for a Rc-Plane aswell, but 1s or something like that for 1 transmission is just to slow.

    1. i designed new Arduino loRa development boards based on Ra-02, I will upload after a few days. I will also test it with different antenna’s

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button