# ESP8266 Pinout Guide: Complete GPIO Reference & IoT Project Tips

Understand ESP8266 GPIO functions, power and boot pins, ADC limits, and practical wiring considerations for IoT projects.

Written by [Jharwin Barrozo](https://flux.seobdtools.com/jharwinbarrozo)

Published Oct 2026 - 10 min read

[![3d rendered of an ESP8266 microcontroller board, showing its compact size with the Wi-Fi module, chip antenna, and GPIO pins clearly visible, ideal for embedding wireless internet connectivity into DIY electronics projects.](https://flux.seobdtools.com/p/assets/blogs/everything-about-esp8266/main.webp)](#)

## The **ESP8266** has become a cornerstone in the **IoT (Internet of Things)** world, thanks to its built-in Wi-Fi capabilities and affordability. Whether you're a hobbyist or professional developer, understanding the **ESP8266 pinout** is essential to building reliable, optimized IoT devices.

Check the exact board variant before applying a pinout diagram. NodeMCU and D1 mini labels map to ESP8266 GPIO numbers differently, and breakout boards add their own regulators and USB circuitry.

In this guide, we’ll walk through:

-   GPIO functions and quirks
-   Power pin usage
-   Boot mode behavior
-   Real-world IoT use cases
-   Arduino IDE compatibility
-   Recommended boards like the [Wemos D1 Mini](https://flux.seobdtools.com/jharwinbarrozo/wemos-d1-mini-template)

## 📌 What Is the ESP8266?

The [ESP8266](https://flux.seobdtools.com/projects/b290a4ac-71aa-9cc9-2772-dc001701a34f) is a low-cost Wi-Fi microcontroller by Espressif. It enables wireless IoT projects without needing a separate Wi-Fi module. Popular boards like the [NodeMCU](https://flux.seobdtools.com/jharwinbarrozo/nodemcu-12e-esp8266?editor=pcb_3d) and [Wemos D1 Mini](https://flux.seobdtools.com/jharwinbarrozo/wemos-d1-mini-template) use it as their core.

### The Core of the Matter - Understanding the ESP8266 Pinout

The ESP8266 microcontroller module features a total of 32 pins, each with a function that contributes to its remarkable utility. Here, we'll break down these key specifications to provide a clear understanding of its pinout:

1.  **Communication Interfaces:** The ESP8266 supports a variety of communication protocols, including UART, SPI, and I2C, making it compatible with a wide range of sensors and devices.
2.  **Digital and Analog Pins:** Out of the 32 pins, there are 17 GPIO (General-Purpose Input/Output) pins, which can be used for both digital input and output operations.
3.  **Voltage Range for Analog Inputs:** If you're dealing with analog sensors, the ESP8266 has you covered with a voltage range of 0-1.0V for its single analog input pin, making it suitable for a variety of analog sensors.
4.  **Maximum Current Output:** The ESP8266 pins can source or sink up to 12mA individually and up to 72mA in total, so it's important to plan your connections accordingly to avoid overloading.
5.  **Max Bitrate:** When it comes to data transfer, the ESP8266 boasts an impressive maximum bitrate of up to 2 Mbps, ensuring speedy data exchange with other devices in your IoT ecosystem.

## ⚙️ ESP8266 Pinout Overview

The bare ESP8266 is a 3.3 V device. A development board may accept 5 V at USB or a designated input, but its GPIO pins are not generally 5 V tolerant.

The ESP8266 features 32 pins, but not all are usable for general I/O. Here’s a breakdown:

### Communication Interfaces

-   **UART**: GPIO1 (TX), GPIO3 (RX)
-   **SPI**: GPIO12 (MISO), GPIO13 (MOSI), GPIO14 (SCLK), GPIO15 (CS)
-   **I2C (software)**: GPIO5 (SCL), GPIO4 (SDA)

### What are the Power Pins of ESP8266?

You can power ESP8266 directly via the USB connector (standard USB = 5V) or the Vin pin (5V to 10V). The regulator provides a maximum of 500mA.

These are the power pins of this microcontroller board:

| Pin Name | Description | | :=== | :=== | | Vin | Can be used to directly supply the NodeMCU/ESP8266 and its peripherals. Power delivered on VIN is regulated through the onboard regulator on the NodeMCU module – you can also supply 5V regulated to the VIN pin | | GND | Ground - reference voltage for voltage input | | 3V3 | Output of the onboard voltage regulator (AMS1117-3.3) and can be used to supply power to external components. | | VU\* | On some models, this pin is not connected. But in Lolin's V3 model, this provides a 5V output provided directly by USB. |

### GPIO Number Doesn’t Match the Label on the Board Silkscreen?

It's essential to realize that the GPIO labeling on the ESP8266 does not correspond directly to the silkscreen markings on the board. For instance, the pin marked as D0 is actually GPIO16, while the one labeled D1 is in fact GPIO5.

The table below outlines the relationship between the silkscreen labels on the board and the actual GPIO numbers, detailing the most suitable pins for your projects and highlighting those that require careful handling.

| Board Label | GPIO | As Input | as Output | Precaution | | :=== | :=== | :=== | :=== | :== | | D0 | GPIO16 | No Interrupt | Non- PWM or I2C | HIGH during boot, used to wake up from deep sleep mode | | D1 | GPIO5 | OK | OK | Usually used as SCL | | D2 | GPIO4 | OK | OK | Usually used as SDA | | D3 | GPIO0 | Pulled up | OK | Directly connected to the Flash button, boot will fail if pulled LOW | | D4 | GPIO2 | Pulled up | OK | HIGH during boot, connected to the onboard LED, boot will fail 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 during boot | | TX | GPIO1 | TX pin | OK | HIGH during boot, debug output at boot, boot will fail if pulled LOW | | A0 | ADC0 | Analog Input | Don't Use | |

### Which GPIOs connected to the Flash Chip?

**GPIO6** to **GPIO11** are usually connected to the flash chip in ESP8266 boards. So, these pins are not recommended to use.

### Which Pins are Used During Boot?

The ESP8266 can be prevented from booting if some pins are pulled LOW or HIGH. Boot-strapping pins need defined levels during reset; an attached sensor or pull resistor can prevent startup even when the same GPIO works normally after boot. The following list shows the state of the following pins during BOOT:

| GPIO | During Boot Behaviour | | :=== | :=== | | GPIO16 | Pin is HIGH during boot | | GPIO0 | Boot will fail if pulled LOW | | GPIO2 | Pin is HIGH during boot, boot failure if pulled LOW | GPIO15 | Boot failure if pulled HIGH | | GPIO3 | Pin is HIGH during boot | | GPIO1 | Pin is HIGH during boot, boot failure if pulled LOW | | GPIO10 | Pin is HIGH during boot | | GPIO9 | Pin is HIGH during boot |

### Which GPIOs are the safest to use to operate coil relays?

-   **GPIO4**
-   **GPIO5**

[

![3D PCB view of the project](https://flux.seobdtools.com/p/assets/featured_projects/pcb3d_preview/bee-hotel.webp)

](https://flux.seobdtools.com/markwuflux/sf-hackathon-2023-bee-hotel-r0p5)[Bee Hotel](https://flux.seobdtools.com/markwuflux/sf-hackathon-2023-bee-hotel-r0p5)

### How Many Analog Inputs Does the ESP8266 Have?

ESP8266 only has one analog input, it's the ADC0 pin, usually labelled as A0 on the board. If you're using the bare ESP8266 chip, the maximum input voltage range of this ADC0 is 0 to 1V, for development board like NodeMCU ESP8266 12-E, the voltage input range is 0 to 3.3V due to presence of internal voltage divider. If you need to scale a larger sensor voltage down into that window, size the resistors with our [voltage divider calculator](https://flux.seobdtools.com/p/tools/voltage-divider-calculator). The chip ADC's input range and a development board's A0 range may differ because some boards include a voltage divider. Confirm the exact board schematic before connecting an analog sensor.

This ADC pin has a 10-bit resolution, which means you’ll get values between 0 and 1023.

### Which GPIOs Can I Use for the I2C Interface?

Unlike other microcontrollers, the ESP8266 lacks dedicated hardware for I2C; however, I2C functionality can be implemented in software, allowing any GPIOs to be used for I2C purposes. Commonly, the following GPIOs are used as I2C pins:

-   **GPIO5**: SCL
-   **GPIO4**: SDA

```
#include <Wire.h>

// Initialize software I2C on ESP8266 using different pins
void setup() {
  Wire.begin(D2, D1); // D2 as SDA, D1 as SCL
}

void loop() {
  Wire.beginTransmission(0x3C); // Start I2C Transmission
  // ... send data or commands to an I2C device
  Wire.endTransmission(); // Stop I2C transmission
  delay(1000); // Wait for a second
}
```

### ESP8266 SPI (Serial Peripheral Interface) Pins

The pins used as SPI in the ESP8266 are:

-   **GPIO14**: SCLK
-   **GPIO15**: CS
-   ‍**GPIO12**: MISO**‍**
-   **GPIO13**: MOSI

### Can I Use Any GPIO as Interrupt Pins?

The ESP8266 supports interrupts in any GPIO, except **GPIO16**.

### Harnessing the Versatility of GPIO Pins in a Practical IoT Project

The GPIO pins on the esp8266 are the backbone of its versatility, allowing you to connect various components to create a wide array of IoT applications. To illustrate their practical utility, let's consider a simple project: building a weather monitoring station.

1.  **GPIO0 - Connecting a Rain Sensor (digital input)**: By configuring the GPIO0 pin as a digital input, the microcontroller can detect when it's raining and log data accordingly. This information can be sent to a remote server, enabling users to access real-time rainfall data from their IoT device.
2.  **GPIO4 & GPIO5 - OLED Display (I2C communication)**: Esp8266 can be used to establish I2C (Inter-Integrated Circuit) communication for an OLED display. GPIO4 would be used as the SDA (data), while GPIO would be used as the SCL (clock). This display can provide users with real-time weather information in a user-friendly format.
3.  **GPIO1 - Connecting an Anemometer (digital input)**: By configuring the GPIO1 pin as a digital input, the esp8266 can record wind speed data.
4.  **ADC0 - Interfacing with a Light Sensor (analog input)**: A0 can be configured as an analog input for interfacing with a light sensor to provide ambient light conditions. It can then, for example, it can be used to trigger the OLED display's backlight when it gets dark.

And with the many additional pinouts, our weather monitoring station can always be improved--add a temperature sensor to GPIO2, or a humidity sensor to GPIO3!

[

![3D PCB view of the project](https://flux.seobdtools.com/p/assets/featured_projects/pcb3d_preview/risk-meter-pcb.webp)

](https://flux.seobdtools.com/jr98/environmental-exposure-risk-meter)[Environmental Exposure Risk Meter](https://flux.seobdtools.com/jr98/environmental-exposure-risk-meter)

### Compatibility with Arduino IDE

The esp8266 pinout is also perfect for developers who are already comfortable with the Arduino IDE, as they seamlessly integrate, making the esp8266 widely accessible.

Using the Arduino IDE with the esp8266 offers several benefits:

1.  **Familiar Environment:** If you're already accustomed to the Arduino IDE, transitioning to the esp8266 becomes a breeze. You can leverage your existing knowledge and libraries to accelerate your IoT projects.
2.  **Large Community Support:** The Arduino community is vast, and you can tap into a wealth of resources, tutorials, and forums to get help when needed.
3.  **Extensive Library Support:** Arduino IDE compatibility means access to a vast library of pre-written code, which can significantly reduce development time.
4.  **Cross-Platform Compatibility:** Develop on one platform and easily migrate your code to different boards, such as the esp32, without significant modifications.

### Wemos D1 Mini - A Popular Esp8266 Development Board

[

![A topview of Wemos D1 mini microcontroller board](https://flux.seobdtools.com/p/assets/blog-content/66fd7420dcd36e846fb3d66f_654b1e975b7b00835ef62ce2_wemos-d1-mini.webp)

](https://flux.seobdtools.com/jharwinbarrozo/wemos-d1-mini-template)

Check out this template for [Wemos D1 mini](https://flux.seobdtools.com/jharwinbarrozo/wemos-d1-mini-template).

When it comes to practical application, the Wemos D1 Mini, built around the esp8266, is a favorite among developers. Its compact size, affordability, and extensive support from the maker community have made it a go-to choice for IoT projects.

Here are some reasons why the Wemos D1 Mini is an excellent choice:

1.  **Compact Form Factor:** The small size of the Wemos D1 Mini makes it ideal for projects with limited space requirements.
2.  **Easy to Use:** The board comes with built-in USB-to-serial conversion, eliminating the need for external programmers.
3.  **Abundant Shields and Accessories:** The Wemos ecosystem offers a wide range of shields and accessories, making it easy to expand your project's capabilities.
4.  **Built-in Wi-Fi:** Just like the esp8266, the Wemos D1 Mini has built-in Wi-Fi support, making it an ideal choice for connected IoT applications.

In the evolving landscape of IoT, the esp8266 pinout is highly versatile. Its GPIO pins, compatibility with Arduino IDE, I2C capabilities, and integration into popular development boards like the Wemos D1 Mini provide a robust foundation for your IoT projects. However, if you're looking for something more, then check out its sibling, the esp32. The esp32 retains the flexibility of the esp8266 pinout while offering more processing power, built-in Bluetooth, and dual-core processing. This opens up new opportunities for more complex and feature-rich IoT applications.

## About the author

[Jharwin Barrozo](https://flux.seobdtools.com/jharwinbarrozo)

Electronics Engineer at Flux

Jharwin is an electronics engineer mainly focused on satellites. He built his own ground station using Flux to monitor RF activities on the International Space Station. Find him on Flux [@jharwinbarrozo](https://flux.ai/jharwinbarrozo)

Let’s start building

Build your big idea together with Flux. All you need to do is describe what you want to make, or what problem you want to solve. Flux will work with you to make it a reality.

![Close-up photo of a PCB made with Flux, with an ESP32 module, buttons, and a microSD slot.](https://flux.seobdtools.com/p/assets/blogs/miscellaneous/sidebar-cta-pcb.webp) [Try it Free](https://flux.seobdtools.com/signup)

## More in Component & Platform Guides

[

![A 3d model of arduino uno board](https://flux.seobdtools.com/p/assets/blogs/arduino-getting-started/main.webp)

### Arduino Uno Basics: Beginner's Guide to Getting Started

15 Min Read](https://flux.seobdtools.com/p/blog/arduino-uno-basics-beginners-guide-to-getting-started)[

![ESP32 Board with its pinout label and diagram, each pin label and function on different colors](https://flux.seobdtools.com/p/assets/blogs/esp32-pinout/main.webp)

### ESP32 Pinout Guide: Everything You Need to Know

11 Min Read](https://flux.seobdtools.com/p/blog/esp32-pinout-everything-you-need-to-know)[

![A raspberry pi 3B and zero boards laid out together showing graphical GPIO pinout](https://flux.seobdtools.com/p/assets/blogs/raspberry-pi-guide/main.webp)

### Raspberry Pi Pinouts: A Comprehensive Guide

8 Min Read](https://flux.seobdtools.com/p/blog/raspberry-pi-pinouts-a-comprehensive-guide)[

![An arduino uno microcontroller board with its sketch code on Arduino IDE being used as background in a monitor.](https://flux.seobdtools.com/p/assets/blogs/arduino-code-guide/main.webp)

### Arduino Code for Beginners: How to Write Your First Sketch

8 Min Read](https://flux.seobdtools.com/p/blog/arduino-code-a-comprehensive-guide-for-beginners)[

![Meet the Arduino Nano R4: Why Is This Tiny Upgrade So Big for Makers?](https://flux.seobdtools.com/p/assets/blogs/arduino-nano-r4/main.webp)

### Meet the Arduino Nano R4: Why Is This Tiny Upgrade So Big for Makers?

6 Min Read](https://flux.seobdtools.com/p/blog/meet-the-arduino-nano-r4-why-is-this-tiny-upgrade-so-big-for-makers)[

![A microcontroller board with the words Arduino Pro Micro on it.](https://flux.seobdtools.com/p/assets/blogs/arduino-pro-micro/main.webp)

### What is Arduino Pro Micro: a Comprehensive Introduction for Novices

5 Min Read](https://flux.seobdtools.com/p/blog/what-is-arduino-pro-micro-a-comprehensive-introduction-for-novices)[

![Schematic diagram of arduino uno board with all of its passive and active components](https://flux.seobdtools.com/p/assets/blogs/arduino-uno-schematic-diagram/main.webp)

### Arduino Uno Schematic Diagram: A Comprehensive Guide

8 Min Read](https://flux.seobdtools.com/p/blog/arduino-uno-schematic-diagram)[

![Side by side comparison of the 3 powerful and most common Arduino microcontroller boards; Arduino Mega 2560, Arduino Uno and Arduino Micro.](https://flux.seobdtools.com/p/assets/blogs/arduino-mega-uno-micro/main.webp)

### Arduino Mega vs. Uno vs. Micro: Key Differences

6 Min Read](https://flux.seobdtools.com/p/blog/what-is-the-real-difference-arduino-mega-vs-micro-vs-uno)[

![Different packages or footprint of famous atmega328p microcontroller with its pinout](https://flux.seobdtools.com/p/assets/blogs/atmega328p-still-top-choice/main.webp)

### Why Atmega328p is Still a Top Choice for Microcontroller Projects in 2023

8 Min Read](https://flux.seobdtools.com/p/blog/why-atmega328p-is-still-a-top-choice-for-microcontroller-projects-in-2023)[

![ESP32 Chip in a dark background: A powerful microcontroller with integrated Wi-Fi and Bluetooth, driving IoT innovation with seamless connectivity.](https://flux.seobdtools.com/p/assets/blogs/esp32-history/main.webp)

### Exploring ESP32: from History to Application

3 Min Read](https://flux.seobdtools.com/p/blog/exploring-esp32-from-history-to-application)[

![Attiny85 chip in two different packages viewed on top, also showing pinout diagram](https://flux.seobdtools.com/p/assets/blogs/attiny85/main.webp)

### Introduction to the ATtiny85 Microcontroller

12 Min Read](https://flux.seobdtools.com/p/blog/introduction-to-the-attiny85-microcontroller)[

![STM32 microcontroller chip overview – Why choose STM32? Discover STM32F4 ARM-based processors, optimized for performance with USB OTG, SWD, and UART support](https://flux.seobdtools.com/p/assets/blogs/stm32-things-you-need-to-know/main.webp)

### STM32: Things You Need to Know

10 Min Read](https://flux.seobdtools.com/p/blog/stm32-things-you-need-to-know)[

![A microcontroller board beside a wireless module on dark circuit boards.](https://flux.seobdtools.com/p/assets/blogs/stm32-vs-esp32/main.webp)

### STM32 vs ESP32: Which Microcontroller Should You Choose?

14 Min Read](https://flux.seobdtools.com/p/blog/stm32-vs-esp32)[

![Arduino Nano Guide](https://flux.seobdtools.com/p/assets/blogs/arduino-nano-guide/main.webp)

### Arduino Nano Guide

10 Min Read](https://flux.seobdtools.com/p/blog/arduino-nano-guide)[

![A top view photo of raspberry pi zero 2 w board](https://flux.seobdtools.com/p/assets/blogs/pi-zero-2w/main.webp)

### Raspberry Pi Zero 2 W Review: a Powerful and Affordable Mini Computer

9 Min Read](https://flux.seobdtools.com/p/blog/raspberry-pi-zero-2-w-review-a-powerful-and-affordable-mini-computer)[

![RP2350 A4 Stepping: Why Raspberry Pi Pico’s Latest Upgrade Changes Everything](https://flux.seobdtools.com/p/assets/blogs/rp2350-a4-stepping/main.webp)

### RP2350 A4 Stepping: Why Raspberry Pi Pico’s Latest Upgrade Changes Everything

8 Min Read](https://flux.seobdtools.com/p/blog/rp2350-a4-stepping-why-raspberry-pi-picos-latest-upgrade-changes-everything)[

![Photos of Raspberry Pi Pico 2 PCB board and its predecessor Raspberry Pi Pico boards laid out with a text suggesting their key differences](https://flux.seobdtools.com/p/assets/blogs/pi-pico-vs-pi-pico-2/main.webp)

### Raspberry Pi Pico 2 vs Pico: Key Differences and Upgrades

8 Min Read](https://flux.seobdtools.com/p/blog/whats-new-in-the-raspberry-pi-pico-2-a-showdown-with-the-original-raspberry-pi-pico)[

![Two Raspberry Pi RP2350 microcontroller packages, shown from the top and underside.](https://flux.seobdtools.com/p/assets/blogs/rp2350-vs-rp2354/main.webp)

### RP2350 vs RP2354: Four Microcontroller Variants Compared

18 Min Read](https://flux.seobdtools.com/p/blog/rp2350-vs-rp2354)[

![Choosing the Right Platform to Build Your Project](https://flux.seobdtools.com/p/assets/blogs/choosing-the-right-microcontroller/main.webp)

### Choosing the Right Platform to Build Your Project

10 Min Read](https://flux.seobdtools.com/p/blog/choosing-the-right-platform-to-build-your-project)[

![Raspberry pi boards and arduino boards laid out side by side.](https://flux.seobdtools.com/p/assets/blogs/arduino-vs-raspberry-pi/main.webp)

### Arduino vs. Raspberry Pi: Key Differences and Which to Choose

8 Min Read](https://flux.seobdtools.com/p/blog/arduino-vs-raspberry-pi-comparison)[

![ESP32 boards and Arduino boards side by side, highlighting the comparison between these popular IoT microcontroller platforms.](https://flux.seobdtools.com/p/assets/blogs/esp32-vs-arduino/main.webp)

### ESP32 vs Arduino: Key Differences & Which to Choose?

8 Min Read](https://flux.seobdtools.com/p/blog/esp32-vs-arduino)[

![arduino board and text suggesting this is all about the arduino map () function](https://flux.seobdtools.com/p/assets/blogs/arduino-map-function/main.webp)

### How to Use the Arduino map() Function: A Complete Guide

4 Min Read](https://flux.seobdtools.com/p/blog/how-to-use-the-arduino-map-function-a-complete-guide)[

![A simplified schematic diagram illustrates how pull-up and pull-down resistors are utilized in microcontroller applications](https://flux.seobdtools.com/p/assets/blogs/pull-up-down-resistors/main.webp)

### Understanding Pull-up and Pull-down Resistors: A Guide for Arduino and Microcontrollers

7 Min Read](https://flux.seobdtools.com/p/blog/understanding-pull-up-and-pull-down-resistors-a-guide-for-arduino-and-microcontrollers)[

![What Is an Open Circuit? Causes, Examples, and Troubleshooting](https://flux.seobdtools.com/p/assets/blogs/what-is-an-open-circuit/main.webp)

### What Is an Open Circuit? Causes, Examples, and Troubleshooting

10 Min Read](https://flux.seobdtools.com/p/blog/what-is-an-open-circuit)[

![An HX711 load cell amplifier board connected to a load cell and an Arduino.](https://flux.seobdtools.com/p/assets/blogs/hx711-load-cell-amplifier/main.webp)

### HX711 Load Cell Amplifier: Wiring, Calibration, and PCB Design Guide

8 Min Read](https://flux.seobdtools.com/p/blog/hx711-load-cell-amplifier)[

![A 7-segment display wired to an Arduino with current-limiting resistors.](https://flux.seobdtools.com/p/assets/blogs/7-segment-display-arduino/main.webp)

### How to Connect a 7-Segment Display to Arduino: Wiring and Code

9 Min Read](https://flux.seobdtools.com/p/blog/7-segment-display-arduino)[

![Three semiconductor packages on a circuit board with illuminated traces.](https://flux.seobdtools.com/p/assets/blogs/fpga-vs-microcontroller-vs-asic/main.webp)

### FPGA vs Microcontroller vs ASIC: A Design Guide

13 Min Read](https://flux.seobdtools.com/p/blog/fpga-vs-microcontroller-vs-asic)

See All (27)

## Let’s start building.

Let’s build your idea together. All you need to do is describe what you want to make, or what problem you want to solve. Flux will work with you to make it a reality.

[Try it Free](https://flux.seobdtools.com/signup)

 ![Close-up of a Flux-designed printed circuit board](https://flux.seobdtools.com/p/assets/homepage-v2/mission-visual.webp)
