Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.

SX1278 LoRa (Ra-02) with Arduino Uno — 3.3 V supply and level shifting

Wire a 3.3 V SX1278 Ra-02 LoRa module to a 5 V Arduino Uno R3 with its own 3.3 V regulator and a level shifter, then send and receive packets.

Arduino C++Verified — core avr 1.8.8, LoRa 0.8.0, 3 Nov 2026Compile-only

Community draft — report a mistake

LoRa sends small packets over kilometres on very little power, which makes it the radio for farm sensors, water-tank level reports from a rooftop, or a gate alert far from the house. The Ra-02 module with the Semtech SX1278 chip is the common 433 MHz version in India.

It is more work on a 5 V Uno than on an ESP32, for two reasons. The chip is 3.3 V-only and not 5 V tolerant, so the four lines the Uno drives (NSS, SCK, MOSI, RST) go through a level shifter, while MISO and DIO0 come back directly. And it draws over 100 mA while transmitting, more than the Uno’s 3.3V pin should supply, so it gets its own small AMS1117 3.3 V regulator fed from the Uno’s 5V.

The sketch is one file for both ends. The sender transmits a numbered “Hello” every 5 seconds; the receiver prints each packet with its signal strength (RSSI) and SNR.

Wiring

Arduino Uno R3Only the pins used are shown · 5 V logicAMS1117 3.3 V module (input from the Uno 5V)SX1278 LoRa module (Ra-02, 433 MHz)LV⇄HVLV⇄HVLV⇄HVLV⇄HV3V3GNDGNDD2D9D10D11D12D133.3VGNDNSSSCKMOSIMISORSTDIO0
Also needed: AMS1117 3.3 V regulator module, 4-channel BSS138 level shifter, 433 MHz antenna (spring or SMA) — fitted before power-up.
Every connection
Arduino Uno R3SX1278 LoRa module (Ra-02, 433 MHz)WireNotes
AMS1117 3.3 V module (input from the Uno 5V) · 3V33.3VredUp to about 120 mA while transmitting — more than the Uno’s 3.3V pin should give. Feed the AMS1117 from the Uno’s 5V and GND.
AMS1117 3.3 V module (input from the Uno 5V) · GNDGNDblack
GNDGNDblackCommon ground with the Uno.
D10NSSyellowVia level shifter — Shifter LV = 3.3 V (from the AMS1117), HV = 5V, GND shared.
D13SCKblueVia level shifter
D11MOSIgreenVia level shifter
D12MISOpurple3.3 V output into the Uno — reads as HIGH, no shifter needed.
D9RSTorangeVia level shifter
D2DIO0cyanPacket-done interrupt; D2 is INT0. 3.3 V output, direct.

3.3 V only (1.8–3.7 V) part, 5 V board. The SX1278 is a 3.3 V part and its pins are not 5 V tolerant. ESP32 and Pico connect directly. With an Uno or Nano, level-shift NSS, SCK, MOSI and RST, and power the module from a 3.3 V regulator that can supply about 120 mA while transmitting.

Board quirks

  • The SX1278 is 3.3 V-only and not 5 V tolerant. Unlike the nRF24L01, its inputs can be damaged by the Uno’s 5 V SPI signals, so NSS, SCK, MOSI and RST go through the level shifter.
  • Never transmit without an antenna: the reflected power can destroy the RF stage. Solder or screw the antenna on first.
  • Ra-02 modules have 1.27 mm pads, not breadboard pins. Use an adapter board or solder short wires.
  • Ra-02 is a 433 MHz module. India’s LoRaWAN band is 865–867 MHz (SX1276/RFM95 modules). For point-to-point hobby links on 433 MHz, keep the power low and check the current WPC rules for low-power devices.
  • The library and SPI fit easily on the Uno (this sketch uses about 4 KB of the 32 KB flash), so there’s room for a sensor on the sender.

Code

sx1278-uno.inoArduino C++Open in PlaygroundOpen in PlaygroundFlash
// SX1278 (Ra-02, 433 MHz) LoRa module on an Arduino Uno R3, Sandeep Mistry's LoRa library.
// The SX1278 is 3.3 V-only. 3.3V from an AMS1117 3.3 V regulator (fed from 5V), GND → GND.
// Through a level shifter: NSS → D10, SCK → D13, MOSI → D11, RST → D9.
// Direct (3.3 V outputs into the Uno): MISO → D12, DIO0 → D2.
// Upload with SENDER = true on one Uno and false on the other. Never power it without an antenna.
#include <SPI.h>
#include <LoRa.h>

const bool SENDER = true;
const long FREQ = 433E6;

void setup() {
  Serial.begin(9600);
  LoRa.setPins(10, 9, 2);  // NSS, RST, DIO0
  if (!LoRa.begin(FREQ)) {
    Serial.println(F("LoRa init failed - check 3.3V, the level shifter and SPI wiring"));
    for (;;) {}
  }
  LoRa.setTxPower(14);           // dBm; keep within your local limits
  LoRa.setSpreadingFactor(9);    // higher = longer range, slower
  LoRa.enableCrc();
  Serial.println(SENDER ? F("LoRa sender ready") : F("LoRa receiver ready"));
}

void loop() {
  if (SENDER) {
    static unsigned int n = 0;
    LoRa.beginPacket();
    LoRa.print(F("Hello #"));
    LoRa.print(n);
    LoRa.endPacket();  // waits until sent (about 0.2 s at SF9)
    Serial.print(F("Sent #"));
    Serial.println(n++);
    delay(5000);
  } else {
    int size = LoRa.parsePacket();
    if (size) {
      Serial.print(F("Received '"));
      while (LoRa.available()) Serial.print((char)LoRa.read());
      Serial.print(F("'  RSSI "));
      Serial.print(LoRa.packetRssi());
      Serial.print(F(" dBm  SNR "));
      Serial.println(LoRa.packetSnr(), 1);
    }
  }
}

Library: LoRa (Sandeep Mistry) — compiled with LoRa 0.8.0.

Expected serial output

Serial Monitor · 9600Output
LoRa receiver ready
Received 'Hello #0'  RSSI -47 dBm  SNR 9.8
Received 'Hello #1'  RSSI -48 dBm  SNR 9.5

Common errors

“LoRa init failed”

The library reads a version register over SPI and got nothing. Check the shifter has LV and HV supplied, NSS is on D10, and the module has 3.3 V.

Sender works, receiver prints nothing

Frequency, spreading factor or CRC setting differ between the two sketches. Upload the same sketch to both, changing only SENDER.

Short range (a few metres)

No antenna or the wrong one (868 MHz antenna on a 433 MHz module), or a weak 3.3 V supply sagging during transmit.

↑↓ to move · Enter to open