LoRa Temperature & Humidity Monitor Using ESP32, RYLR998, and SHT31

Ever walked all the way to a greenhouse at the end of the garden just to check whether it got too hot or too humid inside? Or wondered what the temperature in your shed or workshop is doing overnight? Wi-Fi rarely reaches those places, and running a long cable is not practical.

So taking this scenario as our goal, we designed a compact, long-range wireless weather station using two ESP32-C3 SuperMini boards, a high-accuracy SHT31 sensor, a crisp OLED display, and a pair of Reyax RYLR998 LoRa modules powered by a dedicated MB102 breadboard power supply. Because both the ESP32 SuperMini and the RYLR998 run natively on 3.3V logic, you don’t need any messy resistor voltage dividers or logic level shifters, and the hardware UART handles the factory 115200 baud rate effortlessly. The transmitter sits in the shed, greenhouse or any other building and sends a reading every 30 seconds. The receiver sits in your house with an OLED display that shows the latest temperature, humidity, signal strength and the age of the reading.

No Wi-Fi, router or internet is needed. Let’s see what you need to build it.


Requirements

Hardware Requirements:

  • 2× ESP32-C3 Super Mini
  • 2× REYAX RYLR998 LoRa module
  • 1× SHT31 temperature and humidity sensor (breakout board)
  • 1× 0.96″ SSD1306 OLED display (128×64, I2C), receiver side only
  • 2× MB102 breadboard power supply module (one per node)
  • 2× breadboards (the MB102 plugs onto the power rails)
  • 2× 100µF electrolytic capacitors
  • A 9V DC adapter or 5V USB supply for each MB102
  • Jumper wires

Software Requirements:

  • Arduino IDE with the ESP32 board package installed
  • Adafruit SHT31 library
  • Adafruit SSD1306 and Adafruit GFX libraries

Component & Sensor Details:

ESP32-C3 SuperMini Development Board:

What is it? The ESP32-C3 SuperMini is an ultra-compact, thumb-sized development board powered by Espressif’s 32-bit RISC-V single-core processor. Despite measuring just 22.5 × 18 mm, it packs built-in Wi-Fi, Bluetooth 5 (LE), hardware UART, I2C, SPI, and native USB-C programming.

ESP32 C3 supermini

Why use it over a standard Arduino? Unlike the 5V Arduino Uno or Nano, the ESP32 SuperMini operates at 3.3V logic and features a dedicated Hardware UART (Serial1). This means you can wire it directly to the 3.3V Reyax RYLR998 LoRa module without voltage dividers, and it communicates cleanly at the RYLR998’s native 115200 baud rate without dropping characters.

Technical Specifications:

  • Microcontroller: ESP32-C3 (32-bit RISC-V CPU @ 160 MHz)
  • Operating Logic Voltage: 3.3V DC
  • Input Power: 5V via USB-C or 5V Pin (regulated down to 3.3V onboard)
  • Default I2C Pins: SDA (GPIO 8), SCL (GPIO 9)
  • Default UART Pins: RX (GPIO 20), TX (GPIO 21)
  • Flash / SRAM: 4MB Flash, 400KB SRAM

MB102 Breadboard Power Supply Module:

What is it? The MB102 is a dual-rail plug-in power supply module designed to snap directly onto the power rails of standard solderless breadboards. It takes 6.5V–12V DC from a wall adapter (via its barrel jack) or 5V from a USB port and regulates it down into clean, independent 3.3V and 5V output rails using onboard AMS1117 linear regulators.

breadboard power supply

Why is it important in this project? When the Reyax RYLR998 transmits a LoRa packet at full power (+22 dBm), it draws sudden current spikes of up to 140 mA. The tiny onboard 3.3V regulator on an ESP32 SuperMini can struggle or brown out when powering both its own CPU and a high-power radio transceiver simultaneously. Using an MB102 breadboard power supply gives the 5V rail to the ESP32 SuperMini (5V pin) and a dedicated, stable 3.3V rail directly to the RYLR998 LoRa module.

Technical Specifications:

  • Input Voltage: 6.5V – 12V DC (Barrel Jack) or 5V DC (USB)
  • Output Voltage: Switchable 3.3V or 5V per breadboard rail via yellow selection jumpers
  • Maximum Output Current: ~700 mA
  • Onboard Features: Power switch, green power indicator LED, and dual AMS1117 regulators (3.3V & 5V)

Reyax RYLR998 LoRa Transceiver Module:

What is it? The RYLR998 is a long-range wireless transceiver module built around the Semtech SX1262 LoRa RF engine. It features an onboard microcontroller pre-loaded with AT command firmware, allowing it to transmit and receive data miles away using only two serial wires (TXD and RXD).

Lora module RYLR998

Technical Specifications:

  • Operating Voltage: 3.0V to 3.6V DC (Strictly 3.3V—Never connect to the 5V rail!)
  • Frequency Range: 868 MHz (Europe/India) / 915 MHz (North America)
  • Communication Interface: UART (Default Baud Rate: 115200 bps)
  • Transmission Range: Up to 15 km (Line of Sight), 1–3 km through buildings and trees

SHT31 Temperature and Humidity Sensor:

What is it? The SHT31-D is an industrial-grade digital temperature and humidity sensor module by Sensirion. Unlike hobbyist DHT11/DHT22 sensors that degrade in damp environments, the SHT31 provides ±0.2°C temperature accuracy and ±2% relative humidity accuracy over an I2C interface, making it ideal for humid greenhouses and outdoor sheds.

Technical specifications:

  • Temperature range: -40°C to 125°C
  • Temperature accuracy: about ±0.3°C
  • Humidity range: 0 to 100% RH
  • Humidity accuracy: about ±2% RH
  • Interface: I2C, address 0x44 (or 0x45 if the ADDR pin is pulled high)
  • Built-in heater to burn off condensation

sht31 temp and humidity sensor pinout

For a deeper look at this sensor, read our guide: Interfacing SHT3x Temperature and Humidity sensor with Arduino

0.96-inch I2C OLED Display (SSD1306):

What is it? A crisp 128×64 pixel monochrome OLED display driven by the SSD1306 chip over I2C (0x3C). Because each pixel is self-illuminating, readings are easy to see across the room in both dark and bright indoor lighting.

oled display pinout diagram


Interfacing ESP32 SuperMini with Required Components:

Setting Up the Breadboard Power Supply Jumpers (Crucial Step!)

Every MB102 Breadboard Power Supply has two yellow jumper caps that let you choose between 3.3V and 5V for the top and bottom rails of your breadboard. Set both breadboards up as follows:

  1. Top Rail Jumper → Set to 5V: Use this rail solely to feed the 5V input pin of the ESP32 SuperMini (the SuperMini’s onboard regulator expects 5V on its 5V pin and steps it down safely).
  2. Bottom Rail Jumper → Set to 3.3V: Use this rail to power the RYLR998 LoRa module, the SHT31 sensor, and the OLED display.
  3. Common Ground (GND): Connect the - (GND) rail of the top side to the - (GND) rail of the bottom side using a jumper wire so all components share a common ground.

⚠️ WARNING: Double-check your breadboard rails before plugging in the RYLR998! Connecting the RYLR998 VDD pin to the 5V rail will permanently damage the transceiver.

⚠️ Never power the RYLR998 without an antenna attached. Transmitting without one can damage the RF stage.

1. Transmitter Circuit Diagram & Pinout (Greenhouse / Shed Side)

Long range lora temperature and humidity monitorTransmitter Circuit Diagram

On the ESP32-C3 SuperMini, the default I2C pins are GPIO 8 (SDA) and GPIO 9 (SCL). For the RYLR998 UART connection, we use GPIO 20 (RX) and GPIO 21 (TX). Because both boards use 3.3V logic, no resistors are needed on the TX/RX lines.

Component Pin Connected To Power / Signal Details
ESP32 5V Pin Breadboard 5V Rail (+) Powers the ESP32 SuperMini
ESP32 GND Pin Breadboard GND Rail (-) Common Ground
RYLR998 VDD Breadboard 3.3V Rail (+) Strictly 3.3V Rail!
RYLR998 GND Breadboard GND Rail (-) Common Ground
RYLR998 TXD ESP32 GPIO 20 (RX) Direct 3.3V UART connection
RYLR998 RXD ESP32 GPIO 21 (TX) Direct 3.3V UART connection
SHT31 VIN Breadboard 3.3V Rail (+) 3.3V Power
SHT31 GND Breadboard GND Rail (-) Common Ground
SHT31 SDA ESP32 GPIO 8 I2C Data Line
SHT31 SCL ESP32 GPIO 9 I2C Clock Line

2. Receiver Circuit Diagram & Pinout (Indoor Monitor Side)

Lora weather monitor receiver Schematic with ESP32 SuperMini, OLED Display, and RYLR998

 

On the indoor receiver breadboard, configure the MB102 jumpers the exact same way (5V on one rail for the ESP32 5V pin, 3.3V on the other rail for the RYLR998 and OLED display).

Component Pin Connected To Power / Signal Details
ESP32 5V Pin Breadboard 5V Rail (+) Powers the ESP32 SuperMini
ESP32 GND Pin Breadboard GND Rail (-) Common Ground
RYLR998 VDD Breadboard 3.3V Rail (+) Strictly 3.3V Rail!
RYLR998 GND Breadboard GND Rail (-) Common Ground
RYLR998 TXD ESP32 GPIO 20 (RX) Direct 3.3V UART connection
RYLR998 RXD ESP32 GPIO 21 (TX) Direct 3.3V UART connection
OLED VCC Breadboard 3.3V Rail (+) 3.3V Power
OLED GND Breadboard GND Rail (-) Common Ground
OLED SDA ESP32 GPIO 8 I2C Data Line
OLED SCL ESP32 GPIO 9 I2C Clock Line

Build a Professional LoRa Environmental Monitor with PCBWay—Custom PCBs & 3D-Printed Enclosures for Your ESP32, RYLR998 & SHT31 Project

Monitor temperature and humidity over long distances with a reliable, field-ready LoRa sensor node. PCBWay’s integrated manufacturing services help you transform your ESP32, RYLR998, and SHT31 prototype into a polished, professional monitoring device—perfect for agriculture, greenhouses, cold storage, or industrial IoT.

Custom PCB Manufacturing for Accurate Sensing & Reliable LoRa:
PCBWay manufactures high-quality custom PCBs that consolidate your ESP32, RYLR998 LoRa transceiver, SHT31 sensor, and power management onto a single compact board. Their PCBs feature clean I²C traces to preserve the SHT31’s high-accuracy digital signals, proper impedance control for stable SPI communication with the RYLR998 module, and dedicated power planes to handle LoRa transmission bursts. Choose our professional SMT assembly to receive a fully populated, tested board ready for deployment.

Weatherproof 3D-Printed Enclosures for Outdoor Reliability:
Design and order a custom enclosure through PCBWay’s advanced 3D printing service. Create a rugged, weather-resistant housing using UV-stabilized ASA or waterproof PETG, featuring a vented sensor chamber for accurate temperature and humidity readings, an external antenna mounting point for optimal LoRa range, and cable glands for secure wiring. Add pole or wall mounting flanges and internal PCB bosses—all printed with precision for long-term outdoor durability.

Why PCBWay Delivers Professional Results:

  • Accurate Data: Clean PCB design preserves SHT31 sensor signals for reliable environmental readings
  • Long-Range Performance: RF-optimized layouts maximize LoRa signal stability
  • Outdoor Durability: Custom enclosures protect electronics from harsh conditions

Build Your LoRa Monitor Today:
Upload your PCB design and enclosure model for instant quotes, DFM feedback, and professional manufacturing only at PCBWAY.COM


Code to Upload Using Arduino IDE:

Required Libraries & Board Setup:

  1. Open the Arduino IDE, go to Tools -> Board -> ESP32, and select ESP32 C3 Supemini (or MakerGo ESP32 C3 supermini).
  2. Go to Sketch -> Include Library -> Manage Libraries, and install:
    • Adafruit SHT31 Library – link
    • Adafruit SSD1306 – link
    • Adafruit GFX Library – link

(Note: Unplug the external breadboard power supply or turn its switch OFF while plugging the USB-C cable into your computer to upload code, then switch the breadboard power supply back ON for standalone operation).

1. Transmitter Code (Upload to Shed / Greenhouse ESP32 SuperMini):

#include <Wire.h>
#include "Adafruit_SHT31.h"

// Define I2C pins for ESP32-C3 SuperMini
#define I2C_SDA 8
#define I2C_SCL 9

// Define Hardware UART1 pins for RYLR998 LoRa Module
#define LORA_RX 20  // Connect to RYLR998 TXD
#define LORA_TX 21  // Connect to RYLR998 RXD

Adafruit_SHT31 sht31 = Adafruit_SHT31();
HardwareSerial loraSerial(1); // Use Hardware UART 1

unsigned long lastSendTime = 0;
const unsigned long sendInterval = 5000; // Transmit every 5 seconds

void setup() {
  Serial.begin(115200);
  delay(1000);
  Serial.println("Starting ESP32 SuperMini LoRa Transmitter...");

  // Initialize I2C and SHT31 Sensor
  Wire.begin(I2C_SDA, I2C_SCL);
  if (!sht31.begin(0x44)) {
    Serial.println("Error: Could not find SHT31 sensor! Check wiring.");
    while (1) delay(10);
  }

  // Initialize Hardware Serial1 at RYLR998 native 115200 baud
  loraSerial.begin(115200, SERIAL_8N1, LORA_RX, LORA_TX);
  delay(500);

  // Configure RYLR998 LoRa settings (Network 5, Transmitter Address 1)
  sendATCommand("AT+NETWORKID=5");
  sendATCommand("AT+ADDRESS=1");
  // Set Long-Range RF Parameters: SF9, BW125kHz, CR1, Preamble12
  sendATCommand("AT+PARAMETER=9,7,1,12");

  Serial.println("Transmitter Ready!");
}

void loop() {
  if (millis() - lastSendTime >= sendInterval) {
    lastSendTime = millis();

    float tempC = sht31.readTemperature();
    float humidity = sht31.readHumidity();

    if (!isnan(tempC) && !isnan(humidity)) {
      // Create payload formatted as "26.4,65.2"
      String payload = String(tempC, 1) + "," + String(humidity, 1);
      int payloadLength = payload.length();

      // Send payload to Receiver (Address 2)
      String cmd = "AT+SEND=2," + String(payloadLength) + "," + payload;
      
      Serial.print("Transmitting: ");
      Serial.println(cmd);
      
      loraSerial.print(cmd + "\r\n");
    } else {
      Serial.println("Error reading from SHT31 sensor!");
    }
  }

  // Print LoRa module confirmation (+OK) to Serial Monitor
  while (loraSerial.available()) {
    Serial.write(loraSerial.read());
  }
}

void sendATCommand(String cmd) {
  loraSerial.print(cmd + "\r\n");
  delay(300);
  while (loraSerial.available()) {
    Serial.write(loraSerial.read());
  }
}

2. Receiver Code (Upload to Indoor OLED ESP32 SuperMini):

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

// Define I2C pins for ESP32-C3 SuperMini
#define I2C_SDA 8
#define I2C_SCL 9

// Define Hardware UART1 pins for RYLR998 LoRa Module
#define LORA_RX 20  // Connect to RYLR998 TXD
#define LORA_TX 21  // Connect to RYLR998 RXD

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

HardwareSerial loraSerial(1); // Use Hardware UART 1

String tempStr = "--.-";
String humStr  = "--.-";
String rssiStr = "--";

void setup() {
  Serial.begin(115200);
  delay(1000);
  Serial.println("Starting ESP32 SuperMini LoRa Receiver...");

  // Initialize I2C and SSD1306 OLED Display
  Wire.begin(I2C_SDA, I2C_SCL);
  if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
    Serial.println("SSD1306 OLED allocation failed! Check wiring.");
    while (1) delay(10);
  }

  display.clearDisplay();
  display.setTextColor(SSD1306_WHITE);
  display.setTextSize(1);
  display.setCursor(10, 25);
  display.println("Initializing LoRa...");
  display.display();

  // Initialize Hardware Serial1 at RYLR998 native 115200 baud
  loraSerial.begin(115200, SERIAL_8N1, LORA_RX, LORA_TX);
  delay(500);

  // Configure RYLR998 LoRa settings (Network 5, Receiver Address 2)
  sendATCommand("AT+NETWORKID=5");
  sendATCommand("AT+ADDRESS=2");
  sendATCommand("AT+PARAMETER=9,7,1,12");

  updateOLED();
  Serial.println("Receiver Ready & Listening...");
}

void loop() {
  if (loraSerial.available()) {
    String incoming = loraSerial.readStringUntil('\n');
    incoming.trim();

    Serial.print("Received Packet: ");
    Serial.println(incoming);

    // Format from RYLR998: +RCV=1,9,26.4,65.2,-45,10
    if (incoming.startsWith("+RCV=")) {
      parseLoRaPacket(incoming);
      updateOLED();
    }
  }
}

void parseLoRaPacket(String data) {
  // Parse comma indices in: +RCV=<Addr>,<Len>,<Temp>,<Hum>,<RSSI>,<SNR>
  int c1 = data.indexOf(',');
  int c2 = data.indexOf(',', c1 + 1);
  int c3 = data.indexOf(',', c2 + 1);
  int c4 = data.indexOf(',', c3 + 1);
  int c5 = data.indexOf(',', c4 + 1);

  if (c1 > 0 && c2 > 0 && c3 > 0 && c4 > 0 && c5 > 0) {
    tempStr = data.substring(c2 + 1, c3);
    humStr  = data.substring(c3 + 1, c4);
    rssiStr = data.substring(c4 + 1, c5);
  }
}

void updateOLED() {
  display.clearDisplay();

  // Top Status Bar
  display.setTextSize(1);
  display.setCursor(0, 0);
  display.print("SHED MONITOR");
  display.setCursor(80, 0);
  display.print(rssiStr + "dBm");
  display.drawLine(0, 10, 128, 10, SSD1306_WHITE);

  // Temperature Row
  display.setTextSize(1);
  display.setCursor(0, 16);
  display.print("Temp:");
  display.setTextSize(2);
  display.setCursor(38, 14);
  display.print(tempStr);
  display.setTextSize(1);
  display.print(" C");

  // Humidity Row
  display.setTextSize(1);
  display.setCursor(0, 42);
  display.print("Humi:");
  display.setTextSize(2);
  display.setCursor(38, 40);
  display.print(humStr);
  display.setTextSize(1);
  display.print(" %");

  display.display();
}

void sendATCommand(String cmd) {
  loraSerial.print(cmd + "\r\n");
  delay(300);
  while (loraSerial.available()) {
    Serial.write(loraSerial.read());
  }
}

Working of the Long-Range Weather Monitor:

Once both codes are uploaded and your MB102 breadboard power supplies are switched on, the transmitter unit in your shed or greenhouse reads the SHT31 sensor every 5 seconds.

(Insert Image: Completed Breadboard Setup with MB102 Power Supply, ESP32 SuperMini, RYLR998, and OLED Screen)

Because the RYLR998 draws power directly from the MB102’s dedicated 3.3V regulator, it transmits at full power without causing any voltage dips on the ESP32 SuperMini. Inside your home, the receiver node catches the LoRa transmission and parses the string +RCV=1,9,26.4,65.2,-48,11, immediately refreshing the 0.96″ OLED display with:

  • Live Temperature (°C)
  • Live Relative Humidity (%)
  • RSSI Signal Strength (dBm) in the top-right corner so you know your connection health at all times.

Reading the RSSI value: RSSI tells you how strong the radio link is. It is a negative number in dBm, and the closer to zero the better.

RSSI Link quality
-30 to -80 dBm Excellent
-80 to -100 dBm Good, reliable
-100 to -115 dBm Weak, but may still work
Below -115 dBm Likely to drop packets

If your RSSI sits below -105 dBm at the spot where the receiver is installed, move the receiver (or its antenna) closer to a window, or raise the transmitter antenna a little. Height makes a big difference to LoRa range.

Since the ESP32 SuperMini also has built-in Wi-Fi, you can easily expand the indoor receiver code later to push these incoming LoRa readings to a local web server, Blynk, or Home Assistant!

Ideas to Upgrade This Project

  • Add a Wi-Fi web dashboard on the receiver ESP32, since the board already has Wi-Fi. See our ESP32 Weather Station with live web dashboard and charts.
  • Add an alarm buzzer on the receiver for frost or overheating limits.
  • Add battery power and deep sleep to the transmitter for places with no mains supply. For a battery build, skip the MB102, because its regulators waste too much current. Power the ESP32 and LoRa module from a low-quiescent 3.3V regulator instead.
  • Add more nodes in different buildings, each with its own address and a label in the payload.

Troubleshooting

Nothing prints in the Serial Monitor. Set USB CDC On Boot to Enabled in the Tools menu and upload again.

Upload fails or the port disappears. Hold the BOOT button while plugging in the USB cable, then upload. Also disconnect the MB102 5V wire while uploading over USB.

Nothing shows on the receiver. Check that the network ID and band are identical on both sides, and that the addresses differ (transmitter 1, receiver 2). Make sure the TXD/RXD wires aren’t swapped. The module TXD goes to the ESP32 RX pin, and the module RXD goes to the ESP32 TX pin.

No reply to AT commands. Check wiring first. If it still stays silent, the module’s baud rate may have been changed. The code assumes the factory 115200.

ESP32 reboots or the LoRa module is hot. Verify the jumper positions with a multimeter. A LoRa module on the 5V rail will overheat and fail.

Humidity reads 100% in a greenhouse. This can happen with condensation on the sensor. The SHT31 has a built-in heater you can switch on briefly with sht31.heater(true). Turn it off again after a few seconds, because the heater raises the temperature reading while it is on.


Frequently Asked Questions

Why ESP32-C3 Super Mini instead of Arduino? It runs at 3.3V logic like the LoRa module, so no level shifter is needed. It has a spare hardware UART, more RAM, and built-in Wi-Fi for future upgrades, and it costs about the same as an Arduino Nano.

Do I need the MB102 power supply? It is not strictly required, but it gives the LoRa module a stable 3.3V supply and makes the breadboard wiring tidy. It is the easiest fix for random resets and dropped packets.

How far can the RYLR998 transmit? In open line of sight, several kilometres. Around buildings and trees, expect a few hundred metres to a couple of kilometres. Antenna quality and height matter more than anything else.

Can I add more sensors in different buildings? Yes. Give each transmitter a unique address (1, 3, 4 and so on), keep the same network ID, and have each one send to the receiver’s address. Add a node label to the payload so the receiver knows which building the reading came from.

Is LoRa legal to use without a license? In the license-free ISM bands, yes. Use the band for your country and stay within the allowed power limits.

Why SHT31 instead of DHT22? The SHT31 is more accurate, faster, and holds up better in humid places. It is also an I2C sensor, so it shares wires with the OLED instead of needing a separate data pin.


Conclusion

You now have a working long range temperature and humidity monitor that needs no Wi-Fi and no cloud account. With two ESP32-C3 Super Mini boards, two RYLR998 modules, an SHT31, an OLED and an MB102 power supply on each node, you have a flexible base for monitoring a shed, greenhouse, barn or workshop.

If you build this, tell us in the comments how far your link reached and what RSSI you got. If you get stuck, paste your Serial Monitor output below and we’ll help you debug it.

Add a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *