Home Panel 4 for ESP32
An ESP32 camera project for E32R40T ESP32-32E involving SD card.
Parts and sourceBefore you start
Check the exact SD card configuration against the upstream wiring or parts list.
Upstream README
Home Assistant panel for the 4.0" ESP32-32E (E32R40T)
A Home Assistant touch panel for the inexpensive LCDwiki E32R40T board (4.0", 480×320, ST7796S, XPT2046 resistive touch, ESP32 without PSRAM). The firmware is ESPHome + LVGL and needs no coding: just enter your own entity IDs.
Six pages: Home (lights, fan, climate, safe, weather), Rack (power usage and power alarm), Servers (Proxmox, services, storage), Music, Camera (preview from HA) and Settings. Plus a shared top bar with the time, alerts and connection status.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Illustrative mockups with example data; page descriptions in esphome/README.md.
Repository contents
| Path | What it is |
|---|---|
| esphome/ | Panel configuration and installation guide (esphome/README.md) |
| docs/screens/ | Mockups of the panel pages shown in this README |
Quick start
- Read esphome/README.md, section "What you need in Home Assistant".
- Copy
esphome/ha-dashboard.example.yamlas your device file and fill in your entities. - Add the secrets (Wi-Fi, API key) in the ESPHome add-on, following
esphome/secrets.yaml.example. - Flash from the ESPHome add-on in HA (the first time over USB-C).
Hardware
4.0" ESP32-32E display module, SKU E32R40T (resistive touch) / E32N40T (no touch). Manufacturer docs: LCDwiki 4.0inch ESP32-32E Display.
- MCU: ESP32-D0WD-V3 (dual-core LX6, 240 MHz), 520 KB SRAM, 4 MB flash, no PSRAM
- LCD: 320×480, ST7796S driver over 4-wire SPI (RGB565; the panel supports up to RGB666)
- Touch: XPT2046 resistive controller over SPI; needs calibration, unlike capacitive touch
- USB-C through a CH340C with auto-download, so you don't need to press BOOT to flash
Pin map
| Function | Pins |
|---|---|
| LCD SPI (shared with touch) | SCLK 14, MOSI 13, MISO 12 |
| LCD control | CS 15, DC 2, backlight 27 (high = on) |
| LCD reset | Tied to ESP32 EN, so it has no GPIO (use RST = -1 in drivers) |
| Touch | CS 33, IRQ 36 (low when touched) |
| MicroSD (separate SPI bus, shared with ext. SPI header) | CS 5, MOSI 23, SCLK 18, MISO 19 |
| External SPI header | CS 21, same bus as SD (18/19/23) |
| I2C header | SCL 25, SDA 32 |
| RGB LED (common anode, low = on) | R 22, G 16, B 17 |
| Audio | DAC out 26, amp enable 4 (low = enabled) |
| Battery voltage ADC | 34 |
| BOOT button | 0 |
| UART0 | TX 1, RX 3 |
| Free, input-only | 35, 39 |
Hardware gotchas
- The LCD and the touch controller share one SPI bus (12/13/14) and differ only by CS. The SD card is on a different bus (18/19/23).
- GPIO 34, 35, 36 and 39 are input-only and have no internal pull-ups.
- The RGB LED and the audio amp enable are both active-low: driving them high turns them off.
- Holding the LCD or the ESP32 in reset resets both, because the LCD's reset line is EN.





