ABC of Electronics cosycom.com
ESP32 BASICS · LESSON 02

ESP32 Pinout & Power Basics

GPIO numbering, the pins to avoid, and how to power a dev board safely from USB or a battery.

Before wiring anything up, it helps to know which pins are safe to use freely, which have a special job at boot, and which should be left alone. Getting this wrong is one of the most common reasons a first ESP32 project won't upload or behaves strangely.

ESP32 dev board 3V3 GND GPIO4 GPIO16 GPIO17 VIN / 5V GPIO21 (SDA) GPIO22 (SCL) GPIO18 (SCK) GPIO23 (MOSI) Pin names shown are typical for a 30-pin dev board — always check your specific board's silkscreen.
Fig. Generic ESP32 dev board pinout (labels vary by manufacturer).

General-purpose pins

Most GPIO pins can be configured in software as input or output, and many also support PWM, analog input, or a communication bus. That flexibility is convenient, but it also means a handful of pins are reserved for the flash memory chip inside the module and must not be touched.

Pins worth knowing before you wire anything
Pin groupTypical useNote
GPIO 6–11Connected internally to flashAvoid — reserved on most modules
GPIO 0, 2Boot mode selectionUsually fine after boot, avoid pulling low at power-up
GPIO 34–39Input-only, analog capableNo internal pull-up/pull-down, no output
GPIO 21, 22Default I2C (SDA/SCL)Free to reuse if you're not using I2C

Power pins

Most dev boards have a 5V-tolerant input pin (often labelled VIN or 5V) for USB or an external supply, plus a 3V3 pin that outputs the board's regulated 3.3 V rail — useful for powering small sensors, but not able to supply much current on its own.

KEY IDEA
Treat every ESP32 GPIO as a 3.3 V pin. Feeding 5 V logic into one directly can damage the chip.