Weather stations are crucial for gathering data to predict weather patterns and changes. With the advent of IoT, these stations have become smarter and more accessible. In this project, we will build a LoRa E5 Weather Station integrated with the Lark STEM kit and powered by the Xiao ESP32 S3 microcontroller. This setup allows for long-range communication and real-time data monitoring.
Project Overview✨:The LoRa E5 Weather Station will collect environmental data such as temperature, humidity, atmospheric pressure, wind speed, and wind direction. Using the LoRa E5 module, the data can be transmitted over long distances to a central server. The Xiao ESP32 S3, with its compact size and powerful features, will serve as the brain of the station, processing data and handling communication.
- LoRa E5 Module: For long-range communication.
- Xiao ESP32 S3: A small yet powerful microcontroller with Wi-Fi and Bluetooth capabilities.
- Lark Platform: For weather data collection.
The Xiao ESP32 S3 is a versatile board that packs a dual-core processor and wireless capabilities into a tiny footprint. It will act as the central processing unit for our weather station.
Specifications:
- Processor: Xtensa LX7 dual-core, 32-bit processor running up to 240 MHz.
- Wireless: Complete 2.4GHz Wi-Fi subsystem, BLE: Bluetooth 5.0, Bluetooth mesh.
- Memory: 8M PSRAM & 8MB Flash
The LoRa E5 module will enable our weather station to transmit data over long distances, making it suitable for remote monitoring.
Features:
- Long-range transmission capabilities.
- Low power consumption, ideal for battery-powered applications.
In the world of electronics prototyping, transitioning from a breadboard to a custom-designed printed circuit board (PCB) is a significant leap. It not only enhances reliability but also provides a professional touch to your projects. In my case, I decided to move away from the tangle of jumper wires and breadboard connections by designing a custom PCB using Seeed Studio Fusion PCB Service.
Now, instead of messy breadboard connections, I have a custom-designed PCB that integrates the Xiao ESP32-S3 and LoRa E5. This setup allows me to directly transmit data via LoRa without any hardwired.
Whether it’s an environmental monitoring system, a smart agriculture application, or an off-grid communication device, having a purpose-built PCB simplifies the journey from idea to reality.
Remember, every PCB tells a story—a story of creativity, problem-solving, and innovation. So, go ahead and craft your own PCB with Seeed Fusion Service.
Step 4️⃣: Connecting Weather SensorsConnect the LARK weather station with the Xiao ESP32 S3 to measure environmental data. These can include temperature, humidity, wind speed, direction, and pressure sensors.
LARK Weather station can transmit data via both UART and I2C communication, but in this project, we are going to use I2C communication.
Connect the LARK with Xiao ESP32 S3 via the I2C port.
First, install the LARK weather station library to communicate with the LARK.
Here is the library link GitHub - DFRobot/DFRobot_LarkWeatherStation
Program the Xiao ESP32 S3 using the Arduino IDE. The code will handle sensor data collection from the LARK weather station.
#include "DFRobot_LarkWeatherStation.h"
#define DEVICE_ADDR 0x42
DFRobot_LarkWeatherStation_I2C atm(DEVICE_ADDR,&Wire);
void setup(void){
Serial.begin(115200);
delay(1000);
while(atm.begin()!= 0){
Serial.println("init error");
delay(1000);
}
Serial.println("init success");
}
void loop(void){
Serial.println(atm.getTimeStamp());
Serial.print(atm.getValue("Speed"));
Serial.println(atm.getUnit("Speed"));
Serial.println(atm.getValue("Dir"));
Serial.print(atm.getValue("Temp"));
Serial.println(atm.getUnit("Temp"));
Serial.print(atm.getValue("Humi"));
Serial.println(atm.getUnit("Humi"));
Serial.print(atm.getValue("Pressure"));
Serial.println(atm.getUnit("Pressure"));
Serial.println("----------------------------");
delay(1000);
}Here is the serial terminal data from the Arduino IDE.
Once we collect the data next thing is to transmit via LORA communication for that we are going to use the Lora E5 module and the LoraE5 library.
Here I'm going to use the LoRaE5 library by Ramin Sangesari.
Thanks to Ramin Sangesari for this awesome simple library.
This library contains two example sketches, one is a receiver and the other one is the transmitter.
Here is the final sketch that can transmit our voice learning sensor data via LoRa.
#include <LoRaE5.h>
#include "DFRobot_LarkWeatherStation.h"
#define DEVICE_ADDR 0x42
DFRobot_LarkWeatherStation_I2C atm(DEVICE_ADDR, &Wire);
#define GROVE_TX 43
#define GROVE_RX 44
const long interval = 2000;
unsigned long previousMillis = 0;
void setup(void) {
Serial.begin(115200);
lora.init(GROVE_RX, GROVE_TX);
lora.initP2PMode(866, SF12, BW125, 12, 15, 14);
while (atm.begin() != 0) {
Serial.println("init error");
delay(1000);
}
Serial.println("init success");
}
void loop(void) {
Serial.println(atm.getTimeStamp());
Serial.print(atm.getValue("Speed"));
Serial.println(atm.getUnit("Speed"));
Serial.println(atm.getValue("Dir"));
Serial.print(atm.getValue("Temp"));
Serial.println(atm.getUnit("Temp"));
Serial.print(atm.getValue("Humi"));
Serial.println(atm.getUnit("Humi"));
Serial.print(atm.getValue("Pressure"));
Serial.println(atm.getUnit("Pressure"));
String Data = (String(atm.getValue("Speed")) + "," + String(atm.getValue("Dir")) + "," + String(atm.getValue("Temp")) + "," + String(atm.getValue("Humi")) + "," + String(atm.getValue("Pressure")));
lora.transferPacketP2PMode((char *)Data.c_str());
Serial.println("[Weather data has been sent.]");
delay(2000);
}This sketch will collect the LARK data and transmit it via LoRa communication.
Here is the final receiver sketch which can receive the LoRa E5 weather station data and print it in the serial terminal.
#include <LoRaE5.h>
unsigned char buffer[128] = {0,};
String incomingString;
#define GROVE_TX 43
#define GROVE_RX 44
void setup(void) {
Serial.begin(115200);
lora.init(GROVE_RX, GROVE_TX);
delay(2000);
lora.initP2PMode(866, SF12, BW125, 12, 15, 14);
}
void loop(void) {
short length = 0;
short rssi = 0;
memset(buffer, 0, 128);
length = lora.receivePacketP2PMode(buffer, 128, &rssi, 1);
if (length) {
incomingString = String((char*)buffer);
String Data = incomingString;
Serial.print("Incoming data from weather station : ");
Serial.println(Data);
}
}Here is the final serial terminal response which receives the weather station data and prints it in the serial terminal.
The LoRa E5 Weather Station with Lark and Xiao ESP32 S3 is a powerful combination for anyone looking to set up a remote weather monitoring system. With long-range communication, real-time data processing, and easy visualization, this project is perfect for hobbyists, researchers, and professionals alike. By following these steps, you can build a weather station that is both sophisticated and accessible.












Comments