ESP32 DevKit V1 pinout — safe pins, strapping pins and what to avoid

Which ESP32 pins are safe to use, which are input-only, which break the boot and why ADC2 stops working the moment Wi-Fi starts. Keep this tab open.

  • Beginner
  • Published

The ESP32 has plenty of GPIO, but a meaningful number of pins come with conditions — some are input-only, some decide how the chip boots, and one whole ADC unit stops working when the radio is on. This is the reference for which is which.

Pin numbers here are the GPIO numbers, which is what pinMode() and digitalWrite() take. Silkscreen labels vary between board vendors; the GPIO number does not.

Pins that are safe for anything

These have no boot-time role and no special hardware attached. Reach for these first:

GPIO4, GPIO13, GPIO14, GPIO16, GPIO17, GPIO18, GPIO19, GPIO21, GPIO22, GPIO23, GPIO25, GPIO26, GPIO27, GPIO32, GPIO33

If a pin is in that list, you can use it as an input or an output without thinking about it further.

Pins with conditions

PinsCondition
GPIO6 – GPIO11Wired to the internal SPI flash. Not usable, and not brought out on most boards.
GPIO34, GPIO35, GPIO36 (VP), GPIO39 (VN)Input only. No output driver, and no internal pull-up or pull-down.
GPIO0Strapping pin. Held LOW at reset to enter the bootloader — a pull-down here stops normal boot.
GPIO2Strapping pin, and the on-board LED on most boards. Must not be held HIGH while GPIO0 is LOW.
GPIO12 (MTDI)Strapping pin that selects flash voltage at reset. A pull-up at boot can stop the board starting.
GPIO15 (MTDO)Strapping pin, pulled HIGH by default. Pulling it LOW at boot silences the bootloader log.
GPIO5Strapping pin (SDIO timing), and the default VSPI chip-select. Fine for general use once booted.
GPIO1 (TX0), GPIO3 (RX0)The USB serial console. Usable, but you lose the serial monitor and uploads get awkward.
Heads up

The strapping pins are only sampled during the reset pulse. They are perfectly usable afterwards — the trap is a component that holds one of them at the wrong level while the board is starting, such as a relay module with a pull-up sitting on GPIO12.

ADC — and the ADC2 trap

The ESP32 has two ADC units, and the difference between them decides whether your analogue reading works.

UnitPinsUsable with Wi-Fi on?
ADC1GPIO32, 33, 34, 35, 36, 39Yes — always.
ADC2GPIO0, 2, 4, 12, 13, 14, 15, 25, 26, 27No — the Wi-Fi driver claims ADC2 while the radio is active.

This is one of the most common "my sensor worked until I added Wi-Fi" reports. There is no software workaround worth using: put analogue inputs on ADC1 and the problem never comes up.

The ADC is also not especially linear near the rails. Readings compress noticeably above roughly 3.1 V, so a divider that puts your signal in the middle of the range gives better results than one that uses every last millivolt.

Default bus pins

These are the defaults the Arduino core uses. All of them can be remapped through the ESP32's GPIO matrix — unlike an AVR, the peripheral is not tied to the pin.

BusSignalDefault GPIO
I2CSDAGPIO21
I2CSCLGPIO22
SPI (VSPI)MOSIGPIO23
SPI (VSPI)MISOGPIO19
SPI (VSPI)SCKGPIO18
SPI (VSPI)CSGPIO5
UART0TX / RXGPIO1 / GPIO3
UART2TX / RXGPIO17 / GPIO16

An SSD1306 OLED goes on GPIO21/22 with no configuration at all; so does almost every I2C sensor breakout.

Touch, DAC and deep-sleep wake

  • Capacitive touch is available on GPIO0, 2, 4, 12, 13, 14, 15, 27, 32 and 33 (T1, T2, T0, T5, T4, T6, T3, T7, T9, T8 respectively).
  • True analogue output (DAC) exists on just two pins: GPIO25 and GPIO26.
  • RTC GPIOs, the only pins that can wake the chip from deep sleep, are GPIO0, 2, 4, 12–15, 25–27 and 32–39. A wake button on GPIO21 will never fire.

Power pins

  • VIN / 5V — 5 V in, feeds the on-board regulator. This is the pin to use when powering from an external supply.
  • 3V3 — regulator output. It can source only a modest amount of current; a servo or an LED strip on this pin is a brownout waiting to happen.
  • GND — several pins, all common. Share ground with every external supply you use.
Note

The ESP32 is a 3.3 V part with no 5 V tolerance on its GPIO. Anything that outputs a 5 V logic level — many ultrasonic modules, most Arduino shields — needs a divider or a level shifter on the way in. Outputs are usually fine in the other direction, since 3.3 V clears the logic-HIGH threshold of most 5 V inputs.

Frequently asked questions

Why does analogRead() return 0 on some pins once Wi-Fi is connected?

Those pins are on ADC2, and the Wi-Fi driver takes ADC2 for itself while the radio is active. Move the input to any ADC1 pin (GPIO32–GPIO39) and it works again.

Why won't my board boot with a sensor on GPIO12?

GPIO12 is a strapping pin (MTDI) sampled at reset to set the flash voltage. A pull-up on it at boot selects the wrong voltage and the board fails to start. Move the signal to another pin.

Are the ESP32's GPIOs 5 V tolerant?

No. They are 3.3 V pins. Feeding a 5 V sensor output straight into one works until it doesn't — use a divider or a level shifter for anything that swings to 5 V.

Why are GPIO6 to GPIO11 missing from most pinout diagrams?

They are wired to the module's internal SPI flash. Using them for anything else stops the chip from reading its own program.

AA
Written byAquib AnsariEmbedded systems engineer · founder, Electronixity

Embedded systems engineer and the founder of Electronixity. Builds the projects on this site on an actual bench, with the same parts the store ships — so the wiring in a tutorial matches what turns up in the box.

More about Aquib