prefixkit Ask an engineerAsk Support RU

Smart home

ESP32 (WROOM-32, DevKit) pinout

ESP32 (WROOM-32, DevKit) pin table: which GPIOs are free for sensors and relays, which affect booting (strapping), are taken by flash, USB or are input only, and where the ADC and I²C are. With an ESPHome example.

15 safe 9 with care 8 avoid

GPIOBoard labelUse?FunctionsNotes
GPIO0with careADC2_1, Touch1Strapping pin: pulled LOW at boot = flash mode. Usually the BOOT button. Use as an input with care.
GPIO1TX0avoidUART0 TXUSB serial (logs and flashing).
GPIO2with careADC2_2, Touch2Strapping pin, must be LOW or floating to flash. Built-in LED on many boards.
GPIO3RX0avoidUART0 RXUSB serial (logs and flashing).
GPIO4safeADC2_0, Touch0Free. ADC2 does not work while Wi-Fi is on.
GPIO5with careVSPI CSStrapping pin, outputs a PWM signal at boot. Fine for most sensors.
GPIO6avoidSPI flashConnected to the flash chip.
GPIO7avoidSPI flashConnected to the flash chip.
GPIO8avoidSPI flashConnected to the flash chip.
GPIO9avoidSPI flashConnected to the flash chip.
GPIO10avoidSPI flashConnected to the flash chip.
GPIO11avoidSPI flashConnected to the flash chip.
GPIO12with careADC2_5, Touch5, HSPI MISOStrapping pin: HIGH at boot selects 1.8 V flash and the board will not start. Never pull it up.
GPIO13safeADC2_4, Touch4, HSPI MOSIFree.
GPIO14safeADC2_6, Touch6, HSPI CLKFree; outputs PWM briefly at boot.
GPIO15with careADC2_3, Touch3, HSPI CSStrapping pin: LOW at boot silences the boot log. Fine for most uses.
GPIO16RX2safeUART2 RXFree on WROOM; taken by PSRAM on WROVER modules.
GPIO17TX2safeUART2 TXFree on WROOM; taken by PSRAM on WROVER modules.
GPIO18safeVSPI CLKFree.
GPIO19safeVSPI MISOFree.
GPIO21safeI²C SDADefault I²C data.
GPIO22safeI²C SCLDefault I²C clock.
GPIO23safeVSPI MOSIFree.
GPIO25safeDAC1, ADC2_8Free; the only pins with a real analog output.
GPIO26safeDAC2, ADC2_9Free.
GPIO27safeADC2_7, Touch7Free.
GPIO32safeADC1_4, Touch9Free; ADC1 works with Wi-Fi on: use it for analog sensors.
GPIO33safeADC1_5, Touch8Free; ADC1.
GPIO34with careADC1_6Input only, no internal pull-up.
GPIO35with careADC1_7Input only, no internal pull-up.
GPIO36VPwith careADC1_0Input only, no internal pull-up.
GPIO39VNwith careADC1_3Input only, no internal pull-up.

Boards route pins differently: check your board’s schematic. Strapping pins are read at power-on; if a sensor or button pulls one the wrong way, the board will not boot or will enter flash mode.

ESPHome example

esp32:
  board: esp32dev

i2c:
  sda: GPIO21
  scl: GPIO22

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO27
      mode: INPUT_PULLUP
      inverted: true
    name: "Button"

A full config with sensors, keys and a pin clash check: ESPHome generator. Other boards: ESP32-C3, ESP32-S3, ESP8266.

Where to buy

AliExpress

Links open a search in the shop; some are affiliate links: buying through them costs you nothing extra and supports this site. We do not sell devices or get them from manufacturers.

Idea?