LoRa
Interfacing RA 02 LoRa with ESP32
What is the RA 02?
RA 02 practical reference
The RA-02 is a budget LoRa transceiver module built around Semtech's SX1278 chip, offering long-range, low-power wireless communication on the 433MHz band. LoRa's chirp spread-spectrum modulation trades data rate for range and noise immunity, letting the RA-02 reach several kilometers line-of-sight at very low transmit power — making it a favorite for remote telemetry, weather stations, and long-range sensor links where Wi-Fi and Bluetooth simply can't reach.
Key specifications
- Chipset: Semtech SX1278 LoRa transceiver
- Frequency band: 433MHz (other SX127x-based modules cover 868MHz/915MHz)
- Operating voltage: 1.8V–3.7V DC (3.3V typical — NOT 5V tolerant)
- Operating current: ~10.8 mA RX, up to ~120 mA TX at max power
- Transmit power: Up to +20 dBm (100mW), configurable in software
- Range: Several kilometers line-of-sight typical, dependent on antenna, terrain, and spreading factor settings
- Modulation: LoRa chirp spread spectrum, also supports legacy FSK/OOK modes
- Interface: SPI, plus DIO interrupt pins for packet-ready/done signaling
Pinout and connection notes
The RA-02 communicates over SPI, not UART, so it needs 4 SPI lines plus RESET and DIO0 wired to the host microcontroller (libraries like Sandeep Mistry's LoRa library or RadioHead expect this exact pin set). Like most bare radio modules, all logic is 3.3V only — use a level shifter when wiring to 5V boards like the Arduino Uno, and always attach an antenna before powering on transmit to avoid damaging the power amplifier.
- 3.3V: Power, 3.3V DC only
- GND: Ground
- MOSI: SPI data in
- MISO: SPI data out
- SCK: SPI clock
- NSS (CS): SPI chip select, active LOW
- RESET: Active-LOW module reset
- DIO0: Interrupt pin signaling packet transmit-done or receive-ready, used by most LoRa libraries
- ANT: Antenna connection — a matching 433MHz wire or spring antenna is required for usable range
Integration checklist
- Confirm the exact part number and breakout-board revision.
- Verify supply voltage, current demand, logic levels, and signal direction against the datasheet.
- Check controller pin assignments and bus address or interface mode against the example code.
- Power up with external loads disconnected, then test signals before full integration.
- If readings or communication fail, check power and ground first, then pin mapping, interface settings, and library initialization.
Troubleshooting and reproducibility
Record the board used, wiring, library/version, supply arrangement, and measured behavior. Use the selected board-specific wiring example as the source of truth. Never assume visually similar modules share identical voltage tolerance or pin order.
Setting Up RA 02 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 | 433MHz-tuned antenna (most RA-02 modules are 433MHz) | Check your specific module's silkscreen/datasheet -- RA-02 ships in multiple frequency variants |
Swipe sideways to see every column →
RA-02 is most commonly the 433MHz SX1278 variant -- confirm yours before setting the frequency, and never key the transmitter without an antenna attached.
Related Components
Related Guides & Projects
MicroPython vs Arduino on ESP32: Which Should You Learn First?
An honest comparison for beginners: where MicroPython is easier, where Arduino C++ is faster, how libraries and memory differ, and how to choose based on your project instead of hype.
MicroPython ESP32 Web Server: Control an LED or Relay from Your Browser
Create a working web server with the socket module, parse requests, serve a responsive control page for an LED or a relay, keep the displayed state truthful, choose a safe relay startup state and make the server survive bad or repeated requests.
MicroPython on ESP32 and Raspberry Pi Pico W: The Complete Guide
A structured MicroPython learning path for ESP32 and Pico W. Set up your tools, control GPIO, read sensors, connect to WiFi, build web servers, publish MQTT data and make projects reliable. Start here, then follow the links by level.
boot.py vs main.py in MicroPython: What Runs, When and Why
Understand the difference between boot.py and main.py in MicroPython, startup order, Wi-Fi setup, project structure, and recovery from boot errors.