Sensor Monitoring using Lora by Reyax rylr890/rylr896 and Arduino

(Last Updated On: October 19, 2019)

Sensor Monitoring using Lora

Description:

Sensor Monitoring using Lora by Reyax- This is my second tutorial on the Reyax rylr890/rylr896 15km 915Mhz Transceiver module. In this tutorial, you will learn how to make a remote sensor monitoring system using the Reyax rylr890 based Lora module and Arduino Uno. With the help of this project, you can monitor any sensor within a 15km range. For the best understanding, I will be using a Variable resistor as the Sensor, which of course you can replace with any other Sensor you want.

The basic circuit diagram, interfacing, and AT commands are already explained in my previous tutorial. If you are using the rylr890 based Lora module for the first time then I highly recommend first watch that tutorial which covers the extreme basics and then you can resume from here.

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


The components and tools used in this project can be purchased from Amazon, the components Purchase links are given below:

Reyax rylr890 Lora Transceiver Module: https://amzn.to/2LnXFh7
4.7k resistors: https://amzn.to/2N8hyuW
10k resistors: https://amzn.to/2A2brzN
Arduino Uno: https://amzn.to/2tVz1vu
Mega 2560: https://amzn.to/2ze1kdu
LM7805 Voltage Regulator: https://amzn.to/2IZEl5x
Potentiometer: https://amzn.to/2JSLbfg
330 ohm resistors pack: https://amzn.to/2NtlAeh
5v 2A adaptor: https://amzn.to/2GsNfcw
2n2222 npn transistors: https://amzn.to/2EmXsIb
10k Resistor: https://amzn.to/2KTd6OW
lm7805 Voltage Regulator: https://amzn.to/2IZEl5x
330-ohm resistors pack: https://amzn.to/2NtlAeh
LDR pack: https://amzn.to/2m2khGR
female DC power jack socket: https://amzn.to/2KEo1gt
470 uf capacitors: https://amzn.to/2xDCOzf
5×7 cm vero board: https://amzn.to/2OHGbvn
female headers: https://amzn.to/2zqmtiJ
connection wires: https://amzn.to/2DpBuW7
Super Starter kit for Beginners: https://amzn.to/2KJvmKG
Jumper Wires: https://amzn.to/2KMoVXs
Bread Board: https://amzn.to/2MS4q8X
12v Adaptor: https://amzn.to/2Ntr6h1
PCB plate: https://amzn.to/2IUwpCt
Variable Supply: https://amzn.to/2MT4Qfj
Digital Multimeter: https://amzn.to/2Nvft9i
Vero Board / strip board: https://amzn.to/2MTf9jD
Soldering iron kit: “best” You guys should definitely purchase this: https://amzn.to/2zfoNuJ
Solder wire: https://amzn.to/2ufUMWf
Wire Stripper: https://amzn.to/2KOqxfU
wire cutter: https://amzn.to/2ucIq14
PCB small portable drill machine: https://amzn.to/2Nu62XF

DISCLAIMER:

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!



About the Reyax rylr890/rylr896 Lora Transceiver Module:

Sensor Monitoring using Lora

These are the 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 kilometers. Lora transceiver modules can be used in IoT applications, Mobile Equipments, Home security systems, Industrial Monitoring, and control equipment, Car Alarm systems, 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 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

Maximum Frequency range can be up to 1020 MHz

Communication Range:

Typical Range is 4.5KM

Maximum Range is 15KM

Transmit Current:

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.

Reyax LoRa Connection with Arduino:

Sensor Monitoring using Lora

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 earlier. 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 middle leg of the variable resistor or potentiometer is connected with the analog pin A1 of the Arduino; while the other two legs of the variable resistor are connected with the 5 volts and Ground.


PCB layout of the Lora breakout board:

Sensor Monitoring using Lora

 

Download the PCB: breakout board for lora

This is the PCB board designed for the Reyax rylr890 Lora Module. I added some extra female headers for connecting sensors, voltage regulators, etc. At the bottom side, I added two female headers for the 5 volts and ground. After I was satisfied with the PCB layout, then I generated the Gerber files and placed an online order on the PCBway website. I have a separate video on this, in which I have explained how to design a PCB and how to place an online order. The video is given below.

Sensor Monitoring using Lora

These are the PCB boards which I received from the PCBway Company. As you can see the quality is really great and everything is as per the order. The silkscreen is quite clear, the Blue Soldermask looks amazing. I am 100% satisfied with their work. The Gerber files of this PCB can be downloaded from the PCBway website.

Download Gerber files



Soldering:

For the soldering watch video tutorial given at the end of this article.

Sensor Monitoring using Lora

This is how it looks after the soldering. All the connections are done as per the circuit diagram.

Sensor Monitoring using Lora Arduino Programming:

In this project two programs are used, one program is written for the transmitter side Arduino and another program is written for the Receiver side Arduino. Let’s first start with the transmitter programming.

Sensor Monitoring using Lora Transmitter Side Programming:


Lora Transmitter side Program Explanation:

This is a very simple program, as you can see no libraries are used. The variable resistor is connected with the Analog pin A1 of the Arduino. Then I defined a variable vrdata of the type integer, this variable will be used to store the value of the variable resistor. data length is a variable of the type integer which will be used to store the total number of digits and finally defined another variable of the type String. This variable will be used to store the complete string message.

In the void setup function, I activated the serial communication, while 115200 is the baud rate. This is the default baud rate of the Reyax Lora. You can easily change this baud rate using the AT commands which I have already explained in my previous tutorial.

The variable resistor is set as the input devices.

Then starts the void loop function; the void loop function consists of only two functions. These are user-defined functions that I created in order to make the program more user-friendly.

Readresistor is a user-defined function, it has no return type and does not take any arguments as the input. The main purpose of this function is to read the variable resistor and store the value in variable vrdata and convert this value into a string value. Using the length function we find the length of the string and store the number in the data_length variable.

Send_data is a user-defined function, it has no return type and takes two arguments as the input, the sensorvalue, and the length.

I defined a variable mymessage which is of the type string.

The AT+SEND commands has three parameters; the address, payload length and the data.

I created a complete message consisting of the AT+SEND command, 0 is the address, and added the payload length and the data which is to be sent. And finally using the serial.println function the complete string message can be sent to the Lora module.

So, that’s all about the Transmitter programming, and now let’s discuss the Receiver programming.


Sensor Monitoring using Lora Receiver Side Programming:



Lora Receiver Side Program Explanation:

I started off by defining the variables of the type string and char.

In the void setup function, I activated the serial communication and select the baud rate.

If the Arduino has received data from the Lora module then simply read the String and print the message on the serial monitor. so, that’s all about the programming. For the practical demonstration and step by step explanation watch video tutorial given below.


Watch Video Tutorial:

 

Recommended For You

About the Author: 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...

Leave a Reply

Close