LoRa
Interfacing RFM95W LoRa with ESP32
What is the RFM95W?
A long-range LoRa transceiver enabling kilometer-scale, low-power wireless links for remote sensor and IoT networks. The RFM95W is built around the same Semtech SX1276 LoRa chip used across the popular RFM9x module family, packaged with a shielded metal can and matching antenna circuitry for reliable performance — it's a common choice for LoRaWAN-based sensor nodes, The Things Network deployments, and any project needing long-range, low-bandwidth wireless data links well beyond Wi-Fi or Bluetooth range.
Specifications
| Chipset | Semtech SX1276 LoRa transceiver (also branded HopeRF RFM95W) |
| Frequency band | 868MHz (EU) or 915MHz (US) variants — check the specific part number for your region |
| Operating voltage | 1.8V–3.7V DC (3.3V typical — NOT 5V tolerant) |
| Operating current | ~10-12 mA RX, up to ~120 mA TX at maximum +20dBm output power |
| Transmit power | Up to +20 dBm (100mW), software-configurable |
| Range | Several kilometers line-of-sight, 10+ km reported in favorable rural/open conditions |
| Modulation | LoRa chirp spread spectrum with configurable spreading factor, bandwidth, and coding rate for range/data-rate tradeoffs |
| Protocol support | Compatible with LoRaWAN stacks (e.g. for The Things Network) or simple point-to-point LoRa links |
| Interface | SPI, plus DIO interrupt pins for TX-done/RX-ready signaling |
RFM95W Pinout
| Pin | Name | Description |
|---|---|---|
| 1 | 3.3V | Power, 3.3V DC only |
| 2 | GND | Ground |
| 3 | MOSI | SPI data in |
| 4 | MISO | SPI data out |
| 5 | SCK | SPI clock |
| 6 | NSS (CS) | SPI chip select, active LOW |
| 7 | RESET | Active-LOW module reset |
| 8 | DIO0-DIO5 | Configurable interrupt pins; DIO0 is most commonly wired for TX-done/RX-ready signaling in LoRa libraries |
| 9 | ANT | Antenna connection — requires a properly tuned antenna for the module's frequency band |
Confirm you're buying the correct frequency variant (868MHz vs 915MHz) for your region's ISM band regulations before wiring up a project — the two are not interchangeable. Like the RA-02, this module is 3.3V-only SPI and needs a level shifter when paired with 5V boards, and an antenna must always be connected before transmitting to avoid damaging the power amplifier.
Setting Up RFM95W with ESP32
Library
RadioHead by Mike McCauley
Arduino IDE → Tools → Manage Libraries → search "RadioHead"
Wiring
| Component pin | ESP32 pin | Note |
|---|---|---|
| 3.3V | 3.3V | 3.3V only -- this module is not 5V tolerant |
| GND | GND | — |
| MOSI | GPIO23 (VSPI MOSI) | — |
| MISO | GPIO19 (VSPI MISO) | — |
| SCK | GPIO18 (VSPI SCK) | — |
| NSS (CS) | GPIO5 | — |
| RESET | GPIO14 | — |
| DIO0 | GPIO26 | Required by RadioHead for TX/RX interrupt signaling |
| ANT | Antenna tuned to your module's band | Never power up without an antenna attached -- it can damage the PA |
Example code
Set setFrequency() to match your module's specific band (433/868/915MHz) and local radio regulations -- transmitting on the wrong band is both illegal and won't be heard by a receiver expecting a different frequency.
Related Guides & Projects

ESP32-CAM Web Server: Stream Live Video in 5 Minutes
A complete, no-guesswork walkthrough for flashing an AI-Thinker ESP32-CAM as a live MJPEG video stream -- wiring, Arduino IDE setup, the CameraWebServer sketch, and every failure mode that actually causes problems.

ESP32 MQTT Tutorial: Publish and Subscribe with Arduino IDE
A complete, broker-agnostic ESP32 MQTT tutorial -- topics, QoS, retained messages, Last Will and Testament, TLS security for production, and a working publish/subscribe example with PubSubClient.

Installing ESP8266 in Arduino IDE: NodeMCU (ESP-12E) Complete Setup Guide for Windows
From driver headaches to a blinking LED — the full Windows walkthrough for getting NodeMCU ESP8266 boards running in Arduino IDE, plus notes for Mac and the bare ESP-01 module.

ESP32 Pinout Guide: Every GPIO, ADC, PWM, and Restricted Pin Explained
Complete ESP32 pinout guide covering all GPIOs, input-only pins, strapping pins, flash-reserved pins, dual ADC channels, PWM via LEDC, I2C, SPI, UART, and deep sleep wake pins.