Ultimate guide to ESP2866 pin/GPIO numbers

Package pin number Manufacturer name GPIO number Nodemcu name Alternative functions Notes
1 VDDA
2 LNA
3 VDD3P3
4 VDD3P3
5 VDD_RTC
6 TOUT A0 ADC 0-1.0V raw, 0-3.2V nodemcu
7 CHIP_PU EN Chip enable High ON, Low OFF (with a small current consumed)
8 XPD_DCDC GPIO16 D0 WAKE UP Connect to EXT_RSTB (RESET) to support wakeup from deep-sleep. user/reset button on modemcu - pressed LOW, user LED on nodemcu - LOW ON, no interrupt/pwm/fancy features support - only I/O
9 MTMS GPIO14 D5 HSPI_CLK, alternative I2C_SCL
10 MTDI GPIO12 D6 HSPI_MISO
11 VDDPST
12 MTCK GPIO13 D7 HSPI_MOSI, UART0_CTS, alternative UART0_RX To use alternative function please see manufacturer doc
13 MTDO GPIO15 D8 HSPI_CS, UART0_RTS, alternative USART0_TX To use alternative function please see manufacturer doc, keep LOW during boot
14 GPIO2 GPIO2 D4 USART1_TX, alternative I2C_SDA May print garbage during boot/programming, keep HIGH during boot
15 GPIO0 GPIO0 D3 SPI_CS2 On nodemcu run/flash selector - run HIGH, flash LOW
16 GPIO4 GPIO4 D2
17 VDDPST
18 SDIO_DATA_2 GPIO9 SD2 (D11) SD_D2 Connected to flash in most modules
19 SDIO_DATA_3 GPIO10 SD3 (D12) SD_D3 Connected to flash in most modules
20 SDIO_CMD GPIO11 CMD SD_CMD Connected to flash in most modules
21 SDIO_CLK GPIO6 CLK SD_CLK Connected to flash in most modules
22 SDIO_DATA_0 GPIO7 SD0 SD_D0 Connected to flash in most modules
23 SDIO_DATA_1 GPIO8 SD1 SD_D1 Connected to flash in most modules
24 GPIO5 GPIO5 D1
25 U0RXD GPIO3 D9 UART0_RX UART RX during programming
26 U0TXD GPIO1 D10 UART0_TX, SPI_CS1 UART TX during programming
27 XTAL_OUT
28 XTAL_IN
29 VDDD
30 VDDA
31 RES12K Connect to ground with 12kΩ resistor
32 EXT_RSTB RST Reset External reset, reset LOW, active HIGH