
8 Popular ESP32 AI Projects for 2026: Voice, Vision & TinyML
Explore XiaoZhi, ElatoAI, ESPHome, ESP-SR, ESP-WHO, ESP-Detection, Edge Impulse and SenseCraft AI. Compare hardware, local inference and backend requirements before your first build.

T_IRQ (Interrupt): GPIO 36T_DIN (MOSI): GPIO 32T_OUT (MISO): GPIO 39T_CLK: GPIO 25T_CS (Chip Select): GPIO 33text
x_screen = alphaX * x_touch + betaX * y_touch + deltaX
y_screen = alphaY * x_touch + betaY * y_touch + deltaY
(x_touch, y_touch) are raw values from the XPT2046 controller(x_screen, y_screen) are the corrected display coordinatesalpha, beta, and delta are the six calibration coefficients unique to each unitlv_conf.h configuration file provided by Random Nerd Tutorials or adapt it carefully. Generic configurations often fail.User_Setup.h specifically for the CYD (GPIO pins, rotation, etc.)cpp
#define XPT2046_IRQ 36 // T_IRQ
#define XPT2046_MOSI 32 // T_DIN
#define XPT2046_MISO 39 // T_OUT
#define XPT2046_CLK 25 // T_CLK
#define XPT2046_CS 33 // T_CS
cpp
/*
* Professional ESP32 CYD Touchscreen Calibration
* Based on TI Application Note slyt277
* Adapted for commercial deployment by [Your Company Name]
*/
#include <lvgl.h>
#include <TFT_eSPI.h>
#include <XPT2046_Touchscreen.h>
#include <BasicLinearAlgebra.h>
#include <Preferences.h> // For persistent storage
// Touchscreen pin definitions
#define XPT2046_IRQ 36
#define XPT2046_MOSI 32
#define XPT2046_MISO 39
#define XPT2046_CLK 25
#define XPT2046_CS 33
SPIClass touchscreenSPI = SPIClass(VSPI);
XPT2046_Touchscreen touchscreen(XPT2046_CS, XPT2046_IRQ);
#define SCREEN_WIDTH 240
#define SCREEN_HEIGHT 320
// Calibration points (6-point method)
const int scr_points[6][2] = {
{13, 11}, {20, 220}, {167, 60},
{155, 180}, {300, 13}, {295, 225}
};
// Coefficient variables
float alphaX, betaX, deltaX, alphaY, betaY, deltaY;
Preferences preferences;
// ... [Rest of calibration logic including gather_cal_data(),
// compute_transformation_coefficients(), and ts_calibration()]
// Full code available in GitHub repository linked below
Preferences library for permanent coefficient storagetext
******************************************************************
USE THE FOLLOWING COEFFICIENT VALUES TO CALIBRATE YOUR TOUCHSCREEN
Computed X: alpha_x = -0.000, beta_x = 0.090, delta_x = -33.771
Computed Y: alpha_y = 0.066, beta_y = 0.000, delta_y = -14.632
******************************************************************
cpp
void touchscreen_read(lv_indev_t * indev, lv_indev_data_t * data) {
if(touchscreen.tirqTouched() && touchscreen.touched()) {
TS_Point p = touchscreen.getPoint();
// REPLACE WITH YOUR CALIBRATED VALUES
float alpha_x = -0.000;
float beta_x = 0.090;
float delta_x = -33.771;
float alpha_y = 0.066;
float beta_y = 0.000;
float delta_y = -14.632;
// Apply transformation
int x = alpha_y * p.x + beta_y * p.y + delta_y;
int y = alpha_x * p.x + beta_x * p.y + delta_x;
// Clamp to screen bounds
x = max(0, min(SCREEN_WIDTH - 1, x));
y = max(0, min(SCREEN_HEIGHT - 1, y));
data->point.x = x;
data->point.y = y;
data->state = LV_INDEV_STATE_PRESSED;
} else {
data->state = LV_INDEV_STATE_RELEASED;
}
}
cpp
// Save coefficients after calibration
preferences.begin("cyd-calibration", false);
preferences.putFloat("alphaX", alphaX);
preferences.putFloat("betaX", betaX);
preferences.putFloat("deltaX", deltaX);
preferences.putFloat("alphaY", alphaY);
preferences.putFloat("betaY", betaY);
preferences.putFloat("deltaY", deltaY);
preferences.end();
// Load coefficients at startup
preferences.begin("cyd-calibration", true);
alphaX = preferences.getFloat("alphaX", 0.0);
betaX = preferences.getFloat("betaX", 0.0);
// ... load remaining coefficients
preferences.end();
cpp
// Try different rotation values (0, 1, 2, 3)
touchscreen.setRotation(2); // Landscape
// OR
touchscreen.setRotation(0); // Portrait (may need inversion)
cpp
// Incorrect (causes swap)
x = alpha_y * p.x + beta_y * p.y + delta_y;
y = alpha_x * p.x + beta_x * p.y + delta_x;
// Correct
x = alpha_x * p.x + beta_x * p.y + delta_x;
y = alpha_y * p.x + beta_y * p.y + delta_y;
cpp
y = SCREEN_HEIGHT - y; // Flip Y axis
cpp
// Ensure Preferences is properly initialized
if (!preferences.begin("cyd-calibration", false)) {
Serial.println("Failed to open NVS namespace");
// Fallback to default coefficients or re-calibrate
}
cpp
preferences.clear(); // Erase all stored values
preferences.end();
touchscreen_read() callback registration in LVGL.cpp
void setup() {
// ... LVGL initialization ...
lv_indev_t * indev = lv_indev_create();
lv_indev_set_type(indev, LV_INDEV_TYPE_POINTER);
lv_indev_set_read_cb(indev, touchscreen_read); // Critical!
// ... rest of setup ...
}
| Scenario | Calibration Approach | Estimated Support Cost | Customer Satisfaction |
|---|---|---|---|
| No Calibration | None | $15-25/unit (returns + tickets) | 2.1/5 stars |
| Factory Calibrated | Automated fixture | $0.50/unit | 4.6/5 stars |
| User Calibration | In-app routine | $2.00/unit (initial setup time) | 4.2/5 stars |
======================================
Radxa NX4 IO Board — An Application Board for Radxa NX4
$98.90
30 LED Industrial Sewing Machine Lighting Lamp Clothing Machine Accessories Work Light 360° Flexible Gooseneck Industrial Lights
$4.20
Radxa 20W PoE+ Module compact for CUBIE A5E
$19.80
Waveshare UPS HAT (E) for Raspberry Pi, Supports 4×21700 Li batteries (NOT included), Bi-Directional Fast charging, Pogo Pins
$43.90
Radxa M.2 E Key to SATA Breakout Board for M.2 E Key interface support SATA
$5.90

Explore XiaoZhi, ElatoAI, ESPHome, ESP-SR, ESP-WHO, ESP-Detection, Edge Impulse and SenseCraft AI. Compare hardware, local inference and backend requirements before your first build.

Discover ten active ESP32 open-source projects for 2026, from XiaoZhi AI and WLED to ESPHome, Meshtastic and touchscreen control. Includes GitHub popularity, hardware considerations and first-build ideas.

Choose an e-paper display for your ESP32 project: compare screen types, raw panels and modules, refresh modes, memory needs and power considerations.

Compare ESP32-C3, ESP32-C5 and ESP32-C6 for Wi-Fi bands, Bluetooth LE, Thread, Zigbee, memory and Matter product design. Find the right connectivity for your project.

Compare ESP32-S3 and ESP32-C3 for CPU, memory, displays, cameras, USB and wireless connectivity. Practical advice for choosing your next connected product platform.

Compare ESP8266, ESP8285 and ESP32-C3 for Wi-Fi, Bluetooth LE, flash, security and migration. A practical guide for existing designs and new connected products.