3D Enclosure Design
Waiting for input
C
// E-ink display U2: HTEW0154T8 #define PIN_EINK_BUSY 7 #define PIN_EINK_DC 9 #define PIN_EINK_CS 10 #define PIN_EINK_MOSI 11 #define PIN_EINK_SCLK 12 // User buttons, active-low to GND #define PIN_BUTTON_1 2 #define PIN_BUTTON_2 39 #define PIN_BUTTON_3 21 #define PIN_BUTTON_4 5 // LEDs, GPIO drives cathode through 150 ohm resistor; active-low #define PIN_LED_1 1 #define PIN_LED_2 48 #define PIN_LED_3 47 #define PIN_LED_4 4 // Programming / boot / reset #define PIN_BOOT 0 // GPIO0: pull low during reset for download mode #define PIN_UART0_RX 44 // IC1 symbol RXD0 #define PIN_UART0_TX 43 // IC1 symbol TXD0 // EN is chip reset/enable, not a firmware GPIO.
Table
| Signal | GPIO | Active level | Firmware configuration |
|---|---|---|---|
| BUTTON_1 / SW1 | GPIO2 | LOW when pressed | Input with pull-up enabled, debounce in firmware |
| BUTTON_2 / SW2 | GPIO39 | LOW when pressed | Input with pull-up enabled, debounce in firmware |
| BUTTON_3 / SW3 | GPIO21 | LOW when pressed | Input with pull-up enabled, debounce in firmware |
| BUTTON_4 / SW4 | GPIO5 | LOW when pressed | Input with pull-up enabled, debounce in firmware |
| LED1 | GPIO1 | LOW = on | Output; drive low to turn on, high/high-Z to turn off |
| LED2 | GPIO48 | LOW = on | Output; drive low to turn on, high/high-Z to turn off |
| LED3 | GPIO47 | LOW = on | Output; drive low to turn on, high/high-Z to turn off |
| LED4 | GPIO4 | LOW = on | Output; drive low to turn on, high/high-Z to turn off |
Table
| IC1 module pin | IC1 symbol pin | ESP32-S3 GPIO | Project net / connection | Firmware role | Direction | Notes |
|---|---|---|---|---|---|---|
| 4 | IO4 | GPIO4 | R4 → LED4 cathode path | LED4 | Output | Active-low LED through 150 Ω. |
| 5 | IO5 | GPIO5 | SW4 pin 1 | BUTTON_4 | Input | Switch to GND; enable internal pull-up or add external pull-up if needed. |
| 6 | IO6 | GPIO6 | Unconnected | Spare GPIO | I/O | ADC1_CH5 / TOUCH6 capable. |
| 7 | IO7 | GPIO7 | U2 BUSY | EINK_BUSY | Input | E-ink busy/status input from display. |
| 8 | IO15 | GPIO15 | Unconnected | Spare GPIO | I/O | ADC2_CH4, U0RTS, optional 32 kHz crystal P. Avoid if using 32 kHz crystal. |
| 9 | IO16 | GPIO16 | Unconnected | Spare GPIO | I/O | ADC2_CH5, U0CTS, optional 32 kHz crystal N. Avoid if using 32 kHz crystal. |
| 10 | IO17 | GPIO17 | Unconnected | Spare GPIO | I/O | UART1 TX / ADC2_CH6 capable. |
| 11 | IO18 | GPIO18 | Unconnected | Spare GPIO | I/O | UART1 RX / ADC2_CH7 / CLK_OUT3 capable. |
| 12 | IO8 | GPIO8 | Unconnected | Spare GPIO | I/O | ADC1_CH7 / TOUCH8 capable. |
| 13 | IO19 | GPIO19 | Unconnected | USB_D− / spare | I/O | Default USB Serial/JTAG/USB OTG D− pin; avoid reusing if USB debug/download is needed. |
| 14 | IO20 | GPIO20 | Unconnected | USB_D+ / spare | I/O | Default USB Serial/JTAG/USB OTG D+ pin; avoid reusing if USB debug/download is needed. |
| 15 | IO3 | GPIO3 | Unconnected | Spare, strap-sensitive | I/O | Strapping pin for JTAG source; avoid forced reset-time levels. ADC1_CH2 / TOUCH3 capable. |
| 16 | IO46 | GPIO46 | Unconnected | Strap-sensitive spare | I/O | Strapping pin; default weak pulldown. Used with GPIO0 for boot mode. Avoid external pull-up at reset unless intentional. |
| 17 | IO9 | GPIO9 | U2 D/C | EINK_DC | Output | E-ink data/command select. |
| 18 | IO10 | GPIO10 | U2 CS | EINK_CS | Output | E-ink SPI chip-select. Usually active-low. |
| 19 | IO11 | GPIO11 | U2 SDI | EINK_MOSI | Output | E-ink SPI MOSI/data input. |
| 20 | IO12 | GPIO12 | U2 CLK | EINK_SCLK | Output | E-ink SPI clock. |
| 21 | IO13 | GPIO13 | Unconnected | Spare GPIO | I/O | ADC2_CH2 / TOUCH13 / SPI alternate capable. |
| 22 | IO14 | GPIO14 | Unconnected | Spare GPIO | I/O | ADC2_CH3 / TOUCH14 / SPI alternate capable. |
| 23 | IO21 | GPIO21 | SW3 pin 1 | BUTTON_3 | Input | Switch to GND; enable pull-up and debounce. |
| 24 | IO47 | GPIO47 | R3 → LED3 cathode path | LED3 | Output | Active-low LED through 150 Ω. |
| 25 | IO48 | GPIO48 | R2 → LED2 cathode path | LED2 | Output | Active-low LED through 150 Ω. |
| 26 | IO45 | GPIO45 | Unconnected | Strap-sensitive spare | I/O | Strapping pin; default weak pulldown. Do not pull high at reset unless VDD_SPI implications are understood. |
| 27 | IO0 | GPIO0 | PROG pin 5 | BOOT / download mode | Input strap | Pull low during reset to enter download boot; otherwise high for normal boot. Avoid large capacitance. |
| 28 | IO35 | GPIO35 | Unconnected | Reserved | Do not use | N4R8 includes Octal PSRAM; IO35 is not available for general use. |
| 29 | IO36 | GPIO36 | Unconnected | Reserved | Do not use | N4R8 includes Octal PSRAM; IO36 is not available for general use. |
| 30 | IO37 | GPIO37 | Unconnected | Reserved | Do not use | N4R8 includes Octal PSRAM; IO37 is not available for general use. |
| 31 | IO38 | GPIO38 | Unconnected | Spare GPIO | I/O | Usable GPIO; SPI alternate capable. |
| 32 | IO39 | GPIO39 | SW2 pin 1 | BUTTON_2 | Input | Switch to GND; enable pull-up and debounce. Also JTAG MTCK capable. |
| 33 | IO40 | GPIO40 | Unconnected | Spare / JTAG | I/O | JTAG MTDO capable; avoid if JTAG debug needed. |
| 34 | IO41 | GPIO41 | Unconnected | Spare / JTAG | I/O | JTAG MTDI capable; avoid if JTAG debug needed. |
| 35 | IO42 | GPIO42 | Unconnected | Spare / JTAG | I/O | JTAG MTMS capable; avoid if JTAG debug needed. |
| 36 | RXD0 | GPIO44 | PROG pin 3 | UART0_RX | Input | Default UART0 receive for programming/logs. Connect to programmer TX. |
| 37 | TXD0 | GPIO43 | PROG pin 4 | UART0_TX | Output | Default UART0 transmit for programming/logs. Connect to programmer RX. |
| 38 | IO2 | GPIO2 | SW1 pin 1 | BUTTON_1 | Input | Switch to GND; enable pull-up and debounce. ADC1_CH1 / TOUCH2 capable. |
| 39 | IO1 | GPIO1 | R1 → LED1 cathode path | LED1 | Output | Active-low LED through 150 Ω. ADC1_CH0 / TOUCH1 capable, but LED load prevents clean analog/touch use. |
Table
| IC1 module pin | Symbol pin | Firmware relevance | Notes |
|---|---|---|---|
| 2 | 3V3 | Power rail | Main 3.3 V module supply. |
| 3 | EN | Reset/enable input | Connected to R5 pull-up and PROG pin 6. Pull low to reset/disable module. Not software-controlled unless an external circuit drives it. |
| 1, 40–49 | GND_1…GND_11 | Ground | All tied to GND net. |
INPUT_PULLUP; treat pressed state as 0/LOW.Recommended firmware constants
Active levels
Schematic-derived GPIO map
Non-GPIO control and power pins
Firmware initialization suggestions