🎬 ESP32 + ILI9341 GIF Player
A high-performance GIF Player for the ESP32 and 2.8" ILI9341 TFT display, capable of rendering smooth animations directly from an SD card.
Note: I'm new to GitHub — this is my first project, and I hope you find this repo useful and interesting! 😊
(Click the image above to watch the demo video on Instagram)
Overview
This project demonstrates how to decode and display .gif animations from an SD card using the AnimatedGIF library with hardware-accelerated SPI.
It supports full-color playback (16-bit RGB565) and resolutions up to 240×320 pixels.
Features
- Plays GIFs directly from SD card
- Uses AnimatedGIF for optimized decoding
- Smooth playback (~30 FPS depending on SD speed & frame size)
- Compatible with all ESP32 boards
- Accurate color rendering with LITTLE_ENDIAN_PIXELS
- Simple loop playback
Hardware Setup (IC Connections)
Below is the connection reference between ESP32 and 2.8" ILI9341 TFT with built-in SD card.
All components share the same SPI bus, except for chip-select lines.
| 2.8" TFT | ESP32 |
|---|---|
| TFT_CS | 17 |
| TFT_DC | 16 |
| TFT_RST | 5 |
| TFT_LED | 32 |
| TFT_SCK | 18 |
| TFT_MOSI | 23 |
| TFT_MISO | 19 |
| SD_CS | 12 |
| VCC | 3.3V |
| GND | GND |
Note: Most 2.8" ILI9341 modules include an SD card slot connected to the same SPI pins.
You only need to wire SD_CS (GPIO 12) in addition to the shared SPI lines.
Required Libraries
Install these through Arduino Library Manager:
- AnimatedGIF — GIF decoder
- Adafruit_ILI9341 — display driver
- Adafruit_GFX — graphics core
- SD — SD card access
- SPI — SPI communication
SD Card Setup
- Format the SD card as FAT32
- Place your GIFs in the root directory
- Insert SD card and power up ESP32 — it will start playback automatically
