LoRa® is a radio technology that allows two nodes to send small volumes of data over long distances. An often quoted typical distance between two nodes with clear line of sight is 3-5km. This post started with some intellectual curiosity, what is the actual distance at which two LoRa nodes can communicate in an urban setting.
The ultimate goal is to have two battery powered handheld devices that use an Arduino Uno, a SEEED Touchscreen LCD and a LoRa module.
The initial goal is to have a base station node that receives LoRa messages and echoes them back, then a handheld node is configured to send a message every few seconds and if a matching response is received from the base station, an LED is lit. The handheld can be programmed to cycle through a few different messages.
To get there, the first step is to get two minimal LoRa nodes to communicate to each other.
Researching what LoRa modules were available on Amazon, the REYAX RYLR998 appeared as a viable candidate as it has 0.1 spacing pin headers, all it needs is power, ground, a serial port for communication and is very affordable at around $12.
Going out to the Internet for examples of how to use this device, variations on the following circuit started to appear. The diagrams used one Arduino Nano and one Reyax RYLR998 to send a signal when a button was pushed and another Arduino connected to another 998 to receive the signal and illuminate an external LED. Since we are trying to establish basic communication between two nodes and the Arduino has a built-in LED connected to pin 13, the transmit and receive node circuits were merged and simplified into the circuit below.
This circuit powers the Reyax 998 from the 3.3V pin on the Arduino Nano. Since the 998 is a 3.3V part, the circuit uses a 4.7K / 10K voltage divider to bring the 5V output of the Arduino TX pin down to a 3.3V signal that can be connected to the RX pin on the 998. The TX output of the 998 is 3.3V and can be connected and read correctly by the Arduino Nano. At the moment, the Nano is powered by the USB connector.
When the circuit above is wired and we try to program the Nano, the Arduino IDE cannot communicate with the Nano, the TX and RX pins of the Nano are connected to its own USB driver and to the 998 and they are clashing, resulting on the Arduino IDE being unable to communicate with the Arduino UNO,
A attempt was made to only move the 998 TX signal from the Arduino RX pin to Arduino pin 8, the logic here was the Arduino TX pin is an output and it can communicate with the RX pin on the USB driver chip as well as the RX pin on the 998, but the Arduino RX pin has two TX devices talking to it, the USB driver chip and the 998. This ended up allowing the Arduino to be programmed, the 998 received commands from the Arduino, but using the SoftwareSerial library to read pin 8 resulted in endless streams of +ERR=4 coming from the 998, indicating an Unknown Command error. It seems the 998 was not happy sharing the TX pin with the USB driver. Circuits that are shown sharing the TX and RX pins on the Nano are probably programmed with the 998 disconnected and then the computer is disconnected and the 998 connected.
Since the goal of this project is to make an Arduino Uno Shield, in the end, both the TX and RX pins of the 998 had to be moved to dedicated pins on the Arduino Nano and either the SoftwareSerial or AltSoftSerial libraries used to create a serial port in software. Both libraries work best when the Arduino pin 8 is RX and the Arduino pin 9 is TX. Pin 8 was directly connected to the TX pin on the 998. Pin 9 was connected to the 4.7k/10k voltage divider and its output connected to the RX pin on the 998. This circuit can be programmed reliably and communication between the Nano and the 998 is reliable.
The 998 factory defaults to 115200 baud and this is around the maximum the software serial port libraries can handle. The Arduino sketch in its initialization routine first opens the software serial port at 115200 baud, sends the AT+IPR=9600 to the Reyax998 then immediately closes the software serial port and reopens it at 9600. When this routine is executed on a factory default 998, it changes it default speed to 9600, if the speed is already 9600 baud, the AT+IPR=9600 command is disregarded as it is being sent at 115200 and the 998 is receiving at 9600. In practice, this mechanism works very reliably to change the default speed on a new device and is disregarded by an already configured module.
The reason the circuit below is labeled "DO NOT USE" is that when powered from the Arduino Nano 3.3V and the 998 is transmitting at factory default power levels, it can cause the Nano to brown out. The factory datasheet says the 998 may consume 140mA when transmitting. Sources say the Nano 3.3 pin can only provide 50mA and some of that is needed for the USB driver chip. A separate 3.3V power regulator is needed and has been ordered. While this arrives, the AT+CRFOP=4 is used to bring the transmission power down. With the transmit power dialed down, the circuit below sends and receives data reliably to another node that is in close proximity.

All of the 998 configuration parameters are saved on an internal EEPROM. It seems one use case the manufacturer envisions is to connect the Reyax 998 to a computer using a USB dongle and send all the configuration commands using a terminal program, then move it to a host circuit that uses just to send and receive data. We are using the Arduino Nano to issue the configuration commands, getting input from the user for parameters such as Node ID, Network ID and Encryption Password.
The breadboard below shows two independent LoRa nodes using the circuit above. The jumpers are ELEGOO 20cm Multicolored Dupont Wire, at $7.00 for 120 (40 F-F 40 M-F 40 M-M), a bit long, but fit snuggly on the breadboard.
The resistors used for the voltage divider are 1/8W and the legs are quite thin, a trick to make them fit more snuggly into the breadboard is to bend the tips back, flatten that with pliers and insert the doubled up pin into the breadboard.
The two nodes above are only connected to each other thru power and ground so when one Arduino is connected to the USB, the other one is powered up. Next, we will try separating them by removing the jumpers on the middle of the picture that bridge the two power and ground rails together but the brown out issues we were experiencing are not going to go away until a separate 3.3V regulator is provided. Now that things are working, maybe moving one node to its own breadboard so they can be separated further apart.