The AI-Thinker ESP32-CAM is a notoriously cramped board. You get an ESP32-S, an OV2640 camera, and a microSD slot on a footprint smaller than a postage stamp, but the 2x9 header layout is entirely unfriendly to standard breadboards. More importantly, the silkscreen is tiny, clone manufacturers frequently misprint the power pins, and misinterpreting the strapping pins will instantly brick your flash memory or fry your camera sensor.

Below is the definitive bench reference for the ESP32-CAM pinout. We are using the official AI-Thinker ESP32-CAM-MB schematic as the baseline standard. If you are holding a bare board from an AliExpress or Amazon bulk pack, read the variant section below before applying power.

The Complete AI-Thinker ESP32-CAM Pinout Table

This table maps the physical left and right headers (viewed with the camera lens facing up and the flash button at the bottom). The 'Constraints' column is where the real engineering decisions happen.

Header / Pin # Silkscreen Label GPIO Number Primary Function Constraints & Warnings
Left 15VN/APower Input (5.0V)Use this for main power. Bypasses the AMS1117 3.3V regulator thermal limits.
Left 2GNDN/AGroundCommon ground. Tie to FTDI GND.
Left 3GPIO 1515SDA / microSD Data2Pulled high on boot. Do not use for external I2C if SD slot is active.
Left 4GPIO 1414SCL / microSD CLKOutputs PWM on boot. Unusable for analog read.
Left 5GPIO 1313PWM / microSD CMDShared with SD card. Unavailable if using microSD.
Left 6GPIO 1212SDI / microSD MISOStrapping pin: Must be LOW on boot. SD card handles this.
Left 7GNDN/AGroundSecondary ground pin.
Left 8GPIO 22SD Card CS / Flash LEDStrapping pin: Must be LOW or floating to boot. Tied to onboard red LED.
Left 9GPIO 44SD Card D1 / FlashControls the bright white front-facing flash LED.
Right 13V3N/A3.3V Output / InputOutput from AMS1117. Max 500mA. Gets too hot to touch under camera load.
Right 2GNDN/AGroundCommon ground.
Right 3GPIO 1616PSRAM CS / U2RXRESERVED. Used for PSRAM chip select. Do not use for general I/O.
Right 4GPIO 00Boot Strapping / I2C SDAFLASH MODE. Tie to GND on boot to flash firmware. Release to run.
Right 5GNDN/AGroundCommon ground.
Right 6RSTN/AReset (Active LOW)Pull to GND momentarily to hard-reset the ESP32-S.
Right 7VCCN/AUnpopulated PadUsually unpopulated on AI-Thinker. On clones, sometimes tied to 5V.
Right 8U0T (TX)1UART0 TXConnect to FTDI RX. 3.3V logic level.
Right 9U0R (RX)3UART0 RXConnect to FTDI TX. 3.3V logic level. 5V tolerant but not recommended.

Module Variants, Camera Ribbons, and Faded Silkscreen

In the embedded world, 'regional standards' translate to manufacturer variants and sensor standards. The ESP32-CAM ecosystem has three major divergence points that will ruin your afternoon if you assume universal compatibility.

AI-Thinker vs. Clone Board Silkscreen Errors

The official AI-Thinker board places 5V on the top-left and 3V3 on the top-right. Many unbranded clone boards from overseas marketplaces flip these two pins on the silkscreen but keep the copper traces the same, or vice versa. If you feed 5V into a clone's mislabeled 3V3 pin, you will instantly vaporize the ESP32-S die.

Safe Interpretation for Faded/Missing Markings: If your silkscreen is rubbed off or unreadable, do not guess. Use a multimeter in continuity mode. Probe the large metal RF shield can—that is your guaranteed Ground. Next, locate the AMS1117 voltage regulator (the small 3-pin SMD component near the headers). The pin connected to the large output capacitor is your 3.3V rail. The pin tied directly to the USB/5V input trace is your 5V rail. Verify with a known-good 5V supply before connecting sensors.

The 24-Pin FPC Camera Ribbon Standard (OV2640 vs OV5640)

The ESP32-CAM uses a standard 24-pin 0.5mm pitch FPC (Flexible Printed Circuit) connector. However, the pinout standard for the OV2640 2MP sensor is completely different from the OV5640 5MP sensor. The data lines and power rails are effectively mirrored. If you plug an OV5640 camera module into a board wired for an OV2640, you will route 3.3V directly into a CMOS data line, permanently killing the sensor. Always match the ribbon to the exact sensor model printed on the back of the camera module.

Pins People Get Wrong (And How They Cause Brownouts)

When debugging ESP32-CAM projects on the bench, 90% of the 'my camera keeps disconnecting' or 'the board won't boot' tickets come down to three specific pinout misunderstandings.

The 3.3V Thermal Trap (Right Pin 1)

The onboard AMS1117 3.3V linear regulator is rated for 800mA on paper, but on this tiny PCB with zero heatsinking, it thermally throttles around 400mA to 500mA. The OV2640 camera draws 120mA to 300mA depending on resolution and frame rate, and the ESP32-S Wi-Fi radio spikes to 350mA during transmission. If you try to power an external I2C sensor or a servo from the 3V3 header pin, the regulator will brownout, causing the ESP32 to reboot endlessly. The Fix: Always power the board via the 5V pin, and if you need external 3.3V power for peripherals, use a dedicated external buck converter (like an LM2596 set to 3.3V) tied to the board's GND.

GPIO 0: The Flash Mode Strapping Pin

GPIO 0 (Right Pin 4) dictates the boot mode. If it is pulled LOW (connected to GND) during a reset or power-on, the ESP32 enters UART bootloader mode. If it is HIGH or floating, it boots from flash memory. Beginners often wire a button or sensor to GPIO 0, which holds it low on boot, resulting in a board that appears completely dead or throws waiting for download in the Arduino IDE serial monitor. Keep GPIO 0 clear of external pull-down circuits.

GPIO 16: The PSRAM Illusion

Because GPIO 16 is broken out to the header, makers frequently try to use it for a secondary SPI device or a digital input. This pin is hardwired to the Chip Select (CS) line of the onboard 4MB PSRAM chip. Toggling GPIO 16 will corrupt the camera's frame buffer in memory, resulting in the dreaded camera_fb_get() returned NULL error or garbled, half-green image outputs.

ESP32-CAM Pinout FAQ

How do I wire the ESP32-CAM pinout to an FTDI programmer?

To flash code via a standard 3.3V FTDI adapter (like the FT232RL), make the following connections: FTDI TX to ESP32-CAM U0R (GPIO 3), FTDI RX to ESP32-CAM U0T (GPIO 1), and FTDI GND to ESP32-CAM GND. Power the ESP32-CAM via its 5V pin (do not rely on the FTDI's 3.3V pin, as it cannot supply the 500mA required for flashing). Critical step: You must bridge GPIO 0 to GND before plugging in the USB. Once the Arduino IDE says 'Hard resetting via RTS pin', disconnect the GPIO 0 to GND bridge and press the onboard RST button to run your code.

Can I use the ESP32-CAM microSD card pins and the camera at the same time?

Yes, but you cannot use the SD card pins for anything else. The microSD slot operates on a 1-bit SDIO bus and claims GPIO 2 (CS), GPIO 4 (Data1/Flash), GPIO 12 (MISO), GPIO 13 (CMD), GPIO 14 (CLK), and GPIO 15 (Data2). When you initialize the SD card in your code using SD_MMC.begin(), these pins are locked. You cannot use them for external PWM, I2C, or digital reads while the SD card is mounted.

Why does my ESP32-CAM brownout when I use the 3.3V pin for external sensors?

As noted in the thermal trap section, the AMS1117 regulator on the ESP32-CAM cannot dissipate the heat generated when dropping 5V to 3.3V at high currents. When the Wi-Fi radio transmits (spiking to ~350mA) and the camera is active (~200mA), you are already at the regulator's thermal ceiling. Adding even a 50mA BME280 sensor to the 3V3 header pin pushes the regulator into thermal shutdown, dropping the voltage to 2.8V and triggering the ESP32's brownout detector (BOD). Power external sensors from a separate 3.3V source.

What happens if I plug an OV5640 camera into an OV2640 ESP32-CAM ribbon cable?

You will destroy the camera module. While both cameras use a 24-pin FPC connector, the Espressif hardware guidelines and sensor datasheets show that the power (VDD/DOVDD) and ground pins are mapped to different physical pins on the ribbon. Plugging an OV5640 into an OV2640-wired board routes 3.3V into the CMOS data output pins, shorting the sensor's internal logic. Always buy pre-assembled modules where the vendor has verified the ribbon-to-board matching, or check the pin-1 indicator on the FPC against your specific board's schematic.