Experiments with LoRa Radios

Back to Index

Table of Contents


Introduction

LoRa is a radio modulation technology developed by Semtech and implemented in their SX172X series of ICs. It provides very high sensitivity and thus link budgets with low data rates; thus allowing long distance (personally tested to nearly 100km) license-free communication. I have mostly used the low-cost HopeRF RFM series of modules (RM98W for 434MHz and RFM95W for 868MHz) which have the Semtech IC and minimal support circuitry; however more advanced and more expensive modules are also available.

RFM95W module, shown mounted on a custom PCB

HAB Telemetry

After some initial testing, my first serious use of LoRa was the telemetry for the SiPM experiment flown on a high altitude balloon. This used 434MHz LoRa to relay back temperature, pressure, GPS location, and SiPM count rate data. Transmit power was just 10mW meaning an amateur radio license is not required. Communication was first received with a Yagi antenna when the balloon was at an altitude of 6km and about 99km away. Shortly afterwards (when it was about 90km away) packets were also received on an indoor dipole antenna. This suggests that line of sight rather than path loss is the limiting factor.

Throughout the flight the margin was very good, even at 99km an RSSI of -96dBm and SNR of -1dB was recorded. For comparsion, LoRa links can have, with the lowest data rate, a sensitivity of down to -148dBm and work with an SNR down to -20dB. This suggests if the line-of-sight issue was mitigated (e.g. two balloons both near maximum altitude) link distances of over 1000km could be achieved.

LoRa telemetry has also been tried on further HAB projects, again with very good peformance. SNR and RSSI mostly seemed to be related to how precisely the Yagi was aimed rather than how far away it was; unfortunately failure of the GPS meant determining the distance was not possible this time.


Image Transmission

A recent HAB project was to use 868MHz LoRa at a higher data rate to stream back low resolution JPEG images. The hardware for this consisted of a Teensy, VC0706 serial JPEG camera, RFM95W and a DIY RF power amplifier. The power amplifier used the MGA-31589 IC, allowing transmission at the 500mW maximum allowed ERP in Europe in the 869.40-869.65MHz band. The LoRa radio was configured for 250kHz bandwidth, spreading factor 7 and a coding rate of 4/8. With overheads this resulted in a useful data rate of about 600byte/s, allowing a typical 160x120 JPEG from the camera to be downloaded in about 8 seconds. A 6 second pause was also added between image transmissions to save power.

One of the receivers also used one of my distribution amp boards as the LNA on it should have a better noise figure than the one integrated in the LoRa receiver; and the SAW filter should help reject any out-of-band noise from nearby mobile phones, etc.

The setup; showing camera, Teensy, RFM95W and PA

The LoRa camera setup worked well, and image corruption due to lost/corrupted packets was minimised by running two receivers (one with a Yagi and one with a dipole antenna) and picking the best image from one or the other. Unforunately the balloon burst earlier than expected so the link was not tested over a very significant distance (estimated to be about 30-40km max). In addition the GPS connected to the telemetry board failed to obtain a fix, likely due to interference from the PA possibly combined with limited signal strength due to being very far (78°) north. Images received were put together into a slideshow and can be viewed below.

In the future I may develop a more compact board using a cheap camera module with onboard JPEG compression (e.g. the OV5640); an STM32 microcontroller; the LoRa radio and an efficient power amplifier to make a small and fairly low-power HAB payload which streams back images in real time.


PPP over LoRa

While developing the camera system described above, I realised that the data rate of the LoRa link I was using for it would be just sufficient for basic internet (text-only web/email/SSH) usage. As a result I decided to develop a very simple system to run IP over a LoRa link.

This system uses a PPP link to minimise the amount of work I had to do; all I needed to do was emulate a full duplex serial link over LoRa. As LoRa is half duplex (unless frequency division duplexing with two modules at each end is used) and packet oriented, a turn-based system was used to implement this. XON/XOFF flow control was also used to prevent the PC sending more data than the link can handle.

Each station uses a STM32 microcontroller (with the STM32duino framework) connected to the PC over USB emulating a serial port, and a RFM95W 868MHz LoRa module. The link parameters were similar to the camera, but using 4/5 coding rate to maximise data rate with a slightly increased risk of corruption (less of a problem here as resends are possible unlike the camera). The microcontroller code for either station is available on GitHub.

The turn-based system works by buffering up to 254 bytes of data in the microcontroller (the 255 byte max LoRa packet size, less one 'magic' byte to identify packets for this system and reject any other packets). If this buffer becomes full the XOFF command is sent to the PC to stop any further data being sent. Each station sends its buffer either immediately after the other station has finished transmitting and its packet has been received; or after 1500ms if no packet is received (used to start communications initially and restart it if a packet is lost). If a stations's buffer is empty, it will still send a LoRa packet containing nothing but the magic byte to immediately return control to the other station.

The PPP commands used were sudo pppd -detach xonxoff noauth lock proxyarp 192.168.1.250:192.168.1.210 /dev/ttyACM0 19200 on the 'server' and sudo pppd -detach xonxoff noauth defaultroute lock 192.168.1.210:192.168.1.250 /dev/ttyACM0 19200 on the 'client'. Reducing the MTU of the client may also improve performance.


Back to Index