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

Untitled design (8).png
Untitled design (5).jpg

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:

  1. VIEWE 2.8-inch ESP32-S3 Smart Display
  2. BME280 sensor module
  3. Rain sensor module
  4. LDR sensor module
  5. Breadboards
  6. Jumper wires
  7. 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:

  1. Temperature monitoring
  2. Humidity measurement
  3. Atmospheric pressure sensing
  4. Altitude estimation
  5. Rain detection
  6. Day and night indication
  7. Interactive touchscreen interface
  8. LVGL graphical dashboard
  9. ESP-IDF based firmware

Understanding the Sensors

The weather station combines information from three different sensors.

BME280 Sensor

The BME280 measures:

  1. Temperature
  2. Relative humidity
  3. 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

Weather Monitoring.png

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:

  1. Visual Studio Code, v1.116.0 or above.
  2. ESP-IDF extension in VS Code, v1.11.1 or above.
  3. ESP-IDF version installed using extension in VS Code, v5.3.5.
  4. Python installed manually, v3.11.2

The source package already contains the required libraries, including:

  1. Bosch BME280 library
  2. LVGL v8.4 port
  3. 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:

  1. build
  2. managed_components
  3. 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:

  1. Temperature
  2. Humidity
  3. Pressure
  4. Altitude
  5. Rain status
  6. Day or night conditions

This provides an intuitive and visually appealing interface compared with serial monitor outputs.

Video

Smart Weather Monitoring System Demonstration

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:

https://playwithcircuit.com/how-to-build-a-weather-monitoring-system-using-esp32-s3-smart-display-and-lvgl/