CrowPanel 2.1-inch ESP32-S3 Rotary Display — Arduino Course Index (2.1)¶
Hardware platform: CrowPanel 2.1-inch HMI ESP32-S3 Rotary Display — 480×480 IPS round touch knob screen Development environment: Arduino IDE 2.x + ESP32 Arduino Core Level: Beginner to intermediate Language: Arduino C++ (with optional LVGL)
1. Course Overview¶
This course is a hands-on, step-by-step guide to the CrowPanel 2.1-inch ESP32-S3 rotary display. Starting from an empty Arduino project, it walks through environment setup, the first serial "Hello World", and then moves on to the three input and output devices that make this board special: the rotary encoder knob, the round touchscreen, and the on-board sensors and interfaces.
Each lesson is self-contained: it states the learning objectives, lists the required hardware and software, gives the build steps with screenshots, and closes with an explanation of the key code. By the end of the course you will be able to build a small interactive interface that you can control with the knob and the touchscreen, read real sensor data, and connect external modules over UART and native USB.
What you will be able to do after the course
- Set up the Arduino IDE for the ESP32-S3 and upload a sketch to the board.
- Read a rotary encoder reliably and use it to change a value or an interface.
- Draw text and simple UI elements on the 480×480 round display (optionally with LVGL).
- Read an I2C sensor and format the data for the screen and the serial monitor.
- Talk to an external module over UART and debug it through the USB serial port.
- Use the ESP32-S3 native USB to present the board as a USB HID device.
2. Lesson Directory¶
| # | Lesson | Topic | Key hardware / interfaces |
|---|---|---|---|
| 1 | Lesson 01 — Print Hello World | Serial communication basics | USB serial port, 115200 bit/s |
| 2 | Lesson 02 — Encoder Brightness | Knob-controlled backlight and button status | Rotary encoder A/B, encoder button, PWM backlight |
| 3 | Lesson 03 — Temperature and Humidity | Reading an I2C sensor and showing the data | DHT20 (I2C 0x38), SDA GPIO38 / SCL GPIO39 |
| 4 | Lesson 04 — Serial Port Usage | Sending AT commands to an external module | UART2 RX GPIO44 / TX GPIO43 |
| 5 | Lesson 05 — USB 2.0 | Touchscreen as a USB HID mouse | ESP32-S3 native USB, touch controller |
| — | Arduino LVGL Rotary Guide | Display, touch, and multi-page interaction | LVGL, display driver, touch controller |
3. Lesson Summaries¶
Lesson 01 — Print Hello World (Serial Communication)¶
The starting point of the whole course. You configure the Arduino IDE for the ESP32-S3, then use the USB serial interface at 115200 bit/s to print Hello World once at startup and then roughly once per second. The lesson focuses on the toolchain: selecting the correct board and port, installing the ESP32 board support package, uploading a sketch, and reading the Serial Monitor. Everything you build later depends on this debugging loop working.
You will learn: board and port selection, the relationship between Serial.begin(115200) and the Serial Monitor baud rate, and how to tell a normal startup from a boot loop.
Lesson 02 — Encoder Brightness (Knob-Controlled Backlight)¶
The first real interaction with the hardware. The A/B signals of the rotary encoder are sampled and decoded with a four-state transition table, so that clockwise and counter-clockwise rotation are recognised reliably and contact bounce is filtered out. Turning the knob changes the screen backlight in 5% steps, while pressing the encoder button updates a "pressed / released" status on the screen. The lesson also introduces the display and LVGL text rendering used by later lessons.
You will learn: how the encoder A/B pins work, how the transition table distinguishes rotation directions, and how a percentage brightness value is converted into an 8-bit PWM duty cycle.
Lesson 03 — Temperature and Humidity (I2C DHT20)¶
This lesson moves from inputs to sensing. A measurement command is sent over I2C to the DHT20 at address 0x38, and the returned 6-byte raw data is converted into temperature and relative humidity. The values are shown on the LCD and printed to the serial port about every 2 seconds; a failed reading displays DHT20 read error so you can tell a wiring problem from a display problem. The code uses GPIO38 for SDA and GPIO39 for SCL.
You will learn: the DHT20 command and read sequence, how raw bits become physical values, and how to diagnose a sensor that is not responding.
Lesson 04 — Serial Port Usage (AT Commands over UART)¶
Here the board talks to an external module. The second hardware UART of the ESP32-S3 is initialised at 115200 bit/s on GPIO44 (RX) and GPIO43 (TX), and AT is sent to an attached Wi-Fi/UART module. The reply is displayed on the LCD and on the computer's debug serial port at the same time. The lesson makes the distinction between the "module serial port" and the "computer debug serial port" explicit, and covers crossover wiring (module TX → board RX) and common ground.
You will learn: how to configure a second UART, how to verify the module's power, logic level and wiring from the AT response, and how to keep two serial channels straight in one sketch.
Lesson 05 — USB 2.0 (Touchscreen as a USB Mouse)¶
The most surprising lesson in the course: the ESP32-S3's native USB is used to enumerate the board as an HID mouse. Touch movement on the round screen is translated into relative cursor movement, the left button stays pressed while the screen is touched, and it is released when contact ends. LVGL is intentionally not used here — only the display and the touch controller are initialised — so the link between raw touch coordinates and USB HID reports stays visible.
You will learn: how USB HID mouse enumeration, movement and button states work, how touch deltas are constrained into safe relative movement, and how to test and safely disconnect a HID device on your computer.
Reference — Arduino LVGL Rotary Guide¶
Lesson01_Arduino_LVGL_Rotary: 2.1-inch Rotary Display — Display, Touch, and Multi-page Interaction. This reference page is the foundation for the user-interface side of the course. It covers driving the 480×480 display, reading the capacitive touch panel, and building a multi-page LVGL interface that the rotary knob can navigate. If you want a proper graphical interface rather than plain text on the screen, read this guide before or alongside Lesson 02.
4. Recommended Learning Path¶
- Lesson 01 — get the toolchain and the serial monitor working.
- Arduino LVGL Rotary Guide — get the display and the touch panel working.
- Lesson 02 — add the knob and drive a value (backlight brightness) with it.
- Lesson 03 — add a sensor and display real data.
- Lesson 04 — add an external module over UART.
- Lesson 05 — explore the native USB capability.
Lessons 01–03 form a natural beginner track. Lessons 04 and 05 are more advanced and can be taken in any order.
5. Hardware and Software Checklist¶
Hardware
- CrowPanel 2.1-inch ESP32-S3 rotary display (480×480 IPS round touchscreen with knob).
- USB cable that supports data transfer (not a charge-only cable).
- For Lesson 03: a DHT20 sensor module (3.3 V, I2C address
0x38) and jumper wires. - For Lesson 04: a 3.3 V Wi-Fi/UART module that responds to
ATcommands, plus jumper wires. - For Lesson 05: a computer with a free USB port; a test window is recommended while the HID mouse is active.
Software
- Arduino IDE 2.x.
- ESP32 Arduino Core (install via Boards Manager; the P4 lessons in this series reference version 3.3.8 — check your board's documentation for the version your board needs).
- Libraries used across the lessons:
Arduino_GFX_Library,PCF8574,LVGL, and the ESP32 USB HID components (USB.h,USBHIDMouse.h) for Lesson 05.
Project files
- Common board support files
Board21.handBoard21.cppare shared by the lessons. - Example sketches are named after the lessons, e.g.
Lesson01-Print_Hello_World.ino,Lesson02-rotate.ino,Lesson04-Temperature_and_Humidity.ino,Lesson05-Serial_port_usage.ino,Lesson06-USB2.0.ino. - Example code repository: Elecrow-RD CrowPanel 2.1inch HMI ESP32 Rotary Display (GitHub)
Pin reference used in this course
| Function | Pin / interface |
|---|---|
| Serial debug (USB) | native USB, 115200 bit/s |
| Backlight PWM | screen backlight pin (see Board21.h) |
| Encoder A/B + button | see Board21.h |
| DHT20 SDA | GPIO38 |
| DHT20 SCL | GPIO39 |
| UART2 RX | GPIO44 |
| UART2 TX | GPIO43 |
6. Troubleshooting Quick Reference¶
- Board not detected: install the ESP32 board support package, install the USB serial driver if required, and try another USB cable or port.
- Garbled serial output: the Serial Monitor baud rate does not match
Serial.begin()— use 115200. - The board keeps restarting: check for a crash at startup, a wrong board selection, or a power problem; watch the serial output for the reset reason.
- Encoder turns the wrong way or jumps: verify the A/B pin mapping and the transition table indexing.
DHT20 read error: check that the module is powered from 3.3 V, that SDA/SCL are on GPIO38/GPIO39, and that the address is0x38.- No
ATresponse: confirm module power, 3.3 V logic level, crossover wiring (module TX → GPIO44), and a common ground. - Touch / display issue: confirm the display and touch controller are initialised, and re-check the board configuration in
Board21.h. - USB mouse not appearing: the sketch must be uploaded with the native USB mode selected and the board must support native USB HID.
7. About This Board¶
The CrowPanel 2.1-inch ESP32-S3 Rotary Display combines a 480×480 IPS round touchscreen, a rotary encoder with a push button, Wi-Fi/Bluetooth, and exposed UART and I2C interfaces in a knob-shaped enclosure. It is designed for smart-home control panels, instrument dials, media controllers and other interfaces where a physical knob plus a touchscreen makes more sense than a touchscreen alone.
- Product wiki: CrowPanel 2.1inch-HMI ESP32 Rotary Display 480×480 IPS Round Touch Knob Screen
- Arduino IDE setup: Get Started with Arduino IDE