ESP32 Cheap Yellow Display (CYD)
repository·main·Indexed 26 days ago
https://github.com/witnessmenow/esp32-cheap-yellow-displayDocumentation and resources for the ESP32-2432S028R, a low-cost ESP32 board with an integrated 2.8" LCD and resistive touchscreen. Includes 3D design files for cases and stands, ESPHome configuration guides, and implementation examples for LVGL 8/9, ESP-IDF, and openHASP.
What's inside esp32-cheap-yellow-display
- The ESP32 Cheap Yellow Display (CYD), officially known as the ESP32-2432S028R, is an affordable development board featuring an integrated ESP32 microcontroller and a 2.8" LCD display. It is designed for rapid prototyping without the need for soldering or external components.
Understand the 3248S035C Hardware Modification for Performance
mainThe provided Rust example for the
3248S035Cvariant is designed for hardware that has been manually modified to improve screen performance.The Problem: On stock hardware, the LCD and the XPT2046 touch controller share the same SPI bus. Because the XPT2046 requires a low clock speed (2.5MHz) and the LCD can run much faster (80MHz), the shared bus limits the LCD update performance.
The Modification: The XPT2046
sck,din, anddoutpins have been moved to GPIO22,26, and39respectively using Kynar wires. This allows the LCD and touch controller to operate on separate SPI buses.Reverting to Stock Hardware: To use this code with unmodified hardware, you must replace the
embedded_hal_bus::ExclusiveDeviceinstances withembedded_hal_bus::CriticalSectionDeviceinstances. Both should be provided with the sameembedded_hal::SpiDevicereference. Note that this will result in slower screen updates.Use the SD to NFC Adaptor PCB
mainThe SD to NFC Adaptor is a PCB designed to break out the pins of a MicroSD card. While specifically designed to interface with the red PN532 NFC module, it is a general-purpose breakout board that can be used for other components.Available ESPHome Example Projects for CYD
mainThe repository provides several YAML examples for different features of the ESP32-2432S028R display:
- 1-HelloWorld: Displays centered 'Hello World' text.
- 2-ESPHomeClock: Displays the ESPHome logo with the current date and time.
- 3-RGBLED: Publishes the onboard RGB LED status to Home Assistant.
- 4-TouchDemo: Creates two rectangles acting as binary touch sensors in Home Assistant.
- 5-TemperatureGraph: Visualizes a Home Assistant temperature sensor via a graph.
- 6-VariousFeatures: A comprehensive example for boards with 2 USB ports (also compatible with single USB port boards).
- 7-ExtendedTouchDemo: An advanced touch demo including Material Design Icons, a WiFi signal icon, backlight sleep mode, and onboard LED control.
Note: Some examples require you to manually copy font or image files into your ESPHome folder. Instructions for these files are included within the respective YAML files.
Getting started with the CYD
mainTo begin using your CYD, refer to the dedicated Setup and Configuration guide for detailed instructions on initial setup.Install LVGL for CYD in Arduino IDE
mainTo use the LVGL 9 examples with the ESP32 Cheap Yellow Display (CYD), follow these specific installation steps. Note that standard LVGL installation via the Library Manager requires manual file manipulation to work with the Arduino IDE and the CYD hardware.
1. Install Required Libraries
Install the following via the Arduino Library Manager:
- TFT_eSPI: Ensure it is configured for the CYD display.
- XPT2046_Touchscreen: Ensure the touchscreen is working using the
2-TouchTestexample. - LVGL: Install version v9.0.0.
Warning:
- Do not install
lv_examples(intended for older versions). - Do not install
lv_arduino(a different port).
2. Manual Configuration
Because of Arduino IDE limitations and CYD hardware architecture (where the XPT2046 is on a different SPI bus than the display), you must perform these steps:
- Configure
lv_conf.h: Copy thelv_conf.hfile from theExamples/LVGL9/folder in this repository to your Arduinolibrariesfolder (the parent directory containing all your library folders, not inside the LVGL library folder itself). - Relocate LVGL Directories: Inside your LVGL library directory, move both the
examplesanddemosdirectories into thesrcdirectory.
Configure ESPHome for CYD with USB-C Hardware
mainIf you are using the newer hardware version of the ESP32-2432S028R that features a USB-C connector, you must configure the
ili9xxxdisplay platform with specific settings: modelili9342, no rotation, andinvert_colors: true.display: - platform: ili9xxx id: esp_display model: ili9342 spi_id: tft cs_pin: GPIO15 dc_pin: GPIO2 invert_colors: trueInstall dependencies for LeetCode Daily Question Viewer
mainTo run the LeetCode Daily Question Viewer project, you must install the following libraries via the Arduino Library Manager:
TFT_eSPIXPT2046_TouchscreenArduinoJsonHTTPClient
Configure secrets.yaml for ESPHome CYD examples
mainTo use the provided ESPHome YAML examples, you must define the following keys in your
secrets.yamlfile:api_keyota_passwordwifi_ssidwifi_passwordap_password
Install CH340 drivers for CYD
mainThe CYD uses the CH340 USB to UART chip for communication. If your computer does not recognize the device when connected via micro USB, you must install the CH340 drivers. You can find installation instructions at Sparkfun's guide: https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers/allIdentify if your board is a CYD
mainA Cheap Yellow Display (CYD) is specifically the ESP32-2432S028 board, which features an ESP32 development board with a 2.8" resistive touch screen. To verify you have the correct board, check the model number printed on the back of the display.Set up the Rust toolchain for CYD
mainTo develop for the ESP32-Cheap-Yellow-Display (CYD) using Rust, you must install the specific ESP-RS toolchain. Follow the official installation guide to ensure your environment is configured for ESP32 development.
https://esp-rs.github.io/book/installation/index.html