Language: EN

que-pines-puedo-usar-esp8266

Which pins can I use on an ESP8266

In the previous entry, we saw the different pins of the ESP8266 and their functionalities. But we already mentioned that not all pins are safe to use in our projects.

This is because some pins have specific functions or play a crucial role in the boot process of the device. If used incorrectly, this can generate a conflict and cause our project not to boot, or even break something.

Of the 17 GPIO (0 to 16):

  • 6 GPIO (GPIO6 to GPIO11) are used to connect via SPI with the flash memory, so we cannot use them.
  • GPIO0, GPIO2, and GIPO15 are involved in the boot process, with the considerations we discussed in the previous section.
  • GPIO1 and GPIO3 are used for Serial communication (UART)

Summary of the pins

To avoid setbacks and ensure that we are using the pins appropriately, we have the following reference table. It allows us to quickly verify which pins are safe for use and which have specific functions that we need to take into account.

Before starting any project with the ESP8266, it is highly recommended to consult this reference table and familiarize yourself with the characteristics of each pin. This will allow us to make informed decisions and avoid potential inconveniences in the development of our projects.

GPIOPinInputOutputComments
GPIO0D3⚠️Pulled Up✔️Boot fails if pulled LOW
Connected to FLASH button
GPIO1TX⚠️TX✔️HIGH during
Boot fails if pulled LOW
Debug output on boot
Not usable if UART is used
GPIO2D4⚠️Pulled Up✔️HIGH during boot
Boot fails if pulled LOW
Built-in LED
TX1
GPIO3RX✔️⚠️RXHIGH during boot
Not usable if UART is used
GPIO4D2✔️✔️SDA (I2C)
(frequently)
GPIO5D1✔️✔️SCL (I2C)
(frequently)
GPIO6-11-Used by FLASH memory
GPIO12D6✔️✔️MISO (SPI)
GPIO13D7✔️✔️MOSI (SPI)
GPIO14D5✔️✔️SLCK (SPI)
GPIO15D8⚠️Pulled to GND✔️CS (SPI)
LOW during boot
Boot fails if pulled HIGH
No Pull-Up
GPIO16D0⚠️No interrupts⚠️No PWM
⚠️No I2C
HIGH during boot
Pull-Down resistor
Connect to RST for Wake-Up
ADC0A0⚠️Analog Input

In the upcoming entries, we will look at different development boards like the NodeMCU that integrate the ESP8266 and start programming it.