ESP32 GPIO guide: which pins are safe
Choose the chip, and see every GPIO with what it can do and what it must not be used for: strapping pins that decide how the chip boots, pins wired to the flash or PSRAM, USB, the serial console, input-only pins, and which have ADC, touch or deep sleep wake.
I need:
The rules that bite
- Strapping pins are read at reset and decide the boot mode, the flash voltage or the log. A pull-up or pull-down, a button or a sensor on them can stop the board from booting. Use them only for things that are idle at reset.
- Flash pins (GPIO6 to 11 on the ESP32) are wired to the flash chip inside the module. Touching them crashes the chip.
- PSRAM pins are taken on modules with PSRAM (GPIO16 and 17 on the ESP32 WROVER, 33 to 37 with octal PSRAM on the S3).
- Input only: GPIO34 to 39 on the ESP32 have no output and no internal pull-ups.
- ADC2 on the ESP32 cannot be read while WiFi is on: use ADC1 pins for anything measured with WiFi up.
- USB and UART0 pins carry the serial console and flashing; using them for something else loses that.
The pin data comes from ESP-IDF 5.5's soc headers; strapping pins from the datasheets. Your module may not bring out every GPIO: check its datasheet.
When the device is installed
A pin chosen wrong often shows up only in the field, as a board that does not boot after a power cut. Pinscope reports every restart with its reason, so you see the brownouts and boot loops before the customer does.
Try it
Three devices are free, and no card is needed. Create an account, or read the guide for your platform: ESP32, Zephyr, Raspberry Pi Pico, Linux, ESP8266.
More
- Remote access to an ESP32 without TLS: what it measured and what it costs
- Reaching an ESP32 web server from outside its network
- Updating ESP32 firmware over the internet, with rollback
- Guru Meditation Error: decoding the backtrace, and crashes from the field
- Remote logging: ESP_LOG without a serial cable
- Heap and stack monitoring in the field
- An ESP32 behind CGNAT, 4G or Starlink
- TLS memory usage on the ESP32, and how to reduce it
- Sharing an ESP32 sensor page with anyone, without port forwarding
- ArduinoOTA over the internet, with a rollback
- ESP32 remote access compared: port forwarding, ngrok, Cloudflare Tunnel, Tailscale
- esp_http_server slow? The 250 ms delay and the fix
- Before the first ESP32 ships: a field support checklist
- ESP32 exception decoder: a Guru Meditation backtrace to lines, in the browser