Skip to content

ESP8266 GPIO

Label GPIO Input Output Notes
D0 GPIO16 no interrupt no PWM or I2C support HIGH at boot - used to wake up from deep sleep
D1 GPIO5 OK OK often used as SCL (I2C)
D2 GPIO4 OK OK often used as SDA (I2C)
D3 GPIO0 pulled up OK connected to FLASH button, boot fails if pulled LOW
D4 GPIO2 pulled up OK HIGH at boot - connected to on-board LED, boot fails if pulled LOW
D5 GPIO14 OK OK SPI (SCLK)
D6 GPIO12 OK OK SPI (MISO)
D7 GPIO13 OK OK SPI (MOSI)
D8 GPIO15 pulled to GND OK SPI (CS) - Boot fails if pulled HIGH
RX GPIO3 OK RX pin HIGH at boot
TX GPIO1 TX pin OK HIGH at boot - debug output at boot, boot fails if pulled LOW
A0 ADC0 Analog Input X

Source


NodeMCU - GPIO ESP8266 - GPIO Behaviour - Flash Mode Behaviour - Dummy Arduino App Behaviour - Arduino Set GPIOs Low
D0 16 High High during boot, falls after ~110ms (to ~1V?) High during boot, falls after ~110ms (to ~1V)
D1 5 Low Low Low
D2 4 Low Low Low
D3 0 Low then oscillates Varies, stabilizes high after ~100ms Varies, stabilizes low after ~110ms
D4 2 Varies, stabilizes high after ~60ms Varies, stabilizes high after ~70ms Varies, stabilizes low after ~110ms
D5 14 High High, then low after ~110ms High, then low after ~110ms
D6 12 High High, then low after ~110ms High, then low after ~110ms
D7 13 High High, then low after ~110ms High, then low after ~110ms
D8 15 Low Low, with glitch ~110ms Low, with glitch ~110ms
D9 3 Low Low until ~50ms then high Low until ~50ms then high until ~110ms then low
D10 1 Low Low until ~50ms then high Low until ~50ms then high until ~110ms then low

Conclusion: GPIOs D1 and D2 are the only safe GPIOs I can use to drive relays if I don't want them to operate autonomously at boot.

Source