DEV Community

Cover image for How to Interface the Reyax RYLR999 LoRa Module with Arduino
Play with Circuit
Play with Circuit

Posted on

How to Interface the Reyax RYLR999 LoRa Module with Arduino

Long-range wireless communication is an important part of modern IoT systems, particularly when connected devices need to exchange small amounts of data over large distances while operating with limited power. Technologies such as Wi-Fi and Bluetooth are convenient for short-range communication, while cellular networks provide wide coverage but generally involve higher power consumption and operating costs.

LoRa is designed to address this gap. It provides long-distance wireless communication with relatively low power requirements, making it well suited for applications such as environmental monitoring, agriculture, industrial sensing, remote control, and other IoT projects.

In this project, we explore the Reyax RYLR999 LoRa module and its interface with an Arduino UNO. The setup demonstrates a simple two-way LoRa communication link in which one Arduino acts as the initiator and another works as the responder.

Project Overview

The basic idea is to establish point-to-point communication between two RYLR999 modules connected to separate Arduino UNO boards.

The first Arduino works as the initiator. It periodically sends the message “Are you there?” through its RYLR999 module. The second Arduino acts as the responder, listening for the incoming LoRa message and returning “Yes” when the request is received.

This simple exchange provides a practical way to understand how the RYLR999 communicates with a microcontroller through UART and how AT commands can be used to control LoRa transmission and reception.

The project also demonstrates the difference between the two sides of a wireless communication link: one device generates and transmits the request, while the other receives the request and sends a response.

What Is LoRa?

LoRa stands for Long Range and is a wireless communication technology developed by Semtech. It is intended primarily for applications where devices need to transmit relatively small amounts of information over considerably longer distances than conventional short-range wireless technologies.

LoRa is particularly useful for IoT devices because many IoT nodes send only small packets of information.

Depending on environmental and radio conditions, LoRa communication can typically reach approximately 15 to 20 km in open environments.

LoRa commonly operates in license-free ISM frequency bands such as 433 MHz, 868 MHz, and 915 MHz. It can also operate in the 2.4 GHz band for applications requiring higher data rates, although communication range is generally reduced at this frequency.

An important characteristic of LoRa is the balance it provides between communication range, data rate, and power consumption. It is therefore better suited to small, infrequent data packets than to applications that continuously transfer large amounts of information.

How Does LoRa Technology Work?

LoRa operates at the physical layer of wireless communication and defines how information is converted into a radio signal for transmission.

When a microcontroller needs to send information, the digital data is passed to the LoRa transceiver. The radio then uses Chirp Spread Spectrum (CSS) modulation to encode the information into frequency-swept chirp signals.

These chirps spread the transmitted information across a wider bandwidth. This improves receiver sensitivity and helps the system operate in the presence of noise and interference.

One of the major advantages of this approach is that a LoRa receiver can detect relatively weak signals. This contributes to the technology's long communication range while allowing the radio to operate at comparatively low power.

At the receiving end, the LoRa transceiver demodulates the incoming chirp signal and converts it back into digital information. The resulting data is then made available to the connected microcontroller through the module's UART interface.

LoRa generally works with low data rates and is intended for small packets rather than continuous high-bandwidth communication. This makes it practical for battery-operated devices that can remain in a low-power state between transmissions.

It is important to distinguish LoRa from LoRaWAN. LoRa describes the radio communication technology at the physical layer, while LoRaWAN is a higher-level networking protocol designed for connecting LoRa devices to wider networks and infrastructure.

Where LoRa Is Used

LoRa is a good choice when the application needs:

  • Long-distance communication
  • Low power consumption
  • Small amounts of transmitted data
  • Battery-operated sensor nodes
  • Wireless communication in areas without conventional network infrastructure

It is not intended for applications such as video streaming, audio transmission, or transferring large files because its data rate is comparatively low.

Introduction to the RYLR999 Module

The RYLR999 Lite is a long-range wireless communication module developed by REYAX Technology. The module combines 868/915 MHz LoRa communication with 2.4 GHz Bluetooth Low Energy (BLE) capabilities in a compact transceiver.

A notable feature of the RYLR999 is that it provides separate UART interfaces for its BLE and LoRa functions. This allows the two wireless communication paths to be handled independently.

The BLE UART interface is used for exchanging information with devices such as smartphones, BLE-enabled systems, or compatible microcontrollers. The LoRa UART interface, meanwhile, handles LoRa-related data transmission and reception.

The module can be configured through AT commands. Parameters such as LoRa addresses, network IDs, operating frequency, and modulation settings can be configured according to the requirements of the application.

When a transmission command is issued, the module processes the supplied data and sends it wirelessly using LoRa's CSS-based modulation. Another compatible RYLR999 module can receive the transmitted packet and make the received information available through its UART interface.

Another useful capability of the RYLR999 is its potential to operate as a BLE-to-LoRa bridge. In this type of application, a nearby BLE device can communicate with the module, while the RYLR999 forwards the information through a long-range LoRa connection. This effectively extends the communication reach of a device that would normally be restricted to short-range BLE communication.

RYLR999 Pinout


Understanding the module's pin functions is important because the RYLR999 uses separate UART connections for its BLE and LoRa interfaces.

  • VDD (Pin 1): This is the module's power supply pin.

  • RST (Pin 2): This is the reset input.

  • TXD_BLE (Pin 3): This pin functions as the BLE UART transmit output. It is particularly relevant when the module is being used for BLE-to-LoRa bridging.

  • RXD_LoRa (Pin 4): This is the receiving input of the LoRa UART interface. AT commands and LoRa-related instructions from a microcontroller, PC terminal, or BLE subsystem are supplied through this pin.

  • TXD_LoRa (Pin 5): This is the transmit output of the LoRa UART interface. Received LoRa data and status information are provided through this pin.

  • RXD_BLE (Pin 6): This pin receives data intended for the BLE subsystem. Commands or information that need to be sent to the BLE section from a microcontroller or PC are supplied through this pin.

  • GND (Pin 7): This is the ground connection.

Interfacing RYLR999 with Arduino UNO

The RYLR999 can be connected to an Arduino UNO to create a simple point-to-point LoRa communication system. In the proposed arrangement, two Arduino UNO boards are used, with each board connected to one RYLR999 module.

The initiator Arduino is responsible for generating the communication request and sending it through its LoRa module. The responder Arduino remains ready to receive the message and sends a response when the expected request arrives.

The RYLR999 communicates with the Arduino through its LoRa UART interface. Since the RYLR999's digital I/O operates at 3.3 V logic levels, the UART connection requires appropriate voltage-level conversion when interfacing it with the Arduino UNO's 5 V logic.

Initiator Wiring Concept

On the initiator side, the Arduino UNO sends LoRa commands to the RYLR999 and can display the communication status on a 16×2 I2C LCD.

The VDD pin of the RYLR999 is connected to the 5V output of the Arduino UNO, while the GND pin is connected to the Arduino GND.

For UART communication, the TXD_LoRa pin of the RYLR999 is connected to the LV1 pin of the voltage shifter, and the corresponding HV1 output is connected to the Arduino Rx pin.

In the opposite direction, the TX pin of the Arduino is connected to the HV2 pin of the voltage shifter, while the corresponding LV2 output is connected to the RXD_LoRa pin of the RYLR999.

The voltage shifter also requires its power-side connections. The 5V pin of the Arduino is connected to the HV pin of the voltage shifter, while the 3.3V pin of the Arduino is connected to the LV pin. These connections allow the voltage-level converter to operate correctly.

The Arduino UNO and RYLR999 LoRa UART connections can therefore be summarized as:

  • Arduino UNO 5V → RYLR999 VDD
  • Arduino UNO GND → RYLR999 GND
  • Arduino UNO Rx → RYLR999 TXD_LoRa through the voltage shifter
  • Arduino UNO Tx → RYLR999 RXD_LoRa through the voltage shifter

I2C LCD Connection

The initiator setup can also use a 16×2 I2C LCD to display communication information.

The LCD VCC and GND connections are connected to the corresponding Arduino power and ground pins. The LCD's SCL and SDA lines are connected to the Arduino's I2C pins.

On the Arduino UNO, the I2C lines correspond to:

  • SCL → A5
  • SDA → A4

The LCD address configuration is also relevant. When using the address 0x27, the A0, A1, and A2 address jumpers should not be shorted. These jumpers influence the I2C address of the display, so their configuration should match the address used by the software.

Responder Wiring Concept

The responder side follows the same basic RYLR999-to-Arduino UART arrangement but does not require the LCD.

The responder Arduino continuously monitors the LoRa UART interface for incoming communication from the initiator. When the expected request is received, the Arduino processes it and sends the appropriate response through its RYLR999 module.

The main wiring between the Arduino UNO and RYLR999 therefore remains the same:

  • Arduino UNO 5V → RYLR999 VDD
  • Arduino UNO GND → RYLR999 GND
  • Arduino UNO Rx → RYLR999 TXD_LoRa through the voltage shifter
  • Arduino UNO Tx → RYLR999 RXD_LoRa through the voltage shifter

The primary difference between the two configurations is that the initiator includes the I2C LCD for displaying communication information, whereas the responder operates without the display.

Understanding the Communication Flow

The complete communication sequence can be understood as a simple request-and-response cycle.

First, the initiator Arduino sends an AT command to its RYLR999 module instructing it to transmit the required message. The module converts the data into a LoRa radio signal and broadcasts it to the receiving RYLR999.

The responder module receives the LoRa packet and forwards the resulting data to its Arduino through the LoRa UART interface.

After identifying the incoming request, the responder Arduino instructs its RYLR999 to transmit a reply. The second module then sends the response wirelessly back to the initiator.

The initiator's RYLR999 receives the response and makes the received information available to the Arduino through TXD_LoRa. This completes the two-way communication cycle.

Important Considerations

When working with the RYLR999, the power supply and logic-level requirements should be considered carefully. Although the module requires a 5 V supply within the specified range, its digital I/O uses 3.3 V logic levels. Appropriate voltage-level conversion should therefore be used for UART communication with the Arduino UNO.

The RYLR999 can operate at relatively high LoRa transmit power, with the specified maximum output reaching +30 dBm (1 Watt). The antenna and RF implementation should therefore follow the module manufacturer's recommendations.

LoRa's long range should also not be interpreted as unlimited bandwidth. The technology is optimized for small data packets and long-distance communication rather than high-speed data transfer.

Conclusion

The RYLR999 provides a practical way to add long-range wireless communication to Arduino-based projects. Its LoRa interface allows small packets of information to travel significantly farther than conventional short-range wireless technologies, while its BLE functionality adds another communication option within the same module.

By connecting two RYLR999 modules to separate Arduino UNO boards, it is possible to create a straightforward point-to-point communication system. The initiator can send a request such as “Are you there?”, while the responder can return “Yes”, demonstrating the basic principles of LoRa data transmission and reception.

The module's UART interface, AT-command configuration, long-range capability, and BLE-to-LoRa functionality make the RYLR999 useful for a variety of IoT, sensor, automation, and remote-monitoring applications where reliable long-distance communication is required without depending on conventional Wi-Fi or cellular connectivity.

For source code Visit: Play with Circuit(playwithcircuit.com)

Top comments (0)