ESP 8266 boards

the printed Dx numbers are not identical with the GPIOs, here a listing of the GPIOs with their special functions:

LabelGPIOFunctionSerialSPII2CNotes
D016GPIO connect to RST to wake up from deep sleep
D1 5GPIO SCL
D2 4GPIO SDA
D3 0GPIO internal pullup, pulling down during boot enters flash mode
D4 2GPIOTxD1 LED, DO NOT pull down during boot!
D514GPIO CLK
D612GPIO MISO
D713GPIORxD2MOSI
D815GPIOTxD2 DO NOT pull up during boot! DO NOT use as SPI CS or other pulled up line
TX 1GPIOTxD0 NO input, DO NOT pull down during boot!
RX 3GPIOTxD1 NO output
A0 ADC0 NO output, 0..1V

I2C: the ESP8266 has no hardware I2C, so a software emulation is used, which is usually on GPIO 4, 5, but could be somewhere else.

ext. IRQ: any GPIO can be used for this, except GPIO 16.

on larger boards there are additionally these pins:

LabelGPIOFunction
SD0 7GPIO
SD1 8GPIO
SD2 9GPIO
SD310GPIO
CMD11GPIO
CLK 6GPIO

ESP 32 Boards

GPIO Funktion Serial SPI I2C ADC DAC RTC_GPIO Hinweise
0 GPIO 11 pulled-up, sends PWM signal during boot
1 GPIO TxD output only
2 GPIO 12 onboard LED
3 GPIO RxD input only
4 GPIO 10
5 GPIO sends PWM signal during boot
6-11 GPIO DO NOT use (internal SPI flash)
12 GPIO 15 DO NOT pupp-up during boot
13 GPIO 14
14 GPIO 16 sends PWM signal during boot
15 GPIO 13 sends PWM signal during boot
16 GPIO
17 GPIO
18 GPIO CLK
19 GPIO MISO
21 GPIO SDA
22 GPIO SCL
23 GPIO MOSI
25 GPIO DAC1 6
26 GPIO DAC2 7
27 GPIO 17
32 GPIO ADC1 CH4 9
33 GPIO ADC1 CH5 8
34 GPIO ADC1 CH6 4 input only
35 GPIO ADC1 CH7 5 input only
36 GPIO ADC1 CH0 0 input only
37 ADC1 CH1
38 ADC1 CH2
39 GPIO ADC1 CH3 3 input only

There is also ADC2, but since it does not work with WiFi at the same time it is useless.

The ADC does not work below 0.1V or above 3.2V