This project demonstrates how to read temperature and humidity data from a DHT22 sensor and display it using LVGL (Light and Versatile Graphics Library). The temperature and humidity data are updated in real-time on a graphical user interface (GUI) running on an embedded system.
- ESP32 development board
- DHT22 sensor
- ILI9341 TFT LCD display
| ILI9341 Pin | ESP32 Pin | Description |
|---|---|---|
| VCC | 3.3V | Power supply |
| GND | GND | Ground |
| CS | GPIO 13 | Chip Select |
| RST | GPIO 12 | Reset |
| DC (RS) | GPIO 14 | Data/Command |
| SDI (MOSI) | GPIO 27 | SPI Master Out Slave In |
| SCK(CLK) | GPIO 26 | SPI Clock |
| LED | 3.3V | Backlight |
| SDO (MISO) | GPIO 25 | SPI Mater In Slave Out |
From your project's root directory:
- Download here: https://github.com/lvgl/lvgl/archive/refs/tags/v8.3.7.zip
- Create a directory named
components(if you don't have one already) withmkdir -p components - Move/copy
lvgl/to/components - Run
idf.py menuconfig, go toComponent configthenLVGL configurationto configure LVGL.
From your project's root directory:
-
Clone the lvgl_esp32_drivers
git clone https://github.com/hiruna/lvgl_esp32_drivers/tree/develop/lvgl_8.3.7_idf_5.2
-
Create a directory named
components(if you don't have one already) withmkdir -p components. -
Move/copy
lvgl_esp32_driversto/components -
Run
idf.py menuconfig, go toComponent configthenLVGL TFT configurationandLVGL TFT Display configurationto configure lvgl_esp32_drivers.
From your project's root directory:
- Download Here: https://components.espressif.com/api/download/?object_type=component&object_id=2446f0b5-72f7-406f-bc51-20baafcde756
- Create a directory named
components(if you don't have one already) withmkdir -p components. - Move/copy am2302_rmt to
/components
-
Build/compile the project
idf.py build
-
If no error exist, flash the program
idf.py flash
https://github.com/xpress-embedo/ESP32/tree/master/ESP-IDF/LVGL_HelloWorld