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.
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
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.
| Category | Pins |
|---|---|
| Input-only (no output, no internal pull-up/down) | GPIO34, GPIO35, GPIO36, GPIO39 |
| Reserved for SPI flash - avoid entirely | GPIO6, GPIO7, GPIO8, GPIO9, GPIO10, GPIO11 |
| Strapping pins - handle with care at boot | GPIO0, 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 Block | GPIO Pins |
|---|---|
| ADC1 | GPIO32, GPIO33, GPIO34, GPIO35, GPIO36, GPIO37, GPIO38, GPIO39 |
| ADC2 | GPIO0, GPIO2, GPIO4, GPIO12, GPIO13, GPIO14, GPIO15, GPIO25, GPIO26, GPIO27 |
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.