meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
com:ai_thinker_products [2026/03/05 15:40] – created - external edit 127.0.0.1com:ai_thinker_products [2026/03/28 16:20] (current) – [RA-01 / RA-02 Pinout] vamsan
Line 3: Line 3:
 ====== lamaPLC: AI-Thinker LoRA products ====== ====== lamaPLC: AI-Thinker LoRA products ======
 {{ :com:clipboard_03-05-2026_02.png?140|AI-Thinker Ra-02}} {{ :com:clipboard_03-05-2026_02.png?140|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.+Ai-Thinker's LoRa product line is divided into the Ra Series ([[basic_spi|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. 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.
  
 +|< 100%>|
 ^Product Series^Model^Frequency^Core Chip^Interface^Primary Use Case| ^Product Series^Model^Frequency^Core Chip^Interface^Primary Use Case|
 ^Ra Series (SPI)|Ra-01|410–525 MHz|SX1278|SPI|Low-cost DIY, spring antenna included| ^Ra Series (SPI)|Ra-01|410–525 MHz|SX1278|SPI|Low-cost DIY, spring antenna included|
Line 29: Line 29:
   * **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-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.   * **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 ==== 
 +{{ :com:ra_01_pinout.png?200|RA-01 / RA-02 Pinout}}
 +^Pin^Label^Type^Description|
 +^1|ANT / GND|Antenna|Ra-01: Antenna solder point. Ra-02: Usually Ground (uses IPEX connector instead)|
 +^2|GND|Power|Ground|
 +^3|3.3V|Power|Supply Voltage (2.5V - 3.7V). Do not use 5V|
 +^4|RESET|Input|Reset pin (active low)|
 +^5|DIO0|I/O|Digital I/O 0 (standard interrupt for RX/TX done)|
 +^6|DIO1|I/O|Digital I/O 1 (timeout/other interrupts)|
 +^7|DIO2|I/O|Digital I/O 2 (FHSS/other interrupts)|
 +^8|DIO3|I/O|Digital I/O 3 CAD/Header (Channel Activity Detection)|
 +^9|DIO4|I/O|Digital I/O 4 Preamble/Ready|
 +^10|DIO5|I/O|Digital I/O 5 System Ready / ModeReady signaling|
 +^11|SCK|SPI|SPI Serial Clock|
 +^12|MISO|SPI|SPI Master In Slave Out|
 +^13|MOSI|SPI|SPI Master Out Slave In|
 +^14|NSS|SPI|SPI Chip Select (Slave Select)|
 +^15|GND|Power|Ground|
 +^16|GND|Power|Ground|
 +
 +**DIO Functionality in LoRa Mode**
 +
 +^Pin^Default/Common Function^Detailed Events|
 +^DIO0|RX/TX Done|Signals //RxDone// (packet received) or //TxDone// (packet sent).|
 +^DIO1|Timeout|Signals //RxTimeout//, //FhssChangeChannel//, or //CadDetected//.|
 +^DIO2|FHSS/Payload|Signals //FhssChangeChannel// or //FhssValidHeader// (frequency hopping).|
 +^DIO3|CAD/Header|Signals //CadDone//, //ValidHeader//, or //PayloadCrcError//.|
 +^DIO4|Preamble/Ready|Signals //PreambleDetect//, //ModeReady//, or //PllLock//.|
 +^DIO5|System Ready|Signals //ModeReady//, //ClkOut//, or //PllLock//.|
 +
 +**Important Wiring Notes**
 +
 +  * **Voltage Warning:** Both modules require 3.3V power. <color red>Connecting them to the 5V pin of an Arduino Uno can destroy the chip</color>. 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:** <color red>Never power on or transmit without an antenna attached.</color> Operating the module without a load can permanently damage the power amplifier.
 +  * **Interrupts:** Most LoRa libraries (such as //LoRa.h)// require <color red>connecting the DIO0 pin to a hardware interrupt pin on your microcontroller</color> 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 [[sensor:txs0108e|TXS0108E (HW-0108)]] Logic Level Converter or voltage dividers on the data lines to avoid damaging the module.
 +
 +|<100%>|
 +^Ra-01 Pin^Logic level converter^Arduino Pin (Uno/Nano)^Wire Color^Notes|
 +^VCC|Va - Vb|5V|<color red>♦</color> red|Power|
 +^GND|GND|GND|<color black>♦</color> black|Common ground|
 +^SCK|A4 - B4|D13|<color green>♦</color> green|SPI Clock|
 +^MISO|A3 - B3|D12|<color darkblue>♦</color> darkblue|SPI Master In Slave Out|
 +^MOSI|A2 - B2|D11|<color yellow>♦</color> yellow|SPI Master Out Slave In|
 +^NSS|A1 - B1|D10 (or D7)|<color lightblue>♦</color> lightblue|Chip Select (CS)|
 +^RESET|A8 - B8|D9 (or D6)|<color purple>♦</color> purple|Reset Pin|
 +^DIO0|A7 - B7|D2|<color orange>♦</color> orange|Interrupt Pin (Required for RX)|
 +
 +{{ :com:arduino_txs0108e_ra01.png |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.
 +
 +<code c>
 +#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
 +}
 +</code>
 +
 +**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 ===== ===== Lora topics on lamaPLC =====
Line 36: Line 177:
 \\ \\
 \\ \\
-{{tag>AI-Thinker Lora_Manufacturer communication lora modul}}+{{tag>AI-Thinker Lora_Manufacturer communication lora modul ra-01 ra-02 spi arduino}}
 \\ \\
 This page has been accessed for: Today: {{counter|today}}, Until now: {{counter|total}} This page has been accessed for: Today: {{counter|today}}, Until now: {{counter|total}}