Steve Zafeiriou (b. 1998, Thessaloniki, GR) is a New Media Artist, Technologist, and Founder of Saphire Labs. His practice investigates how technology can influence, shape, and occasionally distort the ways individuals perceive the external world. By employing generative algorithms, electronic circuits, and interactive installations, he examines human behavior in relation to the illusory qualities of perceived reality, inviting observers to reconsider their assumptions and interpretations.

In search of IKIGAI
dark mode light mode Search Menu
LilyGo T-Display S3 ESP32 Projects: LilyGo T-Display S3 ESP32 displaying a cryptocurrency ticker with live prices for ETH, ENS, and BTC in USD.

9 Exciting LilyGo T-Display S3 ESP32 Projects to Try in 2025

Table of Contents Hide
  1. Getting Started with the LilyGo T-Display S3 ESP32
    1. Overview of the LilyGo T-Display S3 ESP32 Features
    2. Setting Up Your Development Environment for the LilyGo T-Display S3
    3. Installing Libraries for the T-Display S3
    4. Tips for beginners: Power management, display configurations, and debugging tools
  2. Project 1: Motion Capture Controller
    1. Key Features:
    2. How It Works
    3. Applications
  3. Project 2: IoT Weather Station
    1. Displaying Weather Data
    2. Enhancing Your IoT Weather Station with the DHT22 Sensor
  4. Project 3: Smart Home Control Panel
    1. Control Smart Home Devices Like Lights, Fans, and Cameras
    2. Create a Touchscreen Interface for Device Toggles and Status Updates
    3. Integrate with Home Assistant and MQTT
  5. Project 4: Portable Digital Clock
    1. Build a Customizable Digital Clock
    2. Experiment with Animations and Formats
  6. Project 5: Mini Retro Gaming Console
    1. Transform the T-Display S3 into a Gaming Device
    2. Program Classic Games Like Tetris
    3. Optimizing Performance for ESP32 Hardware
  7. Project 6: Bluetooth Music Visualizer
    1. Use Bluetooth to Sync with Audio Devices
    2. Display Real-Time Music Visualizations on the Screen
    3. Customize Graphics for Different Sound Frequencies
  8. Project 7: Plant Monitoring System
    1. Monitor Soil Moisture and Light Levels
    2. Display Plant Health Stats
    3. Send Alerts When Attention is Needed
  9. Project 8: Portable Network Scanner
    1. Scan Wi-Fi Networks and Signal Strengths
    2. Display Network Details on the LilyGo T-Display S3
    3. Add Advanced Features
  10. Project 9: ESP32-Powered Cryptocurrency Ticker
    1. Fetch Live Cryptocurrency Data Using APIs
    2. Display Cryptocurrency Prices
    3. Customize the UI
  11. Conclusion
  12. Frequently Asked Questions (FAQ)
    1. What microcontroller does the LilyGo T-Display S3 use?
    2. What are the specifications of the built-in display?
    3. Which programming platforms are compatible with the T-Display S3?
    4. How can I power and program the T-Display S3?
    5. Where can I find technical support and resources for the T-Display S3?

The LilyGo T-Display S3 ESP32 is a versatile platform for developers and hobbyists. Its compact design, integrated display, and powerful ESP32-S3 chip make it suitable for various applications, including IoT development, robotics, and creative technology.

As a new media artist and technologist, the LilyGo T-Display S3 is my preferred ESP32 development board for building interactive sculptures and art installations.

In this article, I’ll share the basics, setup and I’ll share 8 engaging LilyGo T-Display S3 esp32 projects designed to showcase the capabilities of this board.

Whether you’re exploring smart home automation, creating portable devices, or experimenting with dynamic text displays..

This board has the flexibility to bring your concepts to life.

Let’s get started!

Algorithmic Art Tools: ESP32 Microcontroller

Getting Started with the LilyGo T-Display S3 ESP32

The LilyGo T-Display S3 ESP32 is an open-source platform for creating ESP32 projects, and, I especially use it for digital art and interactive installations.

Whether you’re working on IoT development or building an art piece, this board is an excellent starting point.

Find the 14 best microcontrollers for interactive art installations!

Geovision Data sculpture on it's base, developed using an esp32
Geovision Data sculpture on it’s base, developed using an esp32

Overview of the LilyGo T-Display S3 ESP32 Features

The LilyGo T-Display S3 combines functionality with simplicity, making it an ideal choice for:

  • Smart home automation,
  • DIY retro gaming consoles,
  • or even dynamic text displays..

Here’s what makes this board so effective:

  1. ESP32-S3 Chip: A powerful dual-core processor acting as the core for ESP32 programming tips and advanced applications.
  2. Built-In 1.14” Display: A vibrant TFT screen (or amoled), perfect for digital clock DIY, stock ticker ESP32, or other microcontroller displays.
  3. Wi-Fi and Bluetooth Connectivity: Ideal for IoT development like a plant monitoring system or a Bluetooth music visualizer.
  4. Versatile I/O Pins: Suitable for connecting sensors such as the DHT22 sensor for weather stations or tools for ESP32 wearable tech.
  5. Low Power Consumption: Efficient for battery-operated projects, such as portable ESP32 devices or ESP32 power management solutions.

Looking for more details?

Explore my guide on setting up the LilyGo T-Display S3 or ESP32 pinout to unlock the full potential of this board or read my comparision on ESP32 vs ESP8266 development boards.

ESP32 Web Server: Install Arduino IDE
LilyGo T-Display S3 ESP32 Projects: Install Arduino IDE

Setting Up Your Development Environment for the LilyGo T-Display S3

To maximize the potential of the LilyGo T-Display S3, it’s essential to prepare your development environment.

Two widely-used tools for ESP32 programming are the Arduino IDE and PlatformIO.

Here’s how to get started:

Arduino IDE

  1. Download the Software: Get the Arduino IDE from the official Arduino website.
  2. Add ESP32 Support:
    1. Open File > Preferences > Additional Boards Manager URLs.
    2. Add this URL: https://dl.espressif.com/dl/package_esp32_index.json.
  3. Install the ESP32 Board:
    1. Go to Tools > Board > Boards Manager.
    2. Search for “ESP32” and click Install.
Automated Gardening System: NodeJS and React project structure
LilyGo T-Display S3 ESP32 Projects: Use PlatformIO

PlatformIO

  1. Install VS Code: Download and install Visual Studio Code.
  2. Add PlatformIO:
    1. Open VS Code.
    2. Go to Extensions and search for PlatformIO IDE. Install the extension.
  3. Create a New Project:
    1. Launch PlatformIO and set up a new project.
    2. Select LilyGo T-Display S3 as your board.

Installing Libraries for the T-Display S3

Libraries simplify development, providing pre-built functions for essential tasks.

To get the most out of the T-Display S3, install the following libraries:

  1. TFT_eSPI: Enables control of the built-in display.
    1. In the Arduino IDE, navigate to Sketch > Include Library > Manage Libraries and search for “TFT_eSPI” to install.
  2. Adafruit GFX: Assists with graphics, such as drawing shapes and text. Install it using the same steps as above.

For detailed configuration, refer to the TFT_eSPI library setup instructions.

This is important to make your LilyGo T-display setup work correctly!

If you’re new to Microcontrollers, start with my guide on arduino programming language!

esp32 soil moisture sensor webserver setup infographic
LilyGo T-Display S3 ESP32 Projects: esp32 soil moisture sensor webserver setup infographic

Tips for beginners: Power management, display configurations, and debugging tools

Power Management

Efficient power usage is key for battery-based projects. Use ESP32 sleep modes to extend battery life.

The T-Display S3 can be powered via USB or a LiPo battery, making it suitable for portable ESP32 projects like a wearable tech device or smart badge tutorials.

LilyGO T-Display S3 microcontroller setup with wiring and screen interface, ideal for IoT and display-based projects, from Steve Zafeiriou’s resources.

Display Configurations

Customize your display settings for the best visual output. Below is a simple example using the TFT_eSPI library:

#include <TFT_eSPI.h>
TFT_eSPI tft = TFT_eSPI();
void setup() {
  // Turn on display power
  pinMode(DISPLAY_POWER_PIN, OUTPUT);
  digitalWrite(15, HIGH);
  delay(500);

  // Initialize display
  tft.init();
  tft.setRotation(4); // Portrait mode
  tft.fillScreen(TFT_BLACK);


  tft.fillScreen(TFT_BLACK);
  tft.setTextColor(TFT_WHITE);
  tft.setTextSize(2);
  tft.drawString("Hello, World!", 10, 10);
}

void loop() {
  // Your display updates here
}

Debugging Tools

Debugging is critical for resolving issues efficiently.

Use the Serial Monitor in both the Arduino IDE and PlatformIO for real-time performance tracking.

These tools allow you to identify errors and optimize your ESP32 coding process.

The Importance of Life, Interactive Art Installation Design sketch by Steve Zafeiriou 2024
LilyGo T-Display S3 ESP32 Projects: The Importance of Life, Interactive Art Installation Design sketch by Steve Zafeiriou 2025

Project 1: Motion Capture Controller

This project transforms the LilyGo T-Display S3 into a real-time motion capture device that streams movement data to applications like TouchDesigner, React apps, or any WebSocket client.

By leveraging the ESP32-S3’s built-in Wi-Fi and an MPU6050 gyroscope, this system offers an affordable alternative to high-end motion capture setups.

Sensor Data to Touchdesigner: Custom-built motion capture system designed for real-time data processing and visualization in TouchDesigner, ideal for interactive media and digital art projects.

Key Features:

  1. Real-Time Motion Tracking: Captures 3-axis acceleration & gyroscopic movement.
  2. Wireless Data Streaming: Uses WebSockets for seamless integration with visual tools.
  3. On-Device Debugging: The LilyGo’s integrated display allows direct sensor feedback.
  4. Haptic Feedback: A vibration motor provides tactile response for interactive projects.
  5. Portable Design: Runs on a 1200mAh LiPo battery, making it fully wireless.
Sensor Data to Touchdesigner: Steve Zafeiriou, presenting the DIY motion capture controller. Tranferring real-time data to Touchdesigner and controlling a 3D model.

How It Works

The MPU6050 sensor gathers movement data, which is processed by the ESP32.

After calibration and filtering, the motion data is sent via Wi-Fi to a Node.js WebSocket server.

From there, multiple clients—like TouchDesigner or React apps—can receive and visualize the data in real time.

Read the full guide and find a tutorial video on building a motion capture controller.

Applications

  1. DIY Robotics & Game Input: Apply this system as a custom motion controller.
  2. Live Visuals & Interactive Art: Integrate movement data into generative visuals.
  3. VR Controllers & Gesture Recognition: Use motion tracking for immersive applications.

Project 2: IoT Weather Station

Creating an IoT weather station with the LilyGo T-Display S3 ESP32 is an exciting way to merge technology with creativity.

Leveraging the ESP32’s built-in display and wireless connectivity, this project brings weather data to life in an interactive and visually appealing way.

ESP32-powered master unit featuring a live climate monitoring dashboard with data on soil moisture, temperature, humidity, and pH levels, designed for an IoT irrigation system as part of an interactive art installation
LilyGo T-Display S3 ESP32 Projects: ESP32-powered master unit featuring a live climate monitoring dashboard with data on soil moisture, temperature, humidity, and pH levels, designed for an IoT irrigation system as part of an interactive art installation

Displaying Weather Data

The built-in display on the LilyGo T-Display S3 serves as the perfect interface for showcasing live weather updates.

With the help of libraries like TFT_eSPI, you can present key metrics such as:

  1. Temperature: Display readings in Celsius or Fahrenheit based on your preference.
  2. Humidity: Monitor ambient air moisture levels.
  3. Soil Moisture: Monitor the soil moisture levels and keep your plants hydrated.
  4. Weather Updates: Show daily or hourly forecasts using APIs like OpenWeatherMap API.

By customizing the microcontroller display, you transform a basic weather station into an engaging and functional piece of technology.

Read my full guide on implementing a DHT22 Temperature and Humidity Sensor or how to implement a capacitive soil moisture sensor with lilygo t-display s3

Setting Up the Interface

Use the TFT_eSPI library to design a user-friendly interface.

Here’s a simple code snippet to get you started:

#include <WiFi.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>
#include <TFT_eSPI.h>

// Wi-Fi credentials
const char* ssid = "your_wifi_ssid";
const char* password = "your_wifi_password";

// OpenWeatherMap API details
const char* apiKey = "your_api_key";
const char* city = "your_city";
String apiUrl = "http://api.openweathermap.org/data/2.5/weather?q=" + String(city) + "&appid=" + String(apiKey) + "&units=metric"; // Metric units for temperature in Celsius

// Initialize display
TFT_eSPI tft = TFT_eSPI();

void setup() {
  // Initialize Serial for debugging
  Serial.begin(115200);

  // Turn on display power
  pinMode(DISPLAY_POWER_PIN, OUTPUT);
  digitalWrite(DISPLAY_POWER_PIN, HIGH);
  delay(500);

  // Initialize display
  tft.init();
  tft.setRotation(4); // Portrait mode
  tft.fillScreen(TFT_BLACK);

  tft.fillScreen(TFT_BLACK);
  tft.setTextColor(TFT_WHITE);
  tft.setTextSize(2);
  tft.drawString("Connecting to Wi-Fi", 10, 10);

  // Connect to Wi-Fi
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("\nWi-Fi connected!");

  // Clear display and show connection status
  tft.fillScreen(TFT_BLACK);
  tft.drawString("Wi-Fi Connected", 10, 10);

  // Fetch and display weather data
  fetchAndDisplayWeatherData();
}

void loop() {
  // Update weather data every 10 minutes
  fetchAndDisplayWeatherData();
  delay(600000); // 10 minutes
}

void fetchAndDisplayWeatherData() {
  if (WiFi.status() == WL_CONNECTED) {
    HTTPClient http;
    http.begin(apiUrl);
    int httpResponseCode = http.GET();

    if (httpResponseCode > 0) {
      String payload = http.getString();
      Serial.println(payload);

      // Parse JSON response
      DynamicJsonDocument doc(1024);
      DeserializationError error = deserializeJson(doc, payload);
      if (error) {
        Serial.print("JSON parsing error: ");
        Serial.println(error.c_str());
        return;
      }

      // Extract weather data
      float temperature = doc["main"]["temp"];
      float humidity = doc["main"]["humidity"];
      String weatherDescription = doc["weather"][0]["description"];

      // Display data on screen
      tft.fillScreen(TFT_BLACK);
      tft.drawString("City: " + String(city), 10, 10);
      tft.drawString("Temp: " + String(temperature) + " C", 10, 30);
      tft.drawString("Humidity: " + String(humidity) + " %", 10, 50);
      tft.drawString("Weather: " + weatherDescription, 10, 70);

    } else {
      Serial.print("HTTP error code: ");
      Serial.println(httpResponseCode);
    }

    http.end();
  } else {
    Serial.println("Wi-Fi disconnected!");
    tft.fillScreen(TFT_BLACK);
    tft.drawString("Wi-Fi Disconnected", 10, 10);
  }
}

This project demonstrates the versatility of the LilyGo T-Display S3 ESP32.

Whether for personal use or as a part of a larger smart home automation system, this weather station is a great starting point for exploring ESP32 projects.

Read my guide on automated gardening system to explore how you can develop custom user interfaces for the TFT display!

Best Sensors for Interactive Art: high-sensitivity temperature and humidity sensor with single-bus digital signal output, offering precise temperature measurement (-40 to 80°C, accuracy ±0.5°C) and humidity measurement (0-100% RH, accuracy ±2% RH).
LilyGo T-Display S3 ESP32 Projects: The Importance of Life, Interactive Art Installation Design sketch by Steve Zafeiriou 2025

Enhancing Your IoT Weather Station with the DHT22 Sensor

To improve accuracy in monitoring temperature and humidity, integrate a DHT22 sensor into your LilyGo T-Display S3 ESP32 weather station.

This sensor complements your IoT setup by providing real-time, local environmental data.

Connect the DHT22 sensor to your ESP32 as follows:

ESP32 PinDHT22 Pin
3.3VVCC
GNDGND
GPIO 4Data
LilyGo T-Display S3 ESP32 Projects

Install the DHT sensor library to handle the sensor readings efficiently.

In the Arduino IDE:

  1. Go to Sketch > Include Library > Manage Libraries.
  2. Search for “DHT sensor library” and install it.

Here’s the code to integrate the DHT22 sensor with your ESP32 weather station:

#include <DHT.h>
#include <TFT_eSPI.h>

// Define DHT22 settings
#define DHTPIN 4 // GPIO pin connected to DHT22
#define DHTTYPE DHT22

// Initialize DHT and display
DHT dht(DHTPIN, DHTTYPE);
TFT_eSPI tft = TFT_eSPI();

void setup() {
  // Initialize Serial for debugging
  Serial.begin(115200);

  // Initialize DHT sensor
  dht.begin();

  // Initialize display
  tft.init();
  tft.setRotation(1);
  tft.fillScreen(TFT_BLACK);
  tft.setTextColor(TFT_WHITE);
  tft.setTextSize(2);
  tft.drawString("Weather Station", 10, 10);
}

void loop() {
  // Read data from DHT22 sensor
  float localTemperature = dht.readTemperature();
  float localHumidity = dht.readHumidity();

  // Check if readings are valid
  if (isnan(localTemperature) || isnan(localHumidity)) {
    Serial.println("Failed to read from DHT sensor!");
    tft.fillScreen(TFT_BLACK);
    tft.drawString("Sensor Error", 10, 10);
    delay(2000);
    return;
  }

  // Display data on Serial Monitor
  Serial.print("Temperature: ");
  Serial.print(localTemperature);
  Serial.print("°C ");
  Serial.print("Humidity: ");
  Serial.print(localHumidity);
  Serial.println("%");

  // Update display
  tft.fillScreen(TFT_BLACK);
  tft.drawString("Local Data:", 10, 10);
  tft.drawString("Temp: " + String(localTemperature) + "°C", 10, 30);
  tft.drawString("Humidity: " + String(localHumidity) + "%", 10, 50);

  // Update every 2 seconds
  delay(2000);
}

With the addition of the DHT22 sensor, your IoT weather station becomes a robust tool for tracking both real-time environmental changes and external weather updates.

Project 3: Smart Home Control Panel

With its built-in display and robust ESP32 microcontroller, this project is a perfect addition to any smart home ecosystem.

Close-up of a 3D printer in action, producing components for an interactive data sculpture by Steve Zafeiriou, showcasing the integration of technology and art through 3D printing for tactile data visualization projects.
LilyGo T-Display S3 ESP32 Projects: 3D printer in action, producing components for an interactive data sculpture by Steve Zafeiriou, showcasing the integration of technology and art through 3D printing for tactile data visualization projects.

Control Smart Home Devices Like Lights, Fans, and Cameras

With the ESP32 microcontroller, I can efficiently manage devices like lights, fans, and cameras.

By connecting these to relays or smart switches, the ESP32 acts as a central controller, executing commands to toggle devices on and off.

Device Control Methods:

DeviceControl Method
LightsRelay Module
FansSmart Switch
CamerasIP Commands
LilyGo T-Display S3 ESP32 Projects

Create a Touchscreen Interface for Device Toggles and Status Updates

The T-Display S3’s touchscreen makes interacting with smart devices intuitive and efficient.

By designing a user-friendly interface, I can toggle devices on or off and monitor their statuses in real time.

Integrate with Home Assistant and MQTT

To unify control and automation, the setup integrates with Home Assistant and MQTT.

Steps to Integrate with Home Assistant via MQTT:

  1. Set Up an MQTT Broker: Use a broker like Mosquitto to enable communication between devices.
  2. Configure Home Assistant: Add MQTT integration and define topics for each device in the Home Assistant dashboard.
  3. Program the ESP32: Use the PubSubClient library to connect the ESP32 to the MQTT broker and enable it to send/receive commands.

Here’s a sample code snippet to connect the ESP32 to an MQTT broker:

#include <WiFi.h>
#include <PubSubClient.h>

// Wi-Fi credentials
const char* ssid = "your_SSID";
const char* password = "your_PASSWORD";

// MQTT credentials
const char* mqtt_server = "your_MQTT_SERVER";
WiFiClient espClient;
PubSubClient client(espClient);

void setup() {
  // Connect to Wi-Fi
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
  }
  Serial.println("Wi-Fi connected!");

  // Connect to MQTT broker
  client.setServer(mqtt_server, 1883);
  while (!client.connected()) {
    if (client.connect("ESP32Client")) {
      Serial.println("Connected to MQTT broker");
    } else {
      delay(1000);
    }
  }
}

void loop() {
  client.loop();
}

// Publish device states
void publishState(const char* topic, const char* state) {
  client.publish(topic, state);
}

With the LilyGo T-Display S3, this smart home control panel offers an elegant and efficient solution for managing connected devices.

Project Moon Phase Clock displayed on a LilyGo T-Display S3 ESP32 board, created by @nishad2m8.
LilyGo T-Display S3 ESP32 Projects: Project Moon Phase Clock displayed on a LilyGo T-Display S3 ESP32 board, created by @nishad2m8.

Project 4: Portable Digital Clock

Why settle for basic when you can build a portable digital clock powered by the LilyGo T-Display S3 ESP32?

This project uses Wi-Fi to fetch accurate time from online servers, making it modern, minimalist, and perfect for on-the-go use.

Build a Customizable Digital Clock

The T-Display S3 ESP32 handles everything — from fetching the time to displaying it with style.

Its integrated Wi-Fi eliminates the need for additional hardware like RTC modules.

Materials You’ll Need

  1. LilyGo T-Display S3 ESP32
  2. A rechargeable Li-Po or Li-ion battery (e.g., 3.7V 1200mAh)
  3. A Real-Time Clock (RTC) module (e.g., DS3231)
  4. USB cable for programming and charging
  5. Enclosure for portability (3d print it!)

Steps to Get Started

  1. Connect the ESP32 to Wi-Fi for real-time clock (RTC) data.
  2. Program the ESP32 to fetch time from an NTP (Network Time Protocol) server.
  3. Create a stylish clock interface using the Squareline Studio.

Use Wi-Fi for Time Sync

By using the ESP32’s built-in Wi-Fi, the clock can fetch accurate time from NTP servers.

This eliminates the need for an external RTC module.

Example code for fetching time:

#include <WiFi.h>
#include "time.h"
#include <LovyanGFX.hpp>

// Wi-Fi credentials
const char* ssid = "your_SSID";
const char* password = "your_PASSWORD";

// NTP server details
const char* ntpServer = "pool.ntp.org";
const long gmtOffset_sec = 0; // Adjust for your timezone
const int daylightOffset_sec = 3600;

// Initialize display
LGFX display;

void setup() {
  Serial.begin(115200);

  // Initialize display
  display.init();
  display.setRotation(1);
  display.fillScreen(TFT_BLACK);
  display.setTextSize(2);
  
  // Connect to Wi-Fi
  display.setCursor(10, 10);
  display.print("Connecting to Wi-Fi...");
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    display.print(".");
  }
  display.fillScreen(TFT_BLACK);
  display.print("Connected!");

  // Initialize NTP
  configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
}

void loop() {
  // Get current time
  struct tm timeinfo;
  if (!getLocalTime(&timeinfo)) {
    display.fillScreen(TFT_BLACK);
    display.setCursor(10, 10);
    display.print("Failed to obtain time");
    delay(1000);
    return;
  }

  // Display time on screen
  display.fillScreen(TFT_BLACK);
  display.setCursor(10, 20);
  display.printf("%02d:%02d:%02d", timeinfo.tm_hour, timeinfo.tm_min, timeinfo.tm_sec);

  delay(1000); // Refresh every second
}

Add Battery-Powered Portability

To make the clock portable, connect a rechargeable 3.7V Li-Po battery to the board’s built-in charging circuit.

This ensures the clock remains functional even when unplugged:

  1. Battery Life: 8-10 hours (with a 1200mAh battery)
  2. Charging Time: 2-3 hours via USB-C

Experiment with Animations and Formats

With the T-Display S3, you can add eye-catching animations and customize time formats.

Whether you prefer a digital flip clock or moving text, the possibilities are endless.

Example code for flip clock animation:

#include <WiFi.h>
#include "time.h"
#include <LovyanGFX.hpp>

// Wi-Fi credentials
const char* ssid = "your_SSID";
const char* password = "your_PASSWORD";

// NTP server
const char* ntpServer = "pool.ntp.org";
const long gmtOffset_sec = 0;
const int daylightOffset_sec = 3600;

// Display
LGFX display;

void setup() {
  Serial.begin(115200);

  // Initialize display
  display.init();
  display.setRotation(1);
  display.fillScreen(TFT_BLACK);

  // Connect to Wi-Fi
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
  }

  // Initialize NTP
  configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
}

void loop() {
  // Get time
  struct tm timeinfo;
  if (!getLocalTime(&timeinfo)) {
    return;
  }

  // Simulate a flip clock effect
  display.fillRect(0, 0, display.width(), display.height(), TFT_BLACK);
  display.setCursor(10, 20);
  display.setTextSize(3);
  display.printf("%02d:%02d", timeinfo.tm_hour, timeinfo.tm_min);

  delay(1000);
}

This portable digital clock, powered by the LilyGo T-Display S3 ESP32, is a showcase of smart design and functionality.

By leveraging Wi-Fi for time synchronization, you eliminate the need for external modules, making the project compact and efficient.

Add your flair with animations, styles, and custom formats to make this clock uniquely yours.


 LilyGo T-Display S3 ESP32 Projects: 
 LilyGo T-Display S3 ESP32 displaying a cryptocurrency ticker with live prices for ETH, ENS, and BTC in USD.
LilyGo T-Display S3 ESP32 Projects: Tetris game running on a LilyGo T-Display S3 ESP32, showcasing its gaming capabilities.

Project 5: Mini Retro Gaming Console

Turn your LilyGo T-Display S3 ESP32 into a retro gaming console by using its built-in buttons and display.

With no additional hardware needed, this project is streamlined for maximum creativity and fun.

Let’s code a simple Snake game and make your console fully functional.

Transform the T-Display S3 into a Gaming Device

The T-Display S3 comes with integrated buttons and a high-quality display, making it an ideal platform for creating a compact gaming console.

The onboard buttons are used for controls, while the built-in display handles smooth game rendering.

Materials You’ll Need

  1. LilyGo T-Display S3 ESP32
  2. Arduino IDE or PlatformIO

For setup instructions, refer to my guide on Setting up your development environment.

LilyGO microcontroller board with completed wiring and connections, ready for deployment in IoT or robotics projects, as presented by Steve Zafeiriou.

Program Classic Games Like Tetris

Using the built-in buttons for control, here’s a fully functional Tetris game.

It features:

  1. Left button: Move pieces left.
  2. Right button: Move pieces right.
  3. Full-screen rendering: Smooth and flicker-free graphics using sprites.

Tetris Game Code:

#include <TFT_eSPI.h> // Graphics library for LilyGo T-Display

#define DISPLAY_POWER_PIN 15   // Pin to control display power
#define LEFT_BUTTON_PIN 0      // Pin for left button
#define RIGHT_BUTTON_PIN 14    // Pin for right button

TFT_eSPI tft = TFT_eSPI();       // Initialize display
TFT_eSprite sprite = TFT_eSprite(&tft); // Create sprite for smooth rendering

// Tetris grid size (in blocks)
const int gridWidth = 10;
const int gridHeight = 20;
const int blockSize = 16; // Block size in pixels
int grid[gridHeight][gridWidth] = {0}; // Tetris grid: 0 = empty, 1 = filled

// Tetrimino definitions
int currentTetrimino[4][4] = {0};
int currentX = 3, currentY = 0; // Initial position of the tetrimino
int speed = 300;                // Game speed in milliseconds

int tetriminos[7][4][4] = {
    {{1, 1, 1, 1}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, // I piece
    {{1, 1, 1, 0}, {1, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, // J piece
    {{1, 1, 1, 0}, {0, 0, 1, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, // L piece
    {{1, 1, 0, 0}, {1, 1, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, // O piece
    {{0, 1, 1, 0}, {1, 1, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, // S piece
    {{1, 1, 1, 0}, {0, 1, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, // T piece
    {{1, 1, 0, 0}, {0, 1, 1, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, // Z piece
};

void setup() {
    Serial.begin(115200);

    // Turn on display power
    pinMode(DISPLAY_POWER_PIN, OUTPUT);
    digitalWrite(DISPLAY_POWER_PIN, HIGH);
    delay(500);

    // Initialize display
    tft.init();
    tft.setRotation(4); // Portrait mode
    tft.fillScreen(TFT_BLACK);

    // Initialize sprite
    sprite.setColorDepth(8);
    sprite.createSprite(320, 320);

    // Initialize buttons
    pinMode(LEFT_BUTTON_PIN, INPUT_PULLUP);
    pinMode(RIGHT_BUTTON_PIN, INPUT_PULLUP);

    // Spawn the first Tetrimino
    spawnTetrimino();
}

void loop() {
    // Move piece down
    static unsigned long lastMoveTime = 0;
    if (millis() - lastMoveTime > speed) {
        if (canMove(0, 1)) {
            currentY++;
        } else {
            lockTetrimino();
            clearRows();
            spawnTetrimino();
        }
        lastMoveTime = millis();
    }

    // Handle button presses
    if (digitalRead(LEFT_BUTTON_PIN) == LOW) {
        if (canMove(-1, 0)) currentX--; // Move left
        delay(150);
    }
    if (digitalRead(RIGHT_BUTTON_PIN) == LOW) {
        if (canMove(1, 0)) currentX++; // Move right
        delay(150);
    }

    // Render the grid
    renderGrid();
}

// Additional helper functions for game mechanics: spawnTetrimino(), canMove(), lockTetrimino(), clearRows(), renderGrid(), and gameOver() (refer to full code in the previous example)

This Tetris game showcases the potential of the LilyGo T-Display S3 ESP32 as a compact retro gaming console.

Optimizing Performance for ESP32 Hardware

To make your games run seamlessly on the ESP32, optimizing performance is essential.

The LilyGo T-Display S3 ESP32 offers powerful hardware, but efficient use of its resources is key to ensuring smooth gameplay.

Here’s how you can enhance performance:

Efficient Drawing with Sprites:

  1. Avoid Redrawing the Entire Screen: Use sprites to render your graphics off-screen and update only the parts of the display that change. This minimizes flicker and reduces the workload on the display driver.
  2. Optimize Rendering Logic: For example, only redraw moving pieces (like Tetrimino blocks) rather than the entire game grid.

Memory Management:

  1. Efficient Use of Sprites: Allocate memory for your sprites carefully. Use the setColorDepth() method to reduce color depth when high resolution isn’t needed.
  2. Minimize Dynamic Allocation: Pre-allocate arrays for game elements like the grid and Tetriminos to avoid memory fragmentation.

Power Management:

  1. Dim the Screen When Idle: Use the TFT_eSPI library to lower the brightness of the screen after a period of inactivity.
  2. Sleep Modes: Implement sleep or deep-sleep modes when the console is idle to conserve battery power.

Here’s a breakdown of ESP32 variants and optimization techniques:

ESP32 SeriesRAM (KB)Performance Tips
ESP32-S3512Use sprites for efficient drawing.
ESP32520Cache frequently used data assets.
ESP32-C3400Optimize loops and conditionals for speed.
LilyGo T-Display S3 ESP32 Projects

By focusing on efficient rendering, careful memory management, and power-saving techniques, you can create a smooth and responsive gaming experience on the LilyGo T-Display S3 ESP32.

Project 6: Bluetooth Music Visualizer

Transform your music into a stunning visual experience using the LilyGo T-Display S3 ESP32.

By combining Bluetooth connectivity and creative visualizations, you can bring sound waves to life on the built-in display.

Use Bluetooth to Sync with Audio Devices

The ESP32 acts as a bridge between your audio device and the visualizer.

With its built-in Bluetooth functionality, it can easily pair with devices like smartphones, laptops, or music players.

  1. Bluetooth Pairing: Pair the ESP32 with your audio device using available libraries, such as BluetoothSerial. This creates a seamless connection to receive audio data or commands.
  2. Streaming Audio Data: The ESP32 processes sound data from the paired device, enabling real-time visual output on the display.

Display Real-Time Music Visualizations on the Screen

Once connected, the ESP32 captures and processes audio signals, creating vibrant, real-time visual effects on the LilyGo T-Display S3.

  1. Audio Processing: Sound signals are analyzed and broken down into frequency bands using techniques like Fast Fourier Transform (FFT).
  2. Visualization: The processed data is translated into graphical elements—dynamic shapes, colors, and animations that represent the music’s frequency and intensity.

Customize Graphics for Different Sound Frequencies

Make your visualizer truly unique by tailoring the visuals to match specific frequency ranges:

  1. Color Bands: Assign different colors to low, mid, and high frequencies. For example, blue for bass, green for mids, and red for treble.
  2. Dynamic Shapes: Use a variety of shapes such as bars, waves, or circles to enhance the visual appeal.

Example Frequency Mapping:

Frequency RangeVisual Effect
20Hz – 200HzBlue-colored visuals
200Hz – 2kHzGreen-colored visuals
2kHz – 20kHzRed-colored visuals
LilyGo T-Display S3 ESP32 Projects

With the LilyGo T-Display S3 ESP32, you can create a Bluetooth music visualizer that combines technology and art.

Take this concept further by transforming frequency analysis into a tool for creating generative art.

By interpreting sound data as visual input, you can design dynamic and evolving art pieces that respond to music or ambient sound.

Customize your graphics, experiment with shapes and colors, and bring your favorite tunes to life!

esp32 soil moisture sensor with lilygo t-display s3 with custom user interface measuring real-time data on a plant
LilyGo T-Display S3 ESP32 Projects: esp32 soil moisture sensor with lilygo t-display s3 with custom user interface measuring real-time data on a plant

Project 7: Plant Monitoring System

Transform the LilyGo T-Display S3 ESP32 into a smart plant monitoring system that tracks soil moisture and light levels, displays vital stats, and alerts you when your plants need attention.

This project combines technology and nature, making it perfect for anyone managing their garden or interactive art installations.

Monitor Soil Moisture and Light Levels

Using the ESP32’s analog pins and GPIOs, you can connect a soil moisture sensor and a light sensor (e.g., BH1750) to monitor your plants’ environment in real time.

The ESP32 processes the sensor data and provides actionable insights into your plants’ health.

Materials You’ll Need

  1. LilyGo T-Display S3 ESP32
  2. Soil moisture sensor
  3. Light sensor (e.g., BH1750)
  4. Breadboard and jumper wires
  5. 3.3V power source or battery

Display Plant Health Stats

Transform the LilyGo T-Display S3 ESP32 into a smart plant monitoring system that tracks soil moisture and light levels, displays vital stats, and alerts you when your plants need attention.

This project combines technology and nature, making it perfect for anyone managing their garden or interactive art installations.

esp32 soil moisture sensor with lilygo t-display s3 with custom user interface

Monitor Soil Moisture and Light Levels

Using the ESP32’s analog pins and GPIOs, you can connect a soil moisture sensor and a light sensor (e.g., BH1750) to monitor your plants’ environment in real time.

The ESP32 processes the sensor data and provides actionable insights into your plants’ health.

Display Plant Health Stats

The TFT screen on the T-Display S3 allows you to create a clear, user-friendly interface to show plant health stats such as soil moisture levels and ambient light intensity.

By using graphical elements like text and shapes, you can easily visualize the condition of your plants at a glance.

Key Features

  1. Real-Time Data: Continuously updates soil moisture and light readings.
  2. User-Friendly Design: Displays data in an organized and readable format.

Send Alerts When Attention is Needed

Keep your plants thriving with a notification system that sends alerts to your phone when conditions require attention.

By connecting the ESP32 to Wi-Fi and using platforms like Blynk, you can receive notifications for low soil moisture or insufficient light levels.

Notification Workflow

  1. Monitor Conditions: Continuously check sensor readings.
  2. Trigger Alerts: Send notifications when thresholds are crossed.
  3. Stay Connected: Use Wi-Fi to communicate with your phone or other smart devices.

For more innovative and practical ESP32 projects, explore my curated list of ESP32 applications and dive into the world of microcontrollers with resources on Arduino Nano pinouts, Arduino-compatible sensors and esp32 vs esp8266 development boards.

Related to this project:

  1. ESP32 Soil Moisture Sensor Guide
  2. ESP32 Moisture Sensor Calibration for Accurate Readings
  3. Weather Data Art Integration
Automated Gardening System: esp32 soil moisture sensor cloud control using reactjs
LilyGo T-Display S3 ESP32 Projects: esp32 soil moisture sensor cloud control using reactjs

Project 8: Portable Network Scanner

Turn your ESP32 into a portable network scanner and explore the world of Wi-Fi networks with ease.

This project is ideal for tech enthusiasts, digital artists, and IoT developers looking to combine creativity with practical network tools.

Scan Wi-Fi Networks and Signal Strengths

With its built-in Wi-Fi capabilities, the ESP32 can detect nearby networks and measure their signal strengths.

By setting up your development environment using tools like Arduino IDE or PlatformIO, you can configure the ESP32 to scan and list Wi-Fi networks along with their details, such as signal strength and security type.

LilyGO T-Display S3 microcontroller setup with wiring and screen interface, ideal for IoT and display-based projects, from Steve Zafeiriou’s resources.

Display Network Details on the LilyGo T-Display S3

Take your project to the next level by integrating the LilyGo T-Display S3 ESP32 to showcase Wi-Fi network details.

Use the display to create a clear, visually appealing interface that lists network names, signal strengths, and encryption status in real time.

Add Advanced Features

Why stop at scanning?

Enhance your network scanner with additional functionalities:

  1. Ping Testing: Check network responsiveness by pinging an IP address and displaying the results.
  2. Packet Capture: Dive deeper into network data by capturing and analyzing packets for educational or debugging purposes.
  3. Dynamic Visualization: Represent network strength visually using bars or graphs on the screen for better understanding.

This portable network scanner project highlights the ESP32’s versatility and the LilyGo T-Display S3’s display capabilities.

By combining scanning, visualization, and advanced network tools, you create a practical and engaging device that bridges technology and creativity.

LilyGo T-Display S3 ESP32 displaying a cryptocurrency ticker with live prices for ETH, ENS, and BTC in USD.
LilyGo T-Display S3 ESP32 Projects: LilyGo T-Display S3 ESP32 displaying a cryptocurrency ticker with live prices for ETH, ENS, and BTC in USD.

Project 9: ESP32-Powered Cryptocurrency Ticker

Turn your LilyGo T-Display S3 ESP32 into a sleek cryptocurrency ticker that fetches live prices for popular coins like ETH, ENS, and BTC!

This project combines real-time data retrieval with dynamic display features, making it a functional and visually appealing addition to your tech toolkit.

Fetch Live Cryptocurrency Data Using APIs

To display cryptocurrency prices, use APIs from providers like CryptoCompare.

These APIs provide up-to-date prices in USD for various cryptocurrencies.

Key libraries you’ll need:

  1. WiFi.h: Connect the ESP32 to Wi-Fi.
  2. HTTPClient.h: Handle HTTP requests to fetch data.
  3. ArduinoJson.h: Parse the JSON responses to extract relevant data.

Set up the ESP32 to fetch prices from CryptoCompare for ETH, ENS, and BTC, and parse the responses to retrieve the current price in USD.

Display Cryptocurrency Prices

Using the TFT_eSPI library, the project displays the cryptocurrency prices on the LilyGo T-Display S3 in a clean table format.

Prices are dynamically updated, with changes indicated using color coding:

  1. Green: Price increased since the last update.
  2. Red: Price decreased since the last update.
  3. White: Price remains unchanged.

Customize the UI

The display layout ensures clarity and readability:

  1. Table Format: Each cryptocurrency is displayed with its name and current price in USD.
  2. Color Coding: Highlight price trends for better visual feedback.
  3. Periodic Updates: Prices refresh every 30 seconds automatically.

Here’s the complete code for your ESP32-powered cryptocurrency ticker:

#include <WiFi.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>
#include <TFT_eSPI.h>

#define DISPLAY_POWER_PIN 15 // Pin to control display power

// Wi-Fi credentials
const char* ssid = "Your_SSID";
const char* password = "Your_PASSWORD";

// API endpoints
const char* ethApi = "https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD";
const char* ensApi = "https://min-api.cryptocompare.com/data/price?fsym=ENS&tsyms=USD";
const char* btcApi = "https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=USD";

// Data storage
float ethUsd = 0, prevEthUsd = 0;
float ensUsd = 0, prevEnsUsd = 0;
float btcUsd = 0, prevBtcUsd = 0;

TFT_eSPI tft = TFT_eSPI(); // Initialize display

void setup() {
    Serial.begin(115200);

    // Turn on display power
    pinMode(DISPLAY_POWER_PIN, OUTPUT);
    digitalWrite(DISPLAY_POWER_PIN, HIGH);
    delay(500); // Ensure display power is stable

    // Initialize display
    tft.init();
    tft.setRotation(3); // Landscape mode
    tft.fillScreen(TFT_BLACK);
    tft.setTextSize(2);

    // Display Wi-Fi connection status
    tft.setCursor(10, 10);
    tft.println("Connecting to Wi-Fi...");
    connectToWiFi();

    // Fetch and display data
    fetchAndDisplayData();
}

void loop() {
    // Refresh data every 30 seconds
    delay(30000);
    fetchAndDisplayData();
}

void connectToWiFi() {
    WiFi.disconnect(true); // Clear previous configurations
    WiFi.mode(WIFI_STA);   // Set Wi-Fi to station mode
    WiFi.begin(ssid, password);

    unsigned long startAttemptTime = millis();
    const unsigned long wifiTimeout = 30000; // Timeout after 30 seconds

    while (WiFi.status() != WL_CONNECTED && millis() - startAttemptTime < wifiTimeout) {
        delay(1000);
        Serial.println("Connecting to Wi-Fi...");
        tft.fillScreen(TFT_BLACK);
        tft.setCursor(10, 10);
        tft.println("Connecting to Wi-Fi...");
    }

    if (WiFi.status() == WL_CONNECTED) {
        Serial.println("Connected to Wi-Fi");
        tft.fillScreen(TFT_BLACK);
        tft.setCursor(10, 10);
        tft.println("Wi-Fi Connected!");
    } else {
        Serial.println("Failed to connect to Wi-Fi");
        tft.fillScreen(TFT_BLACK);
        tft.setCursor(10, 10);
        tft.println("Wi-Fi Connection Failed");
    }
}

void fetchAndDisplayData() {
    // Fetch cryptocurrency prices
    fetchCryptoPrice(ethApi, ethUsd, prevEthUsd);
    fetchCryptoPrice(ensApi, ensUsd, prevEnsUsd);
    fetchCryptoPrice(btcApi, btcUsd, prevBtcUsd);

    // Display prices
    displayCryptoPrices();
}

void fetchCryptoPrice(const char* apiUrl, float& usdPrice, float& prevUsdPrice) {
    if (WiFi.status() != WL_CONNECTED) {
        Serial.println("Wi-Fi not connected. Skipping API call.");
        return;
    }

    HTTPClient http;
    http.begin(apiUrl);
    int httpResponseCode = http.GET();

    if (httpResponseCode > 0) {
        String payload = http.getString();
        Serial.println(payload);

        // Parse JSON response
        DynamicJsonDocument doc(1024);
        deserializeJson(doc, payload);

        prevUsdPrice = usdPrice; // Store previous price
        usdPrice = doc["USD"].as<float>();
    } else {
        Serial.printf("Error fetching data: HTTP %d\n", httpResponseCode);
        usdPrice = -1; // Indicate an error
    }

    http.end();
}

void displayCryptoPrices() {
    tft.fillScreen(TFT_BLACK);

    // Display ETH price
    tft.setCursor(10, 10);
    tft.setTextColor(ethUsd > prevEthUsd ? TFT_GREEN : (ethUsd < prevEthUsd ? TFT_RED : TFT_WHITE), TFT_BLACK);
    tft.printf("ETH: $%.2f", ethUsd);

    // Display ENS price
    tft.setCursor(10, 40);
    tft.setTextColor(ensUsd > prevEnsUsd ? TFT_GREEN : (ensUsd < prevEnsUsd ? TFT_RED : TFT_WHITE), TFT_BLACK);
    tft.printf("ENS: $%.2f", ensUsd);

    // Display BTC price
    tft.setCursor(10, 70);
    tft.setTextColor(btcUsd > prevBtcUsd ? TFT_GREEN : (btcUsd < prevBtcUsd ? TFT_RED : TFT_WHITE), TFT_BLACK);
    tft.printf("BTC: $%.2f", btcUsd);
}

This cryptocurrency ticker project uses the LilyGo T-Display S3 ESP32 to fetch live prices for ETH, ENS, and BTC in USD, displaying them in a visually clear table format.

With color-coded trends and automatic updates, this project is both functional and engaging.

Expand it further by adding more cryptocurrencies or implementing additional features!

By combining live API data, a customizable display, and creative UI elements like scrolling text and color-coded trends, this project is both functional and stylish.

Perfect for showcasing your tech skills and keeping tabs on the market!

Close-up of an ESP32-based master unit with a real-time environmental monitoring dashboard displaying temperature, humidity, soil moisture, and air quality data for an interactive art installation titled 'The Importance of Life.'
LilyGo T-Display S3 ESP32 Projects: master unit with a real-time environmental monitoring dashboard displaying temperature, humidity, soil moisture, and air quality data for an interactive art installation titled ‘The Importance of Life.’

Conclusion

The LilyGo T-Display S3 ESP32 is a versatile platform for creativity and innovation, packed with features that simplify even the most complex projects.

Whether you’re building a plant monitoring system, creating interactive games, or developing professional-grade IoT solutions, this board empowers your ideas.

What will you create first?

Share your projects and explore the possibilities of the T-Display S3!

Frequently Asked Questions (FAQ)

What microcontroller does the LilyGo T-Display S3 use?

The LilyGo T-Display S3 is powered by the ESP32-S3 microcontroller, which features dual-core LX7 processors, integrated Wi-Fi 802.11, and Bluetooth 5.0 with BT mesh capabilities

What are the specifications of the built-in display?

The device includes a 1.9-inch full-color TFT LCD with a resolution of 170 (H) x 320 (V) pixels, driven by the ST7789V controller

Which programming platforms are compatible with the T-Display S3?

The T-Display S3 supports multiple programming environments, including Arduino IDE and MicroPython, providing flexibility for various development preferences.

How can I power and program the T-Display S3?

The board can be powered and programmed directly via its USB Type-C port, utilizing the ESP32-S3’s native USB communication capabilities.

Where can I find technical support and resources for the T-Display S3?

For technical assistance, you can visit LilyGo’s official GitHub repository, which offers detailed documentation, example projects, and community support.

Total
0
Shares