ESP8266/Wemos D1 Mini pin states and stability on boot/reset
22 Nov 2021 | all notes
The only two pins on the ESP8266 (and derivates such as ESP-12F etc) which are always high impedance and can be safely used with relays (or other externals that don’t get spooked by high signals during boot/reset) are GPIO5 and GPIO4 (D1 and D2 on the Wemos D1 Mini). Sources:
- Stephen Warren’s ESP8266 GPIO Behaviour at Boot (most detailed pin behaviour analysis)
- https://randomnerdtutorials.com/esp8266-pinout-reference-gpios/
- https://www.esp8266.com/viewtopic.php?f=32&t=16141
Summary table (pin order is according to Wemos D1 mini pin layout):
D1 Mini pin label | D1 R1 pin label | ESP8266 GPIO | Input | Output | Notes |
---|---|---|---|---|---|
RST | |||||
A0 | A0 | ADC0 | analog | ❌ | 10 bit analog input |
D0 | D2 | GPIO16 | no interrupt | no PWM or I2C | driven HIGH during boot, don’t short to GND. |
D5 | D13/SCK/D5 (board led?) | GPIO14 | ✅ | ⚠️ | pulled HIGH during boot |
D6 | D12/MISO/D6 | GPIO12 | ✅ | ⚠️ | pulled HIGH during boot |
D7 | D1/MOSI/D7 | GPIO13 | ✅ | ⚠️ | pulled HIGH during boot |
D8 | D10/SS | GPIO15 | pulled to GND | ⚠️ | pulled HIGH + driven LOW during boot, boot fails if pulled HIGH |
TX | TX->D1 | GPIO1 | TX pin | ⚠️ | pulled HIGH + driven LOW during boot, boot fails if pulled LOW |
RX | RX<-D0 | GPIO3 | ⚠️ | RX pin | pulled HIGH during boot |
D1 | D15/SCL/D3 | GPIO5 | ✅ | ✅ | always high impedance |
D2 | D14/SDA/D4 | GPIO4 | ✅ | ✅ | always high impedance |
D3 | D8 | GPIO0 | pulled up | ✅ | pulled HIGH + driven LOW during boot, boot fails if pulled LOW (connected to Flash button) |
D4 | TX1/D9 | GPIO2 (BUILTIN_LED) | pulled up | ✅ | pulled HIGH + driven LOW during boot, boot fails if pulled LOW (on-board LED?) |