the printed Dx numbers are not identical with the GPIOs, here a listing of the GPIOs with their special functions:
Label | GPIO | Function | Serial | SPI | I2C | Notes |
D0 | 16 | GPIO | connect to RST to wake up from deep sleep | |||
D1 | 5 | GPIO | SCL | |||
D2 | 4 | GPIO | SDA | |||
D3 | 0 | GPIO | internal pullup, pulling down during boot enters flash mode | |||
D4 | 2 | GPIO | TxD1 | LED, DO NOT pull down during boot! | ||
D5 | 14 | GPIO | CLK | |||
D6 | 12 | GPIO | MISO | |||
D7 | 13 | GPIO | RxD2 | MOSI | ||
D8 | 15 | GPIO | TxD2 | DO NOT pull up during boot! DO NOT use as SPI CS or other pulled up line | ||
TX | 1 | GPIO | TxD0 | NO input, DO NOT pull down during boot! | ||
RX | 3 | GPIO | TxD1 | 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:
Label | GPIO | Function |
SD0 | 7 | GPIO |
SD1 | 8 | GPIO |
SD2 | 9 | GPIO |
SD3 | 10 | GPIO |
CMD | 11 | GPIO |
CLK | 6 | GPIO |
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