ESP8266 GPIO pins info, restrictions and features

hi blynkers!

the esp8266 mcu is widely used in iot projects. however, most gpio pins on this mcu have special / multiple functionality and are not safe to use in all circumstances.

these “features” are still not well documented and not explained in a friendly manner for newbies. i see lots of cases when the “issues” are simply caused by not knowing which pins to use in which case.

here is a basic table for startup. i’ve collected the info from various sources on the internet, there could be erroneous or missing informations, so, please comment if something is off…

and here is the google sheet, with additional tables and info

edit: i’ve updated the google sheet, so in the far right it now shows the sonoff th10/16 and 4ch pin usage

Digital pins turns HIGH on my NodeMcu V3
[Solved] Wemos D1 mini + dht11 shield + example = Failed to read from DHT sensor!
ESP8266 running 3 soil moisture sensors?
Disconnecting issues after adding any pinMode(xxxx, INPUT); and other random events
Help flashing blynk on ESP8266 with tls usb
Please help, ESP8266 won't upload sketches anymore!
Nodemcu problem when electricity cut off and come back
Reboot a digital Pin assigned button
Turn on 4 Relays with One button using Blynk
Pulse olfactometer
Problem using physical 4 buttons using Nodemcu esp8266 to switch relays
Problem in Blynk app
Motor Not working backwards
When the nodemcu units starts all the 4 relay on their self,
I have a problem in my project
SOLVED: Any timer kills my sketch (ESP core version)
How can i “write code around it” and use the GPS streaming? I really want the GPS trigger on IOS
How to use feedback on Blynk app
Problem reading 433mhz signals
Unwanted flash (Relay chatter at boot)
Esp8266 turns the relay automatically on after reboot in syncall()
Esp8266 turns the relay automatically on after reboot in syncall()
Virtual Pin state change disconnect
MP3 Remote Control + ESP-01 + Blynk QR Code
Please help with ESP8266 sketch
Garage door project with WeMos D1 mini + sheilds + Blynk
NodeMCU With Simple Water Sensor
Relay 1 Button 2 Task
ESP8266 Thing Dev board won't go online
Learning how to combine a NodeMCU(ESP8266 based µC) with the Blynk application!
ESP8266 HVAC control
Any different option/setting to choose between ESP12E and NodeMcu
Storing the last state of a relay in EEPROM of NodeMcu?
D0 on esp8266 always 1
AM2302 sensor (Failed to read from DHT sensor!)
Tryng to control the 8 relay channel
BLE, HC-05, ZS-040 Frustrations
Temperatura controlata cu Blynk
Can't read 2nd temperature sensor
BH1750 DS18B20 and DHT11
Some problems about my moisture sensor and gauge
Quick question about Bridge widget
PC power through Blynk
Doubts to flash NodeMCU + Garden Project
Problem with Nodemcu
Emulate a NEC TV Remote Control & send WiFi signals to an IR transceiver
ESP 12 worked fine, now disconnects all the time. Server error?
Need help with hx711
URL for IFTTT from Dubai, UAE and Cavite, Philippines
Nodemcu boot problem - TIP120 to control ground project
Need help to replace 4 potentiometer by a nodemcu to control it by using blynk to control 4servos
An issue with esp8266 and relay
Esp8266 NodeMcu with Blynk Issue
Servo controlled over wifi with Blynk
Relay default low can't booting the nodemcu
Serial monitor works fine , but not when it is connected to blynk
Wemos Mega/Arduino Mega + ESP8266 Problems getting signal strenght (rssi)
Need help with flow sensor
Sensor and status text OPEN or ClOSED
DHT22 Garbage Value
Magnetic door sensor
Disconnection Problems with Wemos Board
WDT Reset my ESP boards (ESP32/ESP8266)
ESP32 GPIO pins info, restrictions and features
Could not open port COM4 (ESP8266)
Relay Module Problem
NodeMCU v3 esp8266 периодично дисконектится
NodeMcu or Wemos D1 Mini?
Relays, weather station. Ok code- keeps disconnecting
Need Assistance with ZCD (Triac Dimmer Program ) ESP8266
Connecting to MOS Driver
Which board should I choose for my first Blynk project?
Multiply function code
Motion Detect Relay On
Water Tank Level Indicator with Low Level Warning Notifications
Change state of graphical buttons on bynk by another button command
Multiply function code
LCD Wemos and switch
Timer Start and stop on simple Relay
Reading DHT22 sensor with interruption
Need Help in webhook, IFTTT
Home automation using nodemcu + relay

Have you by a chance ESP32 table like the above?

not yet. though i own some esp32 and i’m interested, but yet i consider the es32 arduino core too buggy and infant for production.

if there will be at least some basic docs and a stable arduino core, i will look into that…

There is one, done by the youtuber “guy with the swiss accent”. Can’t remember his name, proper youtube profile or post a link to the website, as I am on mobile… My aging PC is misbehaving.

1 Like



Thanks @PeteKnight

Found it… I think… can’t open it on mobile yet…

Yes, on the 2nd tab is the chart I was referimg to for the ESP32

1 Like

@Wanek: very useful, thank you!

Could you perhaps extend the xls with ‘recommended for output’ as well (for e.g. LEDs, Relays, Buzzers and that kind of stuff)?

1 Like

well, it depends what “device” it is hooked on them, i guess. there is no universal rule for that.

you have to take into consideration the pins default behaviour on startup and think about how it will affect your application: for example if you have a mosfet gate on a pin that goes high at startup for some milliseconds, and that mosfet opens your garage door, it is a bad idea… it will open your door everytime the mcu restarts.

if the mosfet just turns on a light, it is no problem if the mcu restarts and the light will be on for 100 millis.

also, if you hook up a small relay directly to a pin, and the other end of the coil is connected to vcc / gnd, that relay can act as a “pullup” / “pulldown” resistor. you have to choose carefully and avoid to change the state of the pins which must be in a specific state for proper boot.

use common sense and EXPERIMENT for yourself.
for example, in one of my projects i found out that even if gpio 2 theoretically has to be high for proper boot, it still boots properly if it pulled low. i do not know why, but it works.

1 Like

yes, I realised that when asking the question, hence I was aiming at ‘simple’ devices like led, but the garage-door is an interesting example of stuff that can go really wrong when not connected right.

But I meant more for the ESP itself, so the last part where you describe the relay that can act as a pullup/down resistor.
In short which pins are ‘safe’ to use under any (withing bounds obviously) condition, which pins are ‘reasonably safe’ and which should not be used for output (unless you really know what you are doing).

Another way would be to describe the ‘risk’ of using that pin in for output.

common sense if far too rare to use too often, hence its too often not used at all :thinking:
and yes I’ve experimented a LOT and found out that some pins used as output (or even set as output) can screw things up.

pins marked with green (safe pins) and light green (quite safe pins) are the best choice both for input and output.

the ones marked with yellow can be used as output with care and experiment.

the grey ones should be avoided. only use them if you do not have other pins left or you know what are you doing.

thnx, that helps. And is it possible that you share the original file as well? So I can add my own notes, I could type it over but thats a bit silly in this day and age. I recall its not allowed on this forum, so perhaps a (e.g. dropbox) link? Its how I share all my stuff)

You meen that link way up at the first post :wink:

please read the original post carefully, there is the google sheet.

@mikekgr recently came across this article about the best pins to use on the ESP32:

Mike shared the article on a private part of the forum, so I’ve added it on to this thread to enable everyone to see it, and to enable me to find it again when I want to reference it.



thanks @PeteKnight, this is really usefull. unfortunately i was restricted from the lounge, because in the last months i’ve had no time to activate on this forum. so, i couldn’t read the news :slight_smile:

currently i’m very busy with some projects, but maybe i could put together a new table for the esp32 too.

all the best!


I thought you were there before… so I just kicked you back in :smile:

1 Like

thanks man! seems you have good memory :wink:
however, i’m not sure how active i will be. but at least i can read the new stuff.

There’s also some good info on ESP32 GPIOs in this free (if you don’t feel like paying) ebook:

The biggest problem with this ebook is that there’s just too much information!
There’s 1228 pages, but page 251 is where the GPIO info is.


Yes, for sure it is the best of its kind, but for a fast look for the GPIO pins it is a little easier to have something the above table.

Best Regards,
Mike Kranidis

1 Like