Description
Build Your Own HMI
CYD 2.8″ ESP32 Resistive Touchscreen Module
CYD is short for “Cheap Yellow Display” and was probably coined by Brian Lough aka witnessmenow. One of the earliest adopters of these great little displays, he analysed and documented some of their features and helped promote them as a useful tool for both professionals and makers.
We use these great modules with our in-house developed software to control and provide feedback on a variety of devices.
Some of the applications include:
Driving stepper and DC motors, reading environmental data, controlling relays and reading switches, and integrating into smart home (https://home-assistant.io or https://esphome.io). There is even an Open Source CNC Pendant Project.
Features
- Latest iteration of the various versions of the CYD
- 2.8″ TFT Resistive Touchscreen
- ESP32 Dual-Core Processor
- WiFi and Bluetooth connectivity
- 3 or 6+ GPIOs
- Support for UART/SPI/I2C/PWM/ADC/DAC
- Supports and is compatible with LGVL (Light and Versatile Embedded Graphics Library)
- Front-facing RGB LED
- Front-facing LDR
- Model: JC2432W328R
What is included:
- Resistive touchscreen integrated with ESP32
- Medium length 1.25MM 4-pin JST-GH to DuPont connector
- Stylus
Specifications
Controller:
- ESP32-WROOM-32 module
- Dual-core MCU
- Integrated Wi-Fi and Bluetooth
- Main frequency up to 240 MHz
- Memory of 520 KB SRAM and 448 KB ROM
- 4 MB flash memory.
- TF card slot
Touch Screen:
- 2.8-inch LCD colour screen (effective display area 43.2 x 57.6 mm^2)
- Driver chip: ST7789
- Resistive touch
- Resolution 240 x 320
- Supports 16-bit RGB 65 K color display
- View: >60°
Connectivity:
- USB-C: Power and programming
- TF Card Slot
- P1: Power and Serial Port
- Power (5V and GND)
- Serial communications (TX and RX)
- P3: Extended IO
- GND
- 3 GPIOs (21, 22, and 35)
- CN1: Extended IO
- 3.3v and GND
- 2 GPIOs (21 and 22)
- P6: Extended IO
- GND
- 3 GPIOs (17, 4, and 16)
- P4: Speaker
- VO1 and VO2
- P5: Battery
- Bat+ and Bat-
Pinout Diagram
Programming
Because these great touchscreen modules are powered by an ESP32-WROOM-32 they can be programed using a wide variety of IDEs and related tools, including:
- Arduino IDE
- Platform IO (our favourite programming environment)
- Espressif ESP-IDF
- and more
At Maker Store we use Squareline Studio to build the screen, add the controls and feedback and then Platform IO to do most of the coding and upload to the module.
Resources
Overview and lots of links to resources:
https://github.com/witnessmenow/ESP32-Cheap-Yellow-Display
Template file for using CYD with Squareline Studio/VSC/Platformio:
https://github.com/witnessmenow/ESP32-Cheap-Yellow-Display/discussions/102
JC2432W328 Microcontroller Board Documentation:
https://github.com/maxpill/JC2432W328
Manufacture Documentation, code examples and etc:
http://pan.jczn1688.com/1/HMI%20display (JC2432W328.zip)
https://github.com/csanting/ESP32-Marauder-Cheap-Cap-Yellow-Display/tree/master/JC2432W328/JC2432W328
Reddit discussion: Working CYD JC2432W328 Display 240×320 2.8″ USB-C working with code example.
https://www.reddit.com/r/esp32/comments/1dy5k11/working_cyd_jc2432w328_display_240x320_28_usbc/
Useful Info
setup.h:
#ifndef SETUP_H #define SETUP_H #define ST7789_DRIVER // Full configuration option, define additional parameters below for this display #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red #define TFT_WIDTH 240 #define TFT_HEIGHT 320 #define TFT_INVERSION_OFF #define ESP32_DMA #define TFT_MISO 12 // SPI Main-in/Sub-out of screen #define TFT_MOSI 13 // SPI Main-out/Sub-in of screen #define TFT_SCLK 14 // SPI Clock signal of screen #define TFT_CS 15 // SPI Chip select of screen #define TFT_DC 2 // SPI Data control of screen #define TFT_RST -1 // Button controlled #define TFT_BL 27 // LED back-light #define TOUCH_CS 33 // Chip select pin (T_CS) of touch screen #endif
Pins:
| Pin | Notes | Connect | TFT | Connector |
| IO0 | BOOT | |||
| IO1 | U0TXD | P1 | ||
| IO2 | TFT_RS | RS | ||
| IO3 | U0RXD | P1 | ||
| IO4 | LED RED | LED1_2 | ||
| IO5 | VSPI CS0 | TF_CS | ||
| IO6 | SCK | |||
| IO7 | DO/SD0 | P6 | ||
| IO8 | DI/SD1 | |||
| IO9 | SHD/SD2 | |||
| IO10 | SWP/SD3 | |||
| IO11 | CSC/CMD | |||
| IO12 | HSPI MISO | RTP_OUT/TFT_SDO | MISO | |
| IO13 | HSPI MOSI | RTP_DIN/TFT_SDI | MOSI | |
| IO14 | HSPI CLK | RTP_CLK/TFT_SCK | CLK | |
| IO15 | HSPI CS0 | TFT_CS | CS0 | |
| IO16 | U2TXD/LED GREEN | LED1_3 | P6 | |
| IO17 | U2RXD/LED BLUE | LED1_1 | P6 | |
| IO18 | VSPI CLK | TF_CLK | ||
| IO19 | VSPI MISO | TF_SDO | ||
| IO21 | I2C SDA | CN1/P3 | ||
| IO22 | I2C SCL | CN1/P3 | ||
| IO23 | VSPI MOSI | TF_SDI | ||
| IO25 | CTP_RST | |||
| IO26 | SPK | P4 | ||
| IO27 | BL_CTRL | BL | ||
| IO32 | CTP_SCL | |||
| IO33 | RTP_CS/CTP_SDA | |||
| IO34 | INPUT ONLY | R21(photoresistor) | P3 | |
| IO35 | INPUT ONLY | |||
| IO36 | INPUT ONLY | RTP_IRQ | ||
| IO39 | INPUT ONLY |
Connectors:
| P1 | +5 VIN | TXD | RXD | GND |
| P3 | GPIO21 (SDA) | GPIO22 (SCL) | GPIO35 | GND |
| CN1 | 3V3 | GPIO21 (SDA) | GPIO22 (SCL) | GND |
| P6 | GPIO17 (LEDB) | GPIO4 (LEDR) | GPIO16 (LEDG) | GND |
| P4 | VO1 | VO2 | ||
| P5 | +BAT | -BAT |






















