ESP8266 NodeMCU Pinout Reference
What is ESP8266?
The ESP8266 is a low-cost, highly integrated Wi-Fi microcontroller module widely used in IoT applications. Developed by Espressif Systems, it features a powerful 32-bit Tensilica L106 processor, integrated TCP/IP stack, and Wi-Fi capabilities, enabling seamless internet connectivity. The module includes GPIO pins for interfacing with sensors, actuators, and other peripherals, making it versatile for various embedded projects. With support for programming languages like Arduino IDE, MicroPython, and Lua, it is beginner-friendly yet powerful enough for advanced projects. Its small size, low power consumption, and affordability have made it a popular choice for smart home devices, automation systems, and wireless communication projects.
ESP8266 Pinout Reference
A great feature of the ESP8266 is its ample number of GPIO pins, allowing you to work with multiple peripherals without needing to juggle or multiplex them. However, it’s important to review the pinout diagram carefully, as there are a few details to keep in mind.
Keep in mind that the pinout reference below applies to the widely used 30-pin ESP8266 NodeMCU development board. While not all ESP8266 development boards expose every pin, the functionality of each pin remains consistent across different boards.
ESP8266 Peripherals and I/O
The ESP8266 NodeMCU features a total of 17 GPIO pins, which are accessible through the pin headers on either side of the development board. These pins can be configured to perform a range of peripheral functions, including:
1 ADC channel | 1 channel of 10-bit precision SAR ADC |
2 UART interfaces | 2 UART interfaces with with support for flow control |
4 PWM outputs | 4 PWM pins to control things like motor speed or LED brightness |
2 SPI and 1 I2C interfaces | Two SPI and one I2C interfaces for connecting various sensors and peripherals |
I2S interface | One I2S interface for adding sound to your project |
The ESP8266’s pin multiplexing feature enables multiple peripherals to share a single GPIO pin, allowing it to handle functions like I2C, I2S, UART, PWM, and more.
For detailed information about the ESP8266, consult the datasheet.
ESP8266 NodeMCU Pinout
The ESP8266 NodeMCU has 30 pins. For convenience, pins with similar functionality are grouped together.

Let’s explore a detailed explanation of GPIO pins of ESP8266 NodeMCU and their functions.
GPIO Pins of ESP8266 NodeMCU
The ESP8266 NodeMCU includes 17 GPIO pins that can be programmed for various functions by configuring the relevant registers. Each GPIO can be set with an
internal pull-up, pull-down, or high-impedance state.

Which ESP8266 GPIOs are safe to use?
While the ESP8266 offers many pins with different functions, not all of them may be ideal for your projects. The table below outlines which pins are safe to use and which ones require caution.
S: These pins are completely safe to use without any issues.
A: These pins may exhibit unpredictable behavior, especially during boot. Use them only if absolutely necessary.
D: It is advised to steer clear of using these pins in your projects.
Label | GPIO | Safe to use? | Reason |
D0 | GPIO16 | A | HIGH at boot, used to wake up from deep sleep |
D1 | GPIO5 | S | |
D2 | GPIO4 | S | |
D3 | GPIO0 | A | connected to FLASH button, boot fails if pulled LOW |
D4 | GPIO2 | A | HIGH at boot, boot fails if pulled LOW |
D5 | GPIO14 | S | |
D6 | GPIO12 | S | |
D7 | GPIO13 | S | |
D8 | GPIO15 | A | Required for boot, boot fails if pulled HIGH |
RX | GPIO3 | D | Rx pin, used for flashing and debugging |
TX | GPIO1 | D | Tx pin, used for flashing and debugging |
CLK | GPIO6 | D | Connected to Flash memory |
SDO | GPIO7 | D | Connected to Flash memory |
CMD | GPIO11 | D | Connected to Flash memory |
SD1 | GPIO8 | D | Connected to Flash memory |
SD2 | GPIO9 | D | Connected to Flash memory |
SD3 | GPIO10 | D | Connected to Flash memory |
A0 | ADC0 | A | Analog input pin, cannot be configured as output |
The image below shows which GPIO pins can be used safely.

ADC Pins
The ESP8266 features a 10-bit SAR ADC, enabling it to identify 1024 distinct analog levels. This allows it to convert input voltages between 0 and 3.3V (its operating voltage) into integer values from 0 to 1024. This provides a resolution of 0.0032 volts (3.2 mV) per unit, calculated by dividing 3.3 volts by 1024.

The two measurements below can be performed using the ADC, but they cannot be done simultaneously:
- Measure the VDD3P3 power supply voltage (Pin 3 and Pin 4).
- Measure the input voltage on A0.
SPI Pins
The ESP8266 includes two SPIs (SPI and HSPI) that can operate in both slave and master modes. These SPIs also support the following general-purpose features:
- 4 timing modes for SPI data transfer
- Clock speeds up to 80 MHz, along with clock divisions of 80 MHz
- A FIFO buffer of up to 64 bytes

It is possible to use SPI on any pins by ‘bitbanging’.
I2C Pins
The ESP8266 doesn’t have dedicated hardware I2C pins, but I2C communication can be achieved through ‘bitbanging.’ This method works efficiently, and the ESP8266 is fast enough to deliver speeds comparable to ‘Arduino level.’
By default, GPIO4 (SDA) and GPIO5 (SCL) are assigned as I2C pins to simplify integration with existing Arduino code, libraries, and sketches.
However, you can choose any other two GPIO pins for I2C by using the wire.begin(SDA, SCL)
command in the Arduino IDE.

UART Pins
The ESP8266 offers two UART interfaces, UART0 and UART2, which support asynchronous communication (RS232 and RS485) with speeds of up to 4.5 Mbps.
- UART0 (TXD0, RXD0, RST0, and CTS0 pins) is used for general communication.
- UART1 (TXD1 pin) provides only a data transmit signal and is typically used for log output.

RXD0 and TXD0 are the serial control and bootloading pins, mainly used for communication with the ESP module.
As these pins are connected to the USB-to-serial converter, they will also receive USB traffic, so caution should be exercised when using them.
PWM Pins
All of the ESP8266’s GPIO pins, from GPIO0 to GPIO15, can be programmed to generate pulse width modulated (PWM) outputs. The ESP8266 provides a PWM signal with a 10-bit resolution, and the PWM frequency can be adjusted within a range of 1000 μs to 10000 μs, corresponding to frequencies between 100 Hz and 1 kHz.

SDIO Pins
The ESP8266 features a single slave SDIO (Secure Digital Input/Output Interface) for connecting SD cards. It supports both SDIO v1.1 (4-bit, 25 MHz) and SDIO v2.0 (4-bit, 50 MHz).

Power Pins
The VIN pin can be used to supply power directly to the ESP8266 and its peripherals, provided you have a regulated 5V power source. The 3V3 pin provides output from the onboard voltage regulator, capable of supplying up to 600mA. GND is the ground pin.

Interrupt Pins
All GPIOs pins of ESP8266 NodeMCU can be configured as interrupts, except GPIO16.
Control Pins
The EN (also known as CH_PD or Chip Power Down) pin is the enable pin for the ESP8266, which is normally pulled high. When pulled HIGH, the chip is powered on; when pulled LOW, the chip is powered off.
The RST pin serves as the reset pin for the ESP8266 and is also pulled high by default. Momentarily pulling it LOW to ground will reset the ESP8266, similar to pressing the onboard RST button.
The FLASH pin is used by the ESP8266 to decide when to enter the bootloader. If the pin is held low during power-up, it will trigger the bootloading process, much like pressing the onboard FLASH button.
The WAKE pin is used to wake the ESP8266 from deep sleep mode.

You can Explore ESP8266/ESP32 Articles and Tutorials