Hardware components: | ||||||
|
× | 1 | ||||
|
× | 1 |
STORY
What is LoRa?
Semtech developed LoRa, a radio technology with long-range capabilities. Below is an explanation provided in Semtech’s LoRa FAQ section:
“LoRa, short for Long Range, is a modulation method that offers a much greater range compared to other technologies.” The modulation uses spread-spectrum methods and a version of CSS with built-in FEC. LoRa greatly enhances the receiver’s ability to detect signals and, like other spread-spectrum modulation methods, utilizes the full channel width for transmission, ensuring resilience to channel interference and indifference to frequency deviations resulting from using inexpensive crystals. LoRa can demodulate signals that are 19.5dB lower than the noise floor, whereas most FSK systems require a signal power 8-10dB higher than the noise floor for proper demodulation. The physical layer (PHY) for the LoRa modulation can be used with various protocols and network architectures such as Mesh, Star, point-to-point, and more.
What are the main parameters of LoRa radios?
The speed and distance are determined by 3 key LoRa factors: Bandwidth, Coding Rate, and Spreading Factor. BW stands for the actual bandwidth used for RF modulation, such as 125kHz. Having a wider signal bandwidth means an increased data rate, which leads to faster transmission but sacrifices sensitivity. CR is the rate used for coding to detect and correct errors in forward communication. Coding involves extra data being transmitted, with a higher coding rate resulting in a higher ratio of overhead. For example, a coding_rate of 4/(4+CR) will result in an overhead ratio of 1.25 when CR=1, the lowest possible value. Lastly, SF, also known as the spreading factor, has the option to be adjusted between 6 and 12. The data rate transmission increases as SF decreases, but so does susceptibility to interference, and the range decreases.
What is the typical range of LoRa radio technology?
The majority of tests conducted by Semtech and other firms demonstrate a radio range of approximately 15-20 kilometers under line-of-sight conditions with a bandwidth of 125kHz and a spreading factor of 12. The antennas being set up higher can greatly increase the range. A few high-altitude ballooning adventures have recorded distances of up to a few hundred kilometers. In situations where a direct line of sight is obstructed, like in crowded city environments or indoors, the maximum distance is approximately 2 km.
What is the usual LoRa topology?
The typical LoRa setup consists of a star topology with extended coverage, where IoT devices transmit data to a gateway that is expected to have an Internet connection for forwarding data to Internet servers. Multiple gateways can be utilized to expand coverage area, and a single message from an end device can be received by multiple gateways. Filtering for duplicate messages can be implemented at the Internet server level or, more broadly, at a level above the gateway.ds
Schematics of Lora:
What is LoRa/GPS HAT?
The Dragino Lora/GPS HAT is an add-on component designed for utilizing LoRaWAN and GPS on the Raspberry Pi. This product is designed for individuals who are interested in creating LoRaWAN solutions.
The Lora/GPS HAT utilizes the SX1276/SX1278 transceiver for communication. The L80 GPS add-on (based on MTK MT3339) is intended for Raspberry Pi applications that rely on GPS connected through serial ports, like timing or other applications needing GPS data.
The Lora/GPS HAT transceivers include the LoRa™ long-range modem which offers extended-range spread spectrum communication and strong resistance to interference, all while reducing power usage. The Lora/GPD HAT can reach a sensitivity greater than -148dBm by utilizing an affordable crystal and bill of materials. The exceptional sensitivity, along with the built-in +20 dBm power amplifier, results in a superior link budget, making it perfect for any situation needing extended range or durability. LoRa™ offers substantial benefits in blocking and selectivity compared to traditional modulation methods, addressing the typical trade-off among range, immunity to interference, and energy usage.
This board can automatically compute and forecast orbits by utilizing the ephemeris information (up to 3 days) saved in internal flash memory. Therefore, the HAT can rapidly determine position even in environments with weak indoor signal levels while consuming little power. Using AlwaysLocate™ technology, the Lora/GPS HAT can dynamically change the on/off time to find a balance between positioning precision and energy usage based on environmental and movement factors. The automatic antenna switching function is also supported by the GPS. Switching between the internal patch antenna and the external active antenna can be accomplished by it. Furthermore, it maintains its position while switching.
What is the purpose of this project?
In this project, we will understand how sensors in various places send data to the server/gateway using LoRa technology. In this case, sensor data is stored using a node (Sensor data collector) and a server/gateway. The Node transmits temperature data to the server/gateway. We have worked with both the Raspberry Pi’s Node and Server sides.
Configuration
- Connect the Lora/GPS HAT to Raspberry Pi according to the table 2;
- Use
raspi-config
to ensure that SPI can be used on RPi;
- Use
sudo apt-get install wiringpi
to install the GPIO access library written in C for the BCM2835 used in the Raspberry Pi;
- This example tested with Raspberry Pi 1 B, B+, 2 and 3.
- Used operating system : Raspbian Jessie.
Note: This setting is same for the server/gateway and node.
The tutorial consisted of two parts :
1. Preparation Node
2. Preparation Server or Gateway
Part 1: Preparation Node
1-Wire Digital Temperature Sensor
The DS18B20 was utilized to take the temperature reading. 1-Wire sensors are ideal for microcontrollers like the Raspberry Pi because they transmit all data through a single wire, reducing the need for multiple GPIO pins for sensing. Moreover, the majority of 1-Wire sensors will be equipped with an individual serial code (further details on this will be provided later), enabling the connection of multiple units to a single microcontroller without causing any conflicts. The DS18B20+ shares a design resembling transistors known as the TO-92 package, featuring three pins: GND, Data (DQ), and 3.3V power line (VDD). Some jumper wires, a breadboard, and either a 4.7kΩ or 10kΩ resistor will be required.
Read More: Getting Started with LoRa