Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use ESP32-CYD-2.8: Examples, Pinouts, and Specs

Image of ESP32-CYD-2.8Design with ESP32-CYD-2.8 in Cirkit Designer

Introduction

The ESP32-CYD-2.8 is a versatile development board that integrates the powerful ESP32 microcontroller with a 2.8-inch touchscreen display. This combination makes it an excellent choice for Internet of Things (IoT) applications, user interface (UI) projects, and other embedded systems requiring both connectivity and an interactive display. The ESP32-CYD-2.8 supports Wi-Fi and Bluetooth connectivity, making it ideal for smart home devices, industrial automation, and portable monitoring systems.

Explore Projects Built with ESP32-CYD-2.8

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of ESP32-Based Sensor Monitoring System with OLED Display and E-Stop: A project utilizing ESP32-CYD-2.8 in a practical application
ESP32-Based Sensor Monitoring System with OLED Display and E-Stop

This circuit features an ESP32 microcontroller that interfaces with a variety of sensors and output devices. It is powered by a Lipo battery through a buck converter, ensuring a stable voltage supply. The ESP32 collects data from a DHT11 temperature and humidity sensor and a vibration sensor, controls a buzzer, and displays information on an OLED screen. An emergency stop (E Stop) is connected for safety purposes, allowing the system to be quickly deactivated.

Open Project in Cirkit Designer
Image of ESP32-Based Portable NFC/RFID Reader with OLED Interface: A project utilizing ESP32-CYD-2.8 in a practical application
ESP32-Based Portable NFC/RFID Reader with OLED Interface

This circuit features an ESP32 microcontroller connected to a 0.96" OLED display via I2C (SCK and SDA lines), multiple pushbuttons interfaced to various GPIO pins for input, and a LiPoly battery connected through a TP4056 charging/protection module to power the system. A step-up boost power converter adjusts the battery voltage to supply the ESP32 and OLED display. The toggle switch controls the power flow from the battery to the converter, enabling an on/off functionality for the circuit.

Open Project in Cirkit Designer
Image of Battery-Powered ESP32-C3 Interactive Control Panel: A project utilizing ESP32-CYD-2.8 in a practical application
Battery-Powered ESP32-C3 Interactive Control Panel

This circuit features an ESP32-C3 microcontroller connected to various input devices and an OLED display. The input devices include two KY-023 Dual Axis Joystick Modules for directional input and a Rotary Encoder for incremental input, both interfaced with the ESP32-C3's GPIO pins. The circuit also includes a power management system with a Polymer Lithium Ion Battery, a JST connector, and a toggle switch to control power to an LED indicator.

Open Project in Cirkit Designer

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

The ESP32-CYD-2.8 features a variety of pins for interfacing with external components. Below is the pinout description:

Pin Name Type Description
VIN Power Input Input voltage (5V) for powering the board via USB or external power supply.
GND Ground Ground connection.
3V3 Power Output 3.3V output for powering external components.
GPIO0 Digital I/O General-purpose I/O pin, also used for boot mode selection.
GPIO2 Digital I/O General-purpose I/O pin.
GPIO4 Digital I/O General-purpose I/O pin, supports PWM and ADC.
GPIO12-19 Digital I/O General-purpose I/O pins, support SPI, I2C, UART, PWM, and ADC.
GPIO21 Digital I/O General-purpose I/O pin, often used for I2C SDA.
GPIO22 Digital I/O General-purpose I/O pin, often used for I2C SCL.
GPIO25-27 Digital I/O General-purpose I/O pins, support DAC and ADC.
T_CS Digital I/O Chip select pin for the touchscreen controller (XPT2046).
T_IRQ Digital Input Interrupt pin for the touchscreen controller.
T_CLK Digital Output Clock pin for the touchscreen controller (SPI interface).
T_MOSI Digital Output Data input pin for the touchscreen controller (SPI interface).
T_MISO Digital Input Data output pin for the touchscreen controller (SPI interface).

Usage Instructions

How to Use the ESP32-CYD-2.8 in a Circuit

  1. Powering the Board:

    • Connect the board to a 5V USB power source or provide 3.3V to the VIN pin.
    • Ensure the power supply can provide at least 500mA to avoid instability.
  2. Connecting the Touchscreen:

    • The touchscreen is pre-wired to the ESP32 via SPI. Use the T_CS, T_CLK, T_MOSI, and T_MISO pins for communication.
    • The T_IRQ pin can be used to detect touch events.
  3. Programming the ESP32:

    • Use the Arduino IDE or ESP-IDF to program the ESP32.
    • Install the necessary libraries for the touchscreen (e.g., TFT_eSPI and Adafruit_GFX).
  4. Interfacing with Peripherals:

    • Use the GPIO pins to connect sensors, actuators, or other devices.
    • Configure the pins in your code according to the peripheral's requirements.

Important Considerations and Best Practices

Example Code for Arduino IDE

Below is an example of initializing the touchscreen and displaying text on the screen:

#include <TFT_eSPI.h>  // Include the TFT library
#include <SPI.h>       // Include the SPI library

TFT_eSPI tft = TFT_eSPI();  // Create TFT object

void setup() {
  tft.init();               // Initialize the display
  tft.setRotation(1);       // Set display orientation
  tft.fillScreen(TFT_BLACK); // Clear the screen with black color

  tft.setTextColor(TFT_WHITE, TFT_BLACK); // Set text color (white on black)
  tft.setTextSize(2);       // Set text size

  tft.setCursor(10, 10);    // Set cursor position
  tft.println("Hello, ESP32!"); // Print text to the screen
}

void loop() {
  // Add your code here for touchscreen interaction or other tasks
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. The touchscreen is not responding:

    • Ensure the SPI connections (T_CS, T_CLK, T_MOSI, T_MISO) are properly configured in your code.
    • Verify that the touchscreen library is installed and correctly initialized.
  2. The display shows a blank screen:

    • Check the power supply to ensure the board is receiving sufficient voltage.
    • Verify that the display initialization code is correct.
  3. Wi-Fi or Bluetooth is not working:

    • Ensure the ESP32 firmware is up to date.
    • Check that the correct Wi-Fi credentials or Bluetooth pairing settings are used.
  4. The board overheats during operation:

    • Reduce the workload by optimizing your code.
    • Use a heatsink or improve ventilation around the board.

FAQs