Getting Started With the Elecrow LR1262 Node Board (RP2040 + TFT Display + LoRa)

by Electronic CNC Lab in Circuits > Microcontrollers

9 Views, 0 Favorites, 0 Comments

Getting Started With the Elecrow LR1262 Node Board (RP2040 + TFT Display + LoRa)

01-Board-Front.png
1262-dev.png

The Elecrow LR1262 Node Board is a compact and complete development board that integrates the RP2040 microcontroller, a LoRa RA-08H module based on the SX1262 chip, and a 1.8” color TFT display.

In this project, I’ll guide you step by step through installing and configuring the board in Arduino IDE, showing you how to display your first “Hello World” message and finally how to read environmental data from a BME280 sensor.

It’s the perfect starting point for anyone who wants to explore the world of IoT, LoRa, and embedded displays, using a powerful and versatile board.

Link: https://www.elecrow.com/wiki/LoRaWAN_LR1262_Development_Board_Integrated_RP2040_with_1.8LCD_for_Long_Range_Communication.html

Supplies

Elecrow LR1262 Node Board (RP2040 + LoRa + 1.8” LCD)

-Main development board

-USB–Micro USB cable (For power and data connection)

-BME280 Sensor (I²C) (Measures temperature, humidity, and pressure)

-Dupont male–female jumper wires 4

-I²C connections

Connect the Board to Arduino IDE

01-Settings.png
02-Settings.png
03-Settings.png
04-Settings.png

To get started, you need to configure Arduino IDE to recognize the Elecrow LR1262 Node Board, which is based on the Raspberry Pi RP2040.

1️⃣ Install RP2040 Board Support

  1. Open Arduino IDEFilePreferences.
  2. In the “Additional Boards Manager URLs” field, paste the following link:
  3. https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json

  4. Go to Tools → Board → Boards Manager and search for “Raspberry Pi RP2040”.
  5. Install the package Raspberry Pi Pico/RP2040 by Earle Philhower.

2️⃣ Select the Correct Board

  1. Go to Tools → Board → Raspberry Pi RP2040 Boards.
  2. Select Raspberry Pi Pico (the Elecrow LR1262 is compatible).

3️⃣ Connect the Board to the PC

  1. Use a USB–Micro USB cable.
  2. If the board is not detected, press and hold the BOOTSEL button, connect the cable, then release the button.
  3. A new drive called RPI-RP2 will appear on your computer.

4️⃣ Upload a Test Sketch

  1. Open Arduino IDE.
  2. Select the correct COM port from Tools → Port.
  3. Upload a simple sketch, such as Blink, to verify that communication is working.



Upload a Test Sketch

Standard Board Configuration

When the Elecrow LR1262 Node Board is connected via USB and properly recognized, you can upload sketches directly from Arduino IDE without entering BOOTSEL mode.

This happens because the board already includes the RP2040 bootloader configured for standard operation. In this mode:

  1. You don’t need to hold the BOOTSEL button every time you upload.
  2. The COM port remains active as long as the board is powered through USB.
  3. The upload process uses the “Default (UF2)” method from Earle Philhower’s RP2040 core.

🔧 Typical Arduino IDE settings

  1. Board: Raspberry Pi Pico
  2. Upload Method: Default (UF2)
  3. Port: COMx (where x is the system-assigned port number)
  4. Baud Rate: 115200 baud (for Serial Monitor)

During upload, Arduino IDE automatically detects the board and transfers the .uf2 file to the microcontroller’s virtual drive. After a few seconds, the board automatically resets and starts running the new sketch.

Test LED Blink

Led on.png
Led off.png

Before moving on to the display or sensors, it’s recommended to run a simple test to verify that the board is properly recognized and programmable.

This is the classic Blink sketch, adapted for the Elecrow LR1262 Node Board, which uses the onboard LED connected to GPIO 25.


💡 Expected Result:

The onboard LED starts blinking every second (1s ON / 1s OFF).

If the LED blinks, it confirms that:

  1. the board is properly recognized by Arduino IDE;
  2. the USB connection is functional;
  3. the bootloader and memory are working as expected.


// Onboard LED Blink - Elecrow LR1262 Node Board
// Author: Giuseppe from Electronic & CNC Lab

#define LED_PIN 25 // Onboard LED pin

void setup() {
pinMode(LED_PIN, OUTPUT); // set pin as output
}

void loop() {
digitalWrite(LED_PIN, HIGH); // turn LED on
delay(1000); // wait 1 second
digitalWrite(LED_PIN, LOW); // turn LED off
delay(1000); // wait 1 second
}

Hello World With Adafruit Libraries

Hello World.png

This sketch uses the Adafruit_ST7735 and Adafruit_GFX libraries — one of the most reliable ways to drive SPI TFT displays such as the one integrated into the Elecrow LR1262 Node Board.

The code initializes the 1.8” display (ST7735S, 128×160), sets the background color, and displays “Hello World!” in green text on a black background.

The backlight is automatically activated via GPIO 23.

💡 Expected Result:

The display shows two green lines:


Hello
World!

on a black background, perfectly readable and stable — confirming that SPI communication and the display initialization are working as intended.


/*
ST7735S Display Test (1.8" TFT) on LR1262
Shows the text "Hello World!"
Author: Giuseppe (Electronic & CNC Lab)
*/

#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>
#include <SPI.h>

#define TFT_CS 17
#define TFT_DC 16
#define TFT_RST 22
#define TFT_BL 23

Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);

void setup() {
pinMode(TFT_BL, OUTPUT);
digitalWrite(TFT_BL, HIGH);

tft.initR(INITR_BLACKTAB);
tft.fillScreen(ST77XX_BLACK);

tft.setCursor(30, 30);
tft.setTextColor(ST77XX_GREEN);
tft.setTextSize(2);
tft.println("Hello");
tft.setCursor(30, 60);
tft.println("World!");
}

void loop() {}

Temperature, Humidity & Pressure on RP2040

IMG_20251026_115527-removebg-preview.png

In this project, we build a compact environmental monitoring station using the Elecrow RP2040 board with LR1262 LoRa module. A BME280 sensor is used to measure temperature, humidity, and pressure, and the results are displayed in real time on a 1.8" ST7735S TFT screen.

The sketch automatically checks both I2C addresses (0x76 and 0x77) for the BME280. If not found, it tries a BMP280 instead (no humidity data).

The I2C pins are fixed on GP20 (SDA) and GP21 (SCL), as required by the Elecrow board layout.

This is a great base for expanding toward LoRa data transmission or just keeping a visual log of environmental conditions locally.

✅ Easy to build

✅ Arduino IDE compatible

✅ Ideal for labs, greenhouses, or IoT prototypes

Author: Giuseppe Romano – Electronic & CNC Lab

📺 YouTube Channel

/*
This sketch reads temperature, pressure, and humidity from a BME280 or BMP280 sensor (no humidity in this case),
using I2C communication forced on RP2040 pins GP20 (SDA) and GP21 (SCL). It displays the values on an ST7735S TFT screen.
LR1262 + BME280/BMP280 + ST7735S (fix I2C pins + auto indirizzo)

- Forza I2C su SDA=GP20, SCL=GP21
- Tenta BME280 su 0x76 e 0x77
- Se non trova BME, prova BMP280 (senza umidità)

- First tries to initialize a BME280 at I2C addresses 0x76 and 0x77
- If BME280 is not detected, it attempts to initialize a BMP280
- If no sensor is found, it shows an error message on screen

Author: Giuseppe from Electronic & CNC Lab
YouTube: https://www.youtube.com/@Electronic.CNCLab
*/

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>
#include <Adafruit_BME280.h>
#include <Adafruit_BMP280.h>
#include <SPI.h>

// --- Display ---
#define TFT_CS 17
#define TFT_DC 16
#define TFT_RST 22
#define TFT_BL 23
Adafruit_ST7735 tft(TFT_CS, TFT_DC, TFT_RST);

// --- Sensori ---
Adafruit_BME280 bme; // BME280 (T+U+P)
Adafruit_BMP280 bmp; // BMP280 (T+P) fallback
bool useBME = false; // true = BME280, false = BMP280
uint8_t i2cAddr = 0x76; // sarà aggiornato dopo l’autodetect

void lcdMsg(const char* msg, uint16_t color=ST77XX_WHITE, uint16_t bg=ST77XX_BLACK) {
tft.fillScreen(bg);
tft.setCursor(10, 30);
tft.setTextColor(color);
tft.setTextSize(2);
tft.println(msg);
}

void setup() {
Serial.begin(115200);
delay(200);

// Retroilluminazione
pinMode(TFT_BL, OUTPUT);
digitalWrite(TFT_BL, HIGH);

// Display
tft.initR(INITR_BLACKTAB);
tft.setRotation(1);
lcdMsg("Avvio... ", ST77XX_YELLOW);

// *** FIX FONDAMENTALE: mappa I2C su GP20/GP21 ***
Wire.setSDA(20);
Wire.setSCL(21);
Wire.begin(); // ora l'I2C punta al connettore IIC della LR1262

// Autodetect indirizzo e tipo sensore
uint8_t candidates[2] = {0x76, 0x77};
bool found = false;

for (uint8_t i = 0; i < 2 && !found; i++) {
uint8_t addr = candidates[i];
// Prova BME280
if (bme.begin(addr)) {
useBME = true;
i2cAddr = addr;
found = true;
Serial.print("BME280 trovato a 0x"); Serial.println(addr, HEX);
break;
}
// Prova BMP280
if (bmp.begin(addr)) {
useBME = false;
i2cAddr = addr;
found = true;
Serial.print("BMP280 trovato a 0x"); Serial.println(addr, HEX);
break;
}
}

if (!found) {
lcdMsg("I2C NONE", ST77XX_WHITE, ST77XX_RED);
Serial.println("Nessun BME/BMP trovato su 0x76/0x77. Controlla connettore IIC, jumper 3.3V, cavo e modulo.");
while (1) delay(10);
}

// Ok
tft.fillScreen(ST77XX_BLACK);
}

void loop() {
float T = NAN, H = NAN, P = NAN;

if (useBME) {
T = bme.readTemperature();
H = bme.readHumidity();
P = bme.readPressure() / 100.0f; // hPa
} else { // BMP280 (niente umidità)
T = bmp.readTemperature();
P = bmp.readPressure() / 100.0f; // hPa
}

// Debug
Serial.print("Addr 0x"); Serial.print(i2cAddr, HEX);
Serial.print(useBME ? " (BME)" : " (BMP)");
Serial.print(" T="); Serial.print(T,1); Serial.print("C ");
if (useBME) { Serial.print("U="); Serial.print(H,1); Serial.print("% "); }
Serial.print("P="); Serial.print(P,1); Serial.println("hPa");

// LCD
tft.fillScreen(ST77XX_BLACK);
tft.setTextSize(2);

tft.setCursor(10, 10);
tft.setTextColor(ST77XX_GREEN);
tft.print("T: "); tft.print(T, 1); tft.println(" C");

tft.setCursor(10, 40);
if (useBME) {
tft.setTextColor(ST77XX_CYAN);
tft.print("U: "); tft.print(H, 1); tft.println(" %");
} else {
tft.setTextColor(ST77XX_CYAN);
tft.println("U: n/a");
}

tft.setCursor(10, 70);
tft.setTextColor(ST77XX_MAGENTA);
tft.print("P: "); tft.print(P, 1); tft.println(" hPa");

delay(2000);
}

WORK IN PROGRESS

Work In Progress.png

🔧 Note: This project is a work in progress.

It will be updated and enriched with new insights, improvements, and additional features over the coming days/weeks.

Stay tuned!