Weather Monitoring System Using Smart ESP32-S3 Display and LVGL
by Rachana Jain in Circuits > Microcontrollers
86 Views, 1 Favorites, 0 Comments
Weather Monitoring System Using Smart ESP32-S3 Display and LVGL
Want to build your own compact weather station with a modern touchscreen interface? In this project, we'll create a smart weather monitoring system using the ESP32-S3 Smart Display, a BME280 environmental sensor, a rain sensor, and an LDR module.
The device continuously monitors temperature, humidity, atmospheric pressure, altitude, rainfall conditions, and ambient light levels. All information is displayed in real time on a colorful dashboard designed with LVGL.
Besides creating a practical weather station, this project is an excellent opportunity to learn sensor interfacing, ADC measurements, I2C communication, ESP-IDF programming, and graphical user interface development.
Supplies
To build this project, you'll need the following components:
- VIEWE 2.8-inch ESP32-S3 Smart Display
- BME280 sensor module
- Rain sensor module
- LDR sensor module
- Breadboards
- Jumper wires
- USB Type-C cable
Because the ESP32-S3 Smart Display contains both the microcontroller and display, the overall hardware remains compact and requires fewer connections compared to traditional designs.
Features of the Project
This weather station provides several environmental measurements in real time:
- Temperature monitoring
- Humidity measurement
- Atmospheric pressure sensing
- Altitude estimation
- Rain detection
- Day and night indication
- Interactive touchscreen interface
- LVGL graphical dashboard
- ESP-IDF based firmware
Understanding the Sensors
The weather station combines information from three different sensors.
BME280 Sensor
The BME280 measures:
- Temperature
- Relative humidity
- Atmospheric pressure
Using pressure data, the firmware can also estimate altitude.
Rain Sensor
The rain sensor detects water droplets on its conductive surface. The analog voltage changes depending on the amount of moisture present, allowing the ESP32-S3 to determine whether it is raining.
LDR Module
The LDR sensor measures ambient light intensity. The system uses these readings to distinguish between daytime and nighttime conditions.
Circuit Connections
The hardware setup is simple because all sensors are connected directly to the ESP32-S3 Smart Display.
The BME280 sensor uses the I2C interface. Its SDA pin is connected to GPIO9 and its SCL pin is connected to GPIO10. The sensor receives power from the 3.3V output and shares the common ground connection.
The rain sensor operates through its analog output. The AO pin is connected to GPIO7, while the power and ground pins are connected to the 3.3V and GND terminals.
The LDR module is also connected through an analog channel. Its output pin is connected to GPIO6, allowing the ESP32-S3 to measure changes in ambient light intensity.
All sensors share the same 3.3V power supply and common ground, ensuring stable operation and reliable measurements.
How the Weather Station Works
Once powered, the ESP32-S3 continuously gathers data from all sensors.
The BME280 provides temperature, humidity, pressure, and altitude information.
The rain sensor detects moisture levels and indicates rainfall conditions.
The LDR module measures ambient light intensity to determine whether the surroundings correspond to day or night.
The collected data is processed by the ESP32-S3 and presented through an interactive touchscreen dashboard.
Installing the Software
Before uploading the firmware, install the following software:
- Visual Studio Code, v1.116.0 or above.
- ESP-IDF extension in VS Code, v1.11.1 or above.
- ESP-IDF version installed using extension in VS Code, v5.3.5.
- Python installed manually, v3.11.2
The source package already contains the required libraries, including:
- Bosch BME280 library
- LVGL v8.4 port
- Display drivers
For best compatibility, install all software using their default installation paths.
Opening the Project
After extracting the source code package, navigate to:
ESP32_Display_Panel/examples/esp_idf/lvgl_v8_port
Open the folder in Visual Stud
Clean and Build the Project
Before compiling, remove previously generated files such as:
- build
- managed_components
- dependencies.lock
After cleaning, use the ESP-IDF tools to build the project and verify that the ESP32-S3 target and serial port are configured correctly.
Upload the Firmware
Connect the ESP32-S3 Smart Display to the computer using a USB Type-C cable.
Use the Flash option provided by the ESP-IDF extension to upload the firmware.
After programming is completed, the weather dashboard will automatically appear on the display.
Downloads
Understanding the Code Structure
The firmware is divided into two main files.
main.cpp
This file acts as the central controller of the project. It initializes the display, configures the LVGL interface, sets up the sensors, processes measurements, and updates the dashboard with real-time values.
sensors.c
This file contains the sensor handling routines. It reads data from the BME280 sensor, rain sensor, and LDR module and converts raw measurements into useful environmental information.
Separating these functions keeps the code organized and simplifies future modifications.
Dashboard Operation
The LVGL graphics library creates the weather dashboard displayed on the touchscreen.
Labels, icons, and information cards are continuously updated to show:
- Temperature
- Humidity
- Pressure
- Altitude
- Rain status
- Day or night conditions
This provides an intuitive and visually appealing interface compared with serial monitor outputs.
Video
The video demonstration provides a complete overview of the Smart Weather Monitoring System and showcases the operation of the hardware and software in real time.
During the demonstration, different tests are performed to verify the response of each sensor. Water is applied to the rain sensor to simulate rainfall, while varying light conditions are used to demonstrate day and night detection. The BME280 sensor readings are also observed as environmental conditions change.
Final Thoughts
By combining the ESP32-S3 Smart Display with environmental sensors and the LVGL graphics framework, it is possible to build a compact and feature-rich weather station capable of monitoring multiple environmental parameters in real time.
This project demonstrates how embedded systems, sensor technology, and graphical user interfaces can work together to create practical and visually appealing applications.
For source code and detailed code explanation visit: