Arduino Nano Long-Range LoRa Communication SystemUsing RFM95 SX1276 Module
Build a reliable, low-power, kilometer-range wireless system using the Arduino Nano and the RFM95 LoRa radio. Ideal for IoT networks, remote sensing, and smart agriculture.
📡Project Overview
This project uses the compact Arduino Nano and the RFM95 LoRa module (Semtech SX1276) to build a reliable long-range wireless communication link. Using Chirp Spread Spectrum (CSS) modulation, LoRa achieves kilometers of range with minimal battery drain — perfect for remote IoT, sensor networks, and field monitoring.
LoRa vs LoRaWAN: This project uses raw point-to-point LoRa. LoRaWAN adds a cloud-network layer on top for large-scale deployments via gateways like The Things Network.
🔩Components Required
Voltage Warning: The RFM95 is 3.3V only. Connecting it to 5V will permanently destroy it. Use a logic-level shifter on MOSI, SCK, CS, and RST lines.
🔗Pin Wiring
| Arduino Nano | RFM95 Pin | Function | Note |
|---|---|---|---|
D11 (MOSI) | MOSI | SPI Data Out | Level shift ↓ |
D12 (MISO) | MISO | SPI Data In | Direct (safe) |
D13 (SCK) | SCK | SPI Clock | Level shift ↓ |
D4 | NSS/CS | Chip Select | RFM95_CS |
D2 | RESET | Module Reset | RFM95_RST |
D3 | DIO0 | IRQ (TX/RX) | RFM95_INT |
3.3V | VCC | Power | Stable 3.3V only |
GND | GND | Ground | — |
🗺️Wiring Diagram
The Nano's 3.3V pin supplies only ~50 mA. If powering other sensors too, use a dedicated AMS1117-3.3 regulator from the 5V rail.
📋Step-by-Step Instructions
Install the LoRa Library
In Arduino IDE: Sketch → Include Library → Manage Libraries. Search LoRa, install by sandeep.mistry. SPI is built-in.
Wire the Hardware
Follow the pin table and diagram above. Power RFM95 from stable 3.3V. Use a logic-level shifter on MOSI, SCK, CS, and RST.
Attach the Antenna
Connect a 915 MHz (or 868 MHz for India/EU) SMA antenna before powering on. Running without one can damage the RF front end.
Select Board & Upload
Set board to Arduino Nano, processor to ATmega328P (Old Bootloader) if needed. Paste the code below and Upload.
Set Up a Second Board (Receiver)
Upload the same sketch to a second Nano + RFM95. The loop handles both TX and RX, so both boards can send and receive.
Open Serial Monitor
Set baud to 9600. You'll see "LoRa Initialization Successful!", then "Sending packet…" every 2 s. The receiver shows "Received packet: Hello, LoRa!" plus RSSI.
Test Range
Move outdoors. Expect 2–5 km in urban areas and up to 10–15 km in open rural environments with good line-of-sight.
💻Full Source Code
/* * Arduino LoRa Communication Project * Board: Arduino Nano (ATmega328P) * Module: RFM95 SX1276 LoRa * By: MakeMindz — makemindz.com * * Sends "Hello, LoRa!" every 2 s * and listens for incoming packets. */ #include <SPI.h> #include <LoRa.h> // ── Pin Definitions ────────────────── #define RFM95_CS 4 // Chip Select (NSS) #define RFM95_RST 2 // Reset #define RFM95_INT 3 // DIO0 interrupt void setup() { Serial.begin(9600); while (!Serial); Serial.println("LoRa Communication Initializing..."); // Hardware reset the RFM95 pinMode(RFM95_RST, OUTPUT); digitalWrite(RFM95_RST, HIGH); delay(100); digitalWrite(RFM95_RST, LOW); delay(10); digitalWrite(RFM95_RST, HIGH); delay(10); // Assign custom pins LoRa.setPins(RFM95_CS, RFM95_RST, RFM95_INT); // 915 MHz for US · use 868E6 for India / EU if (!LoRa.begin(915E6)) { Serial.println("Starting LoRa failed!"); while (1); } Serial.println("LoRa Initialization Successful!"); } void loop() { // ── Transmit ───────────────────────── Serial.println("Sending packet..."); LoRa.beginPacket(); LoRa.print("Hello, LoRa!"); LoRa.endPacket(); delay(2000); // ── Receive ────────────────────────── int packetSize = LoRa.parsePacket(); if (packetSize) { Serial.print("Received packet: "); while (LoRa.available()) { Serial.print((char)LoRa.read()); } Serial.print(" RSSI: "); Serial.println(LoRa.packetRssi()); } }
For India and EU regions change 915E6 to 868E6 and use an 868 MHz antenna to meet local regulations.
🎮Run the Simulation
Test this project online — no hardware needed.
🔵 Wokwi Simulator
Supports Arduino Nano and LoRa radio simulation. Import the diagram.json above and paste the sketch into the editor.
🟠 Cirkit Designer
Full SPI simulation with RFM95 breakout. Add Arduino Nano and RFM9x from the components panel and wire per the diagram.
✨Key Features
🚀Applications
⚡Possible Enhancements
Attach a DHT22 or BME280 and transmit temperature, humidity, and pressure inside the LoRa packet.
Use the AVR low-power library to sleep between transmissions and extend battery life to months.
Switch to the MCCI LMIC library and connect to The Things Network for full cloud connectivity.
Forward received packets via serial to a Pi running Node-RED or MQTT and visualise on Grafana.
Comments
Post a Comment