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 Nano — 433 MHz link with level shifting

Wire a 3.3 V SX1278 Ra-02 LoRa module to a 5 V Arduino Nano through a level shifter and regulator, then send and receive packets with RSSI.

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

Community draft — report a mistake

LoRa sends small messages over kilometres on a few milliamps — farm sensors, water-tank levels across a colony, or a gate alarm at the far end of a plot. The Ra-02 (SX1278, 433 MHz) is the common module in India.

It is a 3.3 V part with SPI pins that must not see 5 V, so on the Nano it needs a 3.3 V regulator and a 4-channel level shifter. The same sketch runs on both boards: one sends “hello n” every 5 seconds, the other prints each packet with signal strength.

Wiring

Arduino NanoOnly the pins used are shown · 5 V logicAMS1117 3.3 V module (IN from Nano 5V)SX1278 LoRa module (Ra-02, 433 MHz)LV⇄HVLV⇄HVLV⇄HVLV⇄HV3.3VGNDD13GNDD12D11D10D9D23.3VGNDNSSSCKMOSIMISORSTDIO0
Also needed: AMS1117 3.3 V regulator module, 4-channel BSS138 level shifter, 433 MHz antenna (a 17.3 cm wire works for testing), Ra-02 breakout/adapter board (the module has 2 mm pads).
Every connection
Arduino NanoSX1278 LoRa module (Ra-02, 433 MHz)WireNotes
AMS1117 3.3 V module (IN from Nano 5V) · 3.3V3.3VredAbout 120 mA peaks while sending — too much for the Nano’s 3V3 pin. Module IN → Nano 5V, GND → Nano GND.
GNDGNDblack
D10NSSpurpleVia level shifter
D13SCKyellowVia level shifter
D11MOSIgreenVia level shifter
D12MISOblue3.3 V output — the Nano reads it directly.
D9RSTorangeVia level shifter — Shifter LV = 3.3 V from the regulator, HV = Nano 5V.
D2DIO0cyanInterrupt output from the module, 3.3 V — 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 not 5 V tolerant. NSS, SCK, MOSI and RST from the Nano must go through a level shifter; outputs (MISO, DIO0) can go direct.
  • BSS138 shifters are slow, so the sketch drops SPI to 1 MHz with LoRa.setSPIFrequency(1E6). At the default 8 MHz, begin() often fails.
  • Never transmit without an antenna — it can damage the RF stage.
  • 433.05–434.79 MHz is licence-free in India for low-power devices; the sketch sets 10 dBm. Check the current WPC rules before increasing power.
  • Upload the same sketch to both Nanos, with IS_SENDER = false on the receiver. Both must use the same frequency and spreading factor.

Code

lora-nano.inoArduino C++Open in PlaygroundOpen in PlaygroundFlash
// SX1278 (Ra-02, 433 MHz) LoRa on an Arduino Nano — same sketch for sender and receiver.
// 3.3V ← 3.3 V regulator, GND → GND, NSS ← D10, SCK ← D13, MOSI ← D11, RST ← D9 (all four through
// a level shifter), MISO → D12 and DIO0 → D2 direct. Set IS_SENDER = false on the second Nano.
#include <SPI.h>
#include <LoRa.h>

const bool IS_SENDER = true;
const long FREQ = 433E6;  // 433.05-434.79 MHz is the low-power licence-free band in India

void setup() {
  Serial.begin(115200);
  LoRa.setPins(10, 9, 2);       // NSS, RST, DIO0
  LoRa.setSPIFrequency(1E6);    // BSS138 shifters are slow; 1 MHz is plenty for LoRa
  if (!LoRa.begin(FREQ)) {
    Serial.println(F("LoRa init failed - check 3.3V, shifter and NSS/RST wiring"));
    for (;;) {}
  }
  LoRa.setTxPower(10);          // 10 dBm = 10 mW
  LoRa.setSpreadingFactor(9);   // longer range than the default SF7, slower
  Serial.println(IS_SENDER ? F("LoRa sender ready") : F("LoRa receiver ready"));
}

void loop() {
  if (IS_SENDER) {
    static unsigned int n = 0;
    LoRa.beginPacket();
    LoRa.print(F("hello "));
    LoRa.print(n);
    LoRa.endPacket();
    Serial.print(F("Sent packet "));
    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 · 115200Output
LoRa receiver ready
Received 'hello 0'  RSSI -47 dBm  SNR 9.8
Received 'hello 1'  RSSI -48 dBm  SNR 10.0

Common errors

LoRa init failed

No 3.3 V, NSS/RST on the wrong pins, or SPI too fast through the shifter. Check wiring and keep setSPIFrequency(1E6).

Sender works, receiver hears nothing

Different frequency or spreading factor, DIO0 not wired, or no antenna on one side.

↑↓ to move · Enter to open