ESP8266 GPIO Reference
ESP8266 GPIO Reference
The ESP8266 provides a limited number of General Purpose Input/Output (GPIO) pins. While many of these pins can be used for pixels, serial interfaces, sensors, or other functions, several also affect the processor's boot process and require special consideration.
This page summarizes the GPIO pins commonly available on ESP8266 development boards and provides recommendations for their use in DIY Christmas lighting projects.
GPIO Number vs. Board Labels
Many ESP8266 development boards use labels such as **D0**, **D1**, **D2**, etc.
These labels are not the GPIO numbers used by firmware.
For example:
| Board Label | GPIO |
|---|---|
| D0 | GPIO16 |
| D1 | GPIO5 |
| D2 | GPIO4 |
| D3 | GPIO0 |
| D4 | GPIO2 |
| D5 | GPIO14 |
| D6 | GPIO12 |
| D7 | GPIO13 |
| D8 | GPIO15 |
Always configure firmware using the GPIO number rather than the printed board label.
Boot Strap Pins
Several GPIO pins determine how the ESP8266 starts after reset.
| GPIO | Normal Boot Requirement |
|---|---|
| GPIO0 | HIGH |
| GPIO2 | HIGH |
| GPIO15 | LOW |
Driving these pins to the wrong state during power-up may prevent the ESP8266 from starting normally.
Recommended GPIO
For most Christmas lighting applications, the following pins are excellent choices:
- GPIO4
- GPIO5
- GPIO12
- GPIO13
- GPIO14
These pins work well for:
- Pixel outputs
- Relay outputs
- General digital I/O
Use With Care
The following GPIO pins have limitations:
| GPIO | Notes |
|---|---|
| GPIO0 | Boot strap pin |
| GPIO2 | Boot strap pin |
| GPIO15 | Boot strap pin |
| GPIO16 | Deep-sleep wake pin; limited capabilities |
These pins can still be used successfully if their boot requirements are understood.
Pins Not Normally Available
GPIO6 through GPIO11 are connected internally to the ESP8266 flash memory.
These pins are not normally available for external use on development boards.
UART Pins
The hardware serial interface uses:
- GPIO1 (TX)
- GPIO3 (RX)
These pins are commonly used during programming and for serial debugging.
Although they may be used for other purposes after boot, doing so can complicate programming and troubleshooting.
Analog Input
The ESP8266 provides one analog input:
- ADC0 (A0)
Most development boards scale this input for higher voltages, but the actual input range depends on the board design.
Always verify the specifications of the specific board before applying an analog voltage.
Christmas Lighting Recommendations
For most WLED and ESPixelStick installations:
- Use GPIO4, GPIO5, GPIO12, GPIO13, or GPIO14 whenever possible.
- Avoid boot strap pins unless necessary.
- Verify GPIO numbers rather than board labels.
- Test wiring before final installation.
- Use a series resistor (typically 220–470 Ω) on long pixel data lines.