GPIO Pinout & Restrictions

This is the single most important lesson in this track from a safety point of view. The ESP32 chip has far more "special purpose" GPIO restrictions than a simple microcontroller like a classic Arduino Uno, and wiring the wrong thing to the wrong pin is the most common way people damage a board or make it fail to boot. Every restriction below is a property of the ESP32 chip itself, so it applies no matter which dev board you are holding - a DevKitC, a NodeMCU-32S, or an unbranded clone. What is not universal is which physical pin position on your specific board is wired to which chip-level GPIO number - always confirm that against your own board's silkscreen or documentation.

This page's code and wiring instructions are a preview, not something you can run right on this website - this server runs PHP, not the ESP32's own firmware.
3.3V only - never 5V: every GPIO pin on the ESP32 is 3.3V logic and is not 5V tolerant. Connecting a 5V signal directly to a GPIO pin can permanently damage the chip. Many dev boards accept 5V input power over USB or a VIN pin - that is fine, because the board has its own voltage regulator that steps that down to 3.3V before it reaches the chip - but that protection does not extend to signals you wire straight into a GPIO pin from an external 5V sensor or module.

Input-Only Pins

GPIO34, GPIO35, GPIO36, and GPIO39 can only be used as inputs - they cannot drive an output, and they have no internal pull-up or pull-down resistor support. They are fine for reading a sensor or a button (with your own external pull resistor if needed), but you cannot use them to turn on an LED or drive any other output.

Flash-Reserved Pins

Do not use these pins: GPIO6, GPIO7, GPIO8, GPIO9, GPIO10, and GPIO11 are wired internally to the chip's own SPI flash (the memory chip that stores your program). Espressif's own documentation lists these as "not recommended for other uses." Connecting anything to them can interfere with the chip reading its own flash memory, which typically means the board will fail to boot at all. Treat these six pins as off-limits for your own wiring.

Strapping Pins

GPIO0, GPIO2, GPIO5, GPIO12 (also called MTDI), and GPIO15 (also called MTDO) are strapping pins - the ESP32 samples the logic level on these pins at power-up/reset to decide its boot mode (for example, whether to run your program normally or wait to receive new firmware). They can often still be used as ordinary GPIO once the board has finished booting, but avoid connecting anything that would hold them in a conflicting logic level at power-on or reset.

Boot-mode risk: a peripheral wired to a strapping pin that pulls it high or low at the wrong moment can prevent the board from booting normally, or interfere with uploading new firmware. If a board "won't boot" or "won't flash" after wiring something up, a strapping pin is one of the first things to check.
CategoryPins
Input-only (no output, no internal pull-up/down)GPIO34, GPIO35, GPIO36, GPIO39
Reserved for SPI flash - avoid entirelyGPIO6, GPIO7, GPIO8, GPIO9, GPIO10, GPIO11
Strapping pins - handle with care at bootGPIO0, GPIO2, GPIO5, GPIO12 (MTDI), GPIO15 (MTDO)

ADC1 vs ADC2

The ESP32 has two separate analog-to-digital converter blocks: ADC1 with 8 channels and ADC2 with 10 channels, 18 channels combined.

ADC BlockGPIO Pins
ADC1GPIO32, GPIO33, GPIO34, GPIO35, GPIO36, GPIO37, GPIO38, GPIO39
ADC2GPIO0, GPIO2, GPIO4, GPIO12, GPIO13, GPIO14, GPIO15, GPIO25, GPIO26, GPIO27
ADC2 and Wi-Fi conflict: ADC2 shares underlying hardware with the Wi-Fi radio, so its pins cannot be reliably used for analog readings while Wi-Fi is active. If your project needs both Wi-Fi and an analog sensor reading, wire the sensor to an ADC1 pin, not an ADC2 pin. This is covered again with a practical example in the ADC & Reading Sensors lesson.

Notice GPIO0, GPIO2, and GPIO15 appear on both the ADC2 list and the strapping-pin list above - another reason ADC1 is the more beginner-friendly choice.

DAC Pins

GPIO25 and GPIO26 are the chip's two DAC (digital-to-analog converter) pins - these can output an actual analog voltage (8-bit resolution), which is a different capability from an ADC pin reading an analog voltage in.

Capacitive Touch Pins

The ESP32 has 10 built-in capacitive touch-sensing pins: GPIO4, GPIO0, GPIO2, GPIO15, GPIO13, GPIO12, GPIO14, GPIO27, GPIO32, and GPIO33. Notice that some of these (GPIO0, GPIO2, GPIO12, GPIO15) are also strapping pins - if you plan to use one of these as a touch input, treat it with the same boot-time caution described above.

Recap: Input-only: 34, 35, 36, 39. Avoid entirely (flash): 6-11. Strapping (handle with care at boot): 0, 2, 5, 12, 15. ADC1 (8 ch, Wi-Fi safe) vs ADC2 (10 ch, not usable with Wi-Fi active). DAC: 25, 26. Touch: 4, 0, 2, 15, 13, 12, 14, 27, 32, 33. All of these are chip-level GPIO numbers - confirm the matching physical pin on your own board before wiring.
Next steps: Head to Getting Started & Development Environments to set up your toolchain.