SX1278LoRa RF Module
The term LoRa stands for Long Range. It is a wireless Radio frequency technology introduced by a company called Semtech. This LoRa technology can be used to transmit bi-directional information to long distance without consuming much power. This property can be used by remote sensors which have to transmit its data by just operating on a small battery.
Typically Lora can achieve a distance of 15-20km (will talk more on this later) and can work on battery for years. Remember that LoRa, LoRaWAN and LPWAN are three different terminologies and should not be confused with one another. We will discuss them briefly later in this article.
Understanding the LoRa technology & it’s working
The basic principle is that information is encoded using chirp (a gradual increase or decrease in the frequency of the carrier wave over time). Before sending a message, the LoRa transmitter will send out a chirp signal to check that the band is free to send the message. Once the LoRa receiver has picked up the preamble chirp from the transmitter, the end of the preamble is signalled by the reverse chirp, which tells the LoRa transmitter that is it clear to begin transmission.

The architecture shown in this figure is explained below:
- Devices:
It consists of LoRa Modulation, Transceivers & End-Nodes and Picocells & Gateways. - LoRa Modulation:LoRa Technology is the physical (PHY) silicon layer, or wireless modulation, used to create the long-range communication link.
B. Transceivers & End-Nodes:Transceivers configured with LoRa Technology are embedded into end-nodes, or sensor devices, designed for a multitude of industry applications.
C. Picocells & Gateways:Sensors capture and transmit data to gateways over distances near and far, indoor and outdoor, with minimal power requirement. - Network Server:
Gateways send information via Wi-Fi, Ethernet or Cellular to the network server, which is responsible for network management functions like over-the-air activation, data de-duplication, dynamic frame routing, adaptive rate control, traffic management, and administration. - Application Servers & Cloud IoT Services:
Applications interpret the data collected by LoRa-enabled devices, applying techniques like machine learning and artificial intelligence to solve business problems for a Smarter Planet.
Features:
- LoRaTM Modem 168dB maximum link budget
- +20dBm – 100mW constant RF output vs. V supply
- +14dBm high efficiency PA
- Programmable bit rate up to 300kbps
- High sensitivity: down to -148dBm
- Bullet-proof front end: IIP3 = -11dBm
- Excellent blocking immunity
- Low RX current of 9.9mA, 200nA register retention
- Fully integrated synthesizer with a resolution of 61Hz
- FSK, GFSK, MSK, GMSK, LoRa and OOK modulation
- Built-in bit synchronizer for clock recovery
- Preamble detection
- 127dB Dynamic Range RSSI
- Automatic RF Sense and CAD with ultra-fast AFC
- Packet engine up to 256 bytes with CRC
- Built-in temperature sensor and low battery indicator
Arduino LoRa SX1278 Transmitter:

- The LoRa SX1278 is not 5V friendly so do not supply 5V to it else the board will get damaged. Use 3.3V of Arduino to connect it to VCC pin. Connect all the GND pins to GND. Connect the RST pin to D9 and DIO0 to D2 of Arduino. Connect the SPI Pins NSS, MOSI, MISO, and SCK to Arduino D10, D11, D12, and D13 of Arduino respectively as shown in circuit diagram above.
- Use any potentiometer like 10K and connect its middle pin to A0 of Arduino and remaining two pins to GND and 5V.
Arduino LoRa SX1278 Receiver

- The LoRa SX1278 is not 5V friendly so do not supply 5V to it else the board will get damaged. Use 3.3V of Arduino to connect it to VCC pin. Connect all the GND pins to GND. Connect the RST pin to D9 and DIO0 to D2 of Arduino. Connect the SPI Pins NSS, MOSI, MISO, and SCK to Arduino D10, D11, D12, and D13 of Arduino respectively as shown in circuit diagram above.
- Use any LED and connect it to D3 of Arduino as shown in the photos above.
· Transmitter Code
#include <SPI.h> |
|
#include <LoRa.h> |
|
int pot = A0; |
|
|
|
void setup() { |
|
Serial.begin(9600); |
|
pinMode(pot,INPUT); |
|
|
|
while (!Serial); |
|
Serial.println(“LoRa Sender“); |
|
if (!LoRa.begin(433E6)) { // or 915E6, the MHz speed of yout module |
|
Serial.println(“Starting LoRa failed!“); |
|
while (1); |
|
} |
|
} |
|
|
|
void loop() { |
|
int val = map(analogRead(pot),0,1024,0,255); |
|
LoRa.beginPacket(); |
|
LoRa.print(val); |
|
LoRa.endPacket(); |
|
delay(50); |
|
|
|
} |
· Receiver Code
#include <SPI.h> |
|
#include <LoRa.h> |
|
int LED = 3; |
|
String inString = “”; // string to hold input |
|
int val = 0; |
|
|
|
void setup() { |
|
Serial.begin(9600); |
|
pinMode(LED,OUTPUT); |
|
|
|
while (!Serial); |
|
Serial.println(“LoRa Receiver“); |
|
if (!LoRa.begin(433E6)) { // or 915E6 |
|
Serial.println(“Starting LoRa failed!“); |
|
while (1); |
|
} |
|
} |
|
|
|
void loop() { |
|
|
|
// try to parse packet |
|
int packetSize = LoRa.parsePacket(); |
|
if (packetSize) { |
|
// read packet |
|
while (LoRa.available()) |
|
{ |
|
int inChar = LoRa.read(); |
|
inString += (char)inChar; |
|
val = inString.toInt(); |
|
} |
|
inString = “”; |
|
LoRa.packetRssi(); |
|
} |
|
|
|
Serial.println(val); |
|
analogWrite(LED, val); |
|
} |
Applications:
- Automated Meter Reading.
- Home and Building Automation.
- Wireless Alarm and Security Systems.
- Industrial Monitoring and Control.
- Long range Irrigation Systems.
Reference:
https://how2electronics.com/interfacing-sx1278-lora-module-with-arduino/
https://circuitdigest.com/microcontroller-projects/arduino-lora-sx1278-interfacing-tutorial
https://www.amazon.in/Ai-Thinker-Sx1278-Wireless-Transceiver-Breakout/dp/B079NMXD9P
https://www.elecrow.com/sx1278-lora-module-433m-10km.html