This project uses an ESP32 microcontroller to create a vehicle gauge and displaying the information on a GC9A01 TFT display using the LVGL library.
- ESP32 Development Board
- GC9A01 TFT Display
- Voltage Divider (for measuring battery voltage)
- Temperature Sensor (e.g., LM35, DS18B20, etc.)
- Connecting Wires
- Power Supply
- VCC -> 3.3V (ESP32)
- GND -> GND (ESP32)
- CS -> GPIO 22 (ESP32)
- SDI(MOSI)/DC -> GPIO 16 (ESP32)
- SCK -> GPIO 18 (ESP32)
- RESET -> GPIO 4 (ESP32)
- SDO(MISO) -> Not Connected
- BL -> Not Connected
-
Voltage Divider:
- Connect the positive end to the battery.
- Connect the divided voltage output to GPIO 34 (ESP32).
- Connect the ground end to GND (ESP32).
-
Temperature Sensor (e.g., LM35):
- VCC -> 3.3V (ESP32)
- GND -> GND (ESP32)
- Output -> GPIO 35 (ESP32)
- Download and install PlatformIO as an extension in Visual Studio Code or other compatible IDEs.
Install the following libraries using PlatformIO:
lvgl
TFT_eSPI
Edit the include/User_Setup.h
file. Copy the content of the provided User_Setup.h
into your setup file.
Edit the main.cpp
file as you prefer.