>> Back to LoRa Main topics

lamaPLC: AI-Thinker LoRA products

AI-Thinker Ra-02 Ai-Thinker's LoRa product line is divided into the Ra Series (SPI-based), which provides raw access to the radio chip for custom protocols, and the LoRaWAN Series (SoC-based), which includes an integrated MCU and pre-installed AT firmware for standard network connections.

The Ai-Thinker Ra-01 and Ra-02 series consists of compact, low-power LoRa transceiver modules designed for long-range wireless data communication in the Internet of Things (IoT). Both modules are built around the Semtech SX1278 chip and operate primarily in the 410 MHz to 525 MHz frequency range, making them a standard choice for DIY and industrial projects requiring high interference resistance and low power consumption.

Product SeriesModelFrequencyCore ChipInterfacePrimary Use Case
Ra Series (SPI)Ra-01410–525 MHzSX1278SPILow-cost DIY, spring antenna included
Ra-02410–525 MHzSX1278SPIPoint-to-point, external IPEX antenna
Ra-01H803–930 MHzSX1276SPIHigh-frequency (EU868/US915) DIY projects
Ra-01S/SC410–525 MHzSX1268/LLCC68SPIModern replacement for Ra-01/02 with better efficiency
LoRaWAN (SoC)Ra-07/07H410–960 MHzASR6501UART (AT)Integrated Cortex-M0+; standard LoRaWAN nodes
Ra-08/08H410–930 MHzASR6601UART (AT)Integrated Cortex-M4; supports LoRaWAN/LinkWAN
Ra-09410–525 MHzSTM32WLE5UART/SPIHigh-performance industrial IoT; multi-modulation support

Key Product Highlights

  • Antenna Variations: Ra-01 models typically feature a solderable spring antenna, while Ra-02 and the LoRaWAN series utilize IPEX connectors for high-gain external antennas.
  • Power and Sensitivity: Newer modules like the Ra-01SCH-P include Power Amplifiers (PA) reaching up to +29dBm for extreme range, compared to the standard +18 to +20dBm of older models.
  • Integration Level: The Ra-08-Kit is a popular development board that allows users to test LoRaWAN connectivity directly via a Micro-USB connection using standard AT commands.

Key Differences: Ra-01 vs. Ra-02

The main difference between the two modules is the method of antenna connection, which greatly affects their deployment flexibility and range.

  • Ai-Thinker Ra-01: Has a fixed coil (spring) antenna that is usually soldered directly onto the module. It is more compact and ideal for short- to medium-range projects where an external antenna isn't needed.
  • Ai-Thinker Ra-02: Uses an IPEX (U.FL) connector instead of a spring antenna. This permits users to connect high-gain external antennas, expanding the possible communication distance up to 10,000 meters under ideal conditions.

RA-01 / RA-02 Supported Network Topologies

  • Point-to-Point (P2P): The simplest setup where one module (e.g., Ra-01) acts as a transmitter, and the other (e.g., Ra-02) acts as a receiver.
  • Star Network (Master-Slave): One “Master” node (typically a Ra-02 due to its better antenna range) communicates with multiple “Slave” nodes (either Ra-01 or Ra-02).
  • Mesh Network: While more complex, these modules can participate in mesh networks when managed by a compatible software library (such as RadioHead or LoRaMesh), in which each node can relay data for others.
  • LoRa Gateway: A Ra-02 connected to an internet-enabled board (like ESP32) can serve as a local gateway, collecting data from multiple Ra-01 nodes and uploading it to a server or The Things Network (TTN).

Network Configuration Requirements

To ensure these modules communicate in the same network, they must share identical software settings:

  • Frequency: Must be the same (e.g., 433.0 MHz).
  • Spreading Factor (SF): Must match (ranges from SF7 to SF12).
  • Bandwidth (BW): The standard is often 125 kHz.
  • Coding Rate (CR): Standard is 4/5.
  • Sync Word: A shared “password” byte (default is usually 0x12 for private networks) that prevents interference from other LoRa networks.

Range and Performance in a Network

  • Mixed Nodes: In a network with both, the Ra-02 nodes will generally have superior range (up to 4km–10km) due to external antenna support, while Ra-01 nodes are best suited for shorter-range tasks (approx. 2.8km) within the same network area.
  • Library Support: Use the Sandeep Mistry LoRa library for simple P2P/Star setups, as it provides consistent performance across both module types.

RA-01 / RA-02 Pinout

RA-01 / RA-02 Pinout

PinLabelTypeDescription
1ANT / GNDAntennaRa-01: Antenna solder point. Ra-02: Usually Ground (uses IPEX connector instead)
2GNDPowerGround
33.3VPowerSupply Voltage (2.5V - 3.7V). Do not use 5V
4RESETInputReset pin (active low)
5DIO0I/ODigital I/O 0 (standard interrupt for RX/TX done)
6DIO1I/ODigital I/O 1 (timeout/other interrupts)
7DIO2I/ODigital I/O 2 (FHSS/other interrupts)
8DIO3I/ODigital I/O 3 CAD/Header (Channel Activity Detection)
9DIO4I/ODigital I/O 4 Preamble/Ready
10DIO5I/ODigital I/O 5 System Ready / ModeReady signaling
11SCKSPISPI Serial Clock
12MISOSPISPI Master In Slave Out
13MOSISPISPI Master Out Slave In
14NSSSPISPI Chip Select (Slave Select)
15GNDPowerGround
16GNDPowerGround

DIO Functionality in LoRa Mode

PinDefault/Common FunctionDetailed Events
DIO0RX/TX DoneSignals RxDone (packet received) or TxDone (packet sent).
DIO1TimeoutSignals RxTimeout, FhssChangeChannel, or CadDetected.
DIO2FHSS/PayloadSignals FhssChangeChannel or FhssValidHeader (frequency hopping).
DIO3CAD/HeaderSignals CadDone, ValidHeader, or PayloadCrcError.
DIO4Preamble/ReadySignals PreambleDetect, ModeReady, or PllLock.
DIO5System ReadySignals ModeReady, ClkOut, or PllLock.

Important Wiring Notes

  • Voltage Warning: Both modules require 3.3V power. Connecting them to the 5V pin of an Arduino Uno can destroy the chip. If using a 5V microcontroller, you must use a Logic Level Converter on the SPI data lines. Ai-Thinker Ra-01 and Ra-02 are not 5V-tolerant and cannot be used directly with 5V SPI signals from an Arduino Uno, Nano, or Mega.
  • Antenna Requirement: Never power on or transmit without an antenna attached. Operating the module without a load can permanently damage the power amplifier.
  • Interrupts: Most LoRa libraries (such as LoRa.h) require connecting the DIO0 pin to a hardware interrupt pin on your microcontroller to detect when a packet has been received.

Compatibility between RA-01 and RA-02

The Ai-Thinker Ra-01 and Ra-02 are fully compatible and can communicate with each other because they are functionally identical and share the same internal hardware.

  • Communication Protocol: Both use an SPI interface to communicate with microcontrollers such as Arduino or ESP32.
  • Driver Code: They can use the same software libraries (such as the standard LoRa.h or RadioHead) and driver configurations.
  • Electrical Specs: Both operate at 3.3V logic levels and require level shifters if used with 5V boards like the Arduino Uno

Arduino example code

To use the Ai-Thinker Ra-01 with an Arduino, the most popular and reliable choice is the Sandeep Mistry LoRa library. This library allows for simple point-to-point communication using the SX1278 chip found in the Ra-01.

Wiring

Because the Arduino Uno/Nano uses 5V logic and the Ra-01 uses 3.3V, you must use a TXS0108E (HW-0108) Logic Level Converter or voltage dividers on the data lines to avoid damaging the module.

Ra-01 PinLogic level converterArduino Pin (Uno/Nano)Wire ColorNotes
VCCVa - Vb5V redPower
GNDGNDGND blackCommon ground
SCKA4 - B4D13 greenSPI Clock
MISOA3 - B3D12 darkblueSPI Master In Slave Out
MOSIA2 - B2D11 yellowSPI Master Out Slave In
NSSA1 - B1D10 (or D7) lightblueChip Select (CS)
RESETA8 - B8D9 (or D6) purpleReset Pin
DIO0A7 - B7D2 orangeInterrupt Pin (Required for RX)

Arduino TXS0108E Ra-01

Basic Transmitter Example

This sketch sends a “hello” message every 5 seconds. You can install the required library by searching for “LoRa” by Sandeep Mistry in the Arduino Library Manager.

#include <SPI.h>
#include <LoRa.h>
 
// Define custom pins for the Ra-01 module
const int csPin = 10;          // LoRa radio chip select
const int resetPin = 9;        // LoRa radio reset
const int irqPin = 2;          // Hardware interrupt pin (DIO0)
 
int counter = 0;
 
void setup() {
  Serial.begin(9600);
  while (!Serial);
 
  Serial.println("LoRa Sender starting...");
 
  // Override default pins
  LoRa.setPins(csPin, resetPin, irqPin);
 
  // Initialize Ra-01 at 433 MHz (E6 is exponent for MHz)
  if (!LoRa.begin(433E6)) { 
    Serial.println("Starting LoRa failed! Check wiring.");
    while (1);
  }
 
  Serial.println("LoRa Initialized OK!");
}
 
void loop() {
  Serial.print("Sending packet: ");
  Serial.println(counter);
 
  // Send packet
  LoRa.beginPacket();
  LoRa.print("hello ");
  LoRa.print(counter);
  LoRa.endPacket();
 
  counter++;
  delay(5000); // Wait 5 seconds
}

Key Library Functions

  • LoRa.setPins(ss, reset, dio0): Must be called before LoRa.begin() if you aren't using the default SPI pins.
  • LoRa.begin(frequency): Starts the module. For Ra-01, use 433E6.
  • LoRa.parsePacket(): Checks for incoming data; returns the packet size in bytes if data is available.
  • LoRa.packetRssi(): Returns the signal strength of the last received packet.

Lora topics on lamaPLC